Skip to content

Commit 5c21828

Browse files
committed
add comments
1 parent d5a9672 commit 5c21828

3 files changed

Lines changed: 15 additions & 2 deletions

File tree

testdata/ostrusted-unsat-test/Unsat.java

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
11
import ostrusted.qual.OsUntrusted;
22
import ostrusted.qual.OsTrusted;
33

4+
/**
5+
* This case is unsatisfiable, because in method {@code m()},
6+
* <p>(1) at line 18, the local variable {@code s} is refined by the return type of {@code bar()}.
7+
* Denote the refinement variable as @1, then @1 == @OsUntrusted.
8+
* <p>(2) at line 20, {@code s} is passed to method {@code foo} as the argument, therefore @1 <: @OsTrusted
9+
* since @OsTrusted is bottom, @1 == @OsTrusted.
10+
*/
411
class Unsat {
512

613
void foo(@OsTrusted String s) {}

tests/checkers/inference/test/CFInferenceTest.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,11 @@ testFile, testDataDir, checkerName, checkerOptions, getAdditionalInferenceOption
6060
postProcessResult(testResult);
6161
}
6262

63+
/**
64+
* Report a summary of the failed test based on the {@link InferenceTestResult}.
65+
*
66+
* @param testResult the test result returned by {@code InferenceTestExecutor}
67+
*/
6368
protected void postProcessResult(InferenceTestResult testResult) {
6469
InferenceTestUtilities.assertResultsAreValid(testResult);
6570
}

tests/checkers/inference/test/CFInferenceUnsatTest.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,9 @@
66
import java.io.File;
77

88
/**
9-
* This test suite runs inference individually on target files that are unsatisfiable. This means each
10-
* test case is expected to pass the initial check phase while fail at the inference phase and terminate.
9+
* This test suite runs inference individually on target files that are unsatisfiable. A test case passes
10+
* when it passes the initial check phase (i.e. outputs expected errors/warnings and none unexpected ones),
11+
* while fails at the inference phase and then terminates.
1112
*
1213
* The use of this class is the same as {@link CFInferenceTest}. Note that the target directory of the test
1314
* cases can only contain unsatisfiable cases.

0 commit comments

Comments
 (0)