Skip to content

Commit 5fc47c2

Browse files
committed
Differentiate smoke probe markers
1 parent 1f5616f commit 5fc47c2

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

vm/tests/src/test/java/com/codename1/tools/translator/StackOverflowIntegrationTest.java

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -100,12 +100,13 @@ void throwsAndRecoversFromStackOverflow(CompilerHelper.CompilerConfig config) th
100100
"StackOverflowApp smoke run exited with code " + smokeResult.exitCode
101101
+ ". Output:\n" + smokeResult.output
102102
+ smokeDiagnostics);
103-
int smokeProbeCount = countOccurrences(smokeResult.output, "PROBE_CONSTANT");
104-
assertTrue(smokeProbeCount >= 2,
105-
"StackOverflowApp smoke run should emit two probe markers. Output was:\n"
103+
assertTrue(smokeResult.output.contains("PROBE_CONSTANT_ONE"),
104+
"StackOverflowApp smoke run should emit PROBE_CONSTANT_ONE. Output was:\n"
105+
+ smokeResult.output + smokeDiagnostics);
106+
assertTrue(smokeResult.output.contains("PROBE_CONSTANT_TWO"),
107+
"StackOverflowApp smoke run should emit PROBE_CONSTANT_TWO. Output was:\n"
106108
+ smokeResult.output
107-
+ "\nObserved PROBE_CONSTANT count: " + smokeProbeCount
108-
+ "\nA count of 1 suggests a crash between the first and second reportConstant() calls."
109+
+ "\nMissing PROBE_CONSTANT_TWO suggests a crash between the first and second print."
109110
+ smokeDiagnostics);
110111

111112
ProcessResult result = runProcess(Arrays.asList(executable.toString(), "overflow", "run"), buildDir);
@@ -158,8 +159,9 @@ private String nativeReportSource() {
158159
" fflush(stdout);\n" +
159160
"}\n" +
160161
"void StackOverflowApp_reportConstantTwice__(CODENAME_ONE_THREAD_STATE) {\n" +
161-
" printf(\"PROBE_CONSTANT\\n\");\n" +
162-
" printf(\"PROBE_CONSTANT\\n\");\n" +
162+
" printf(\"PROBE_CONSTANT_ONE\\n\");\n" +
163+
" fflush(stdout);\n" +
164+
" printf(\"PROBE_CONSTANT_TWO\\n\");\n" +
163165
" fflush(stdout);\n" +
164166
"}\n" +
165167
"void StackOverflowApp_report___java_lang_String(CODENAME_ONE_THREAD_STATE, JAVA_OBJECT msg) {\n" +

0 commit comments

Comments
 (0)