Skip to content

Commit a6fd729

Browse files
committed
Cleanup tests with anomalous main functions
A forthcoming PR will make jbmc only recognise 'public static void main(String[])' as a main entry point (anything named 'main' but not matching that type will need explicit --function nomination. This adds the extra argument where required. One test (NondetInit3) is fixed as it was previously assuming that its parameter couldn't be null, which only happens when main(Subclass) is handled like it was main(String[]), where the String[] reference really cannot be null.
1 parent 38e6e4a commit a6fd729

File tree

102 files changed

+101
-107
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

102 files changed

+101
-107
lines changed

regression/cbmc-java/ArithmeticException6/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
ArithmeticExceptionTest.class
3-
--java-throw-runtime-exceptions
3+
--java-throw-runtime-exceptions --function ArithmeticExceptionTest.main
44
^EXIT=10$
55
^SIGNAL=0$
66
^.*assertion at file ArithmeticExceptionTest.java line 7 function.*: FAILURE$

regression/cbmc-java/LocalVarTable5/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-goto-functions
3+
--show-goto-functions --function test.main
44
dead anonlocal::1i
55
dead anonlocal::2i
66
dead anonlocal::3a
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
5-
0 Bytes
Binary file not shown.
8 Bytes
Binary file not shown.

regression/cbmc-java/NondetInit3/Test.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@ public static void main(Subclass nondetInput) {
1414
// The condition enforced by cproverNondetInitialize should hold
1515
// even though the parameter is a subtype of Test, not directly an
1616
// instance of Test itself.
17-
assert nondetInput.arr.length == 1;
17+
if(nondetInput != null)
18+
assert nondetInput.arr.length == 1;
1819
}
1920

2021
}
+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
5-

regression/cbmc-java/VarLengthArrayTrace1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
VarLengthArrayTrace1.class
3-
--trace
3+
--trace --function VarLengthArrayTrace1.main
44
^EXIT=10$
55
^SIGNAL=0$
66
dynamic_3_array\[1.*\]=10

regression/cbmc-java/arrayread1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
arrayread1.class
3-
--unwind 3 --no-propagation
3+
--unwind 3 --no-propagation --function arrayread1.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/cast_null1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
3+
--function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/cast_null2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--java-throw-runtime-exceptions
3+
--java-throw-runtime-exceptions --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/destructor1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Break.class
3-
--show-goto-functions
3+
--show-goto-functions --function Break.main
44
^EXIT=0$
55
^SIGNAL=0$
66
dead i;

regression/cbmc-java/exceptions22/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
3+
--function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
VERIFICATION SUCCESSFUL

regression/cbmc-java/external_getstatic1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
3+
--function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/inferlexicalscope1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-symbol-table
3+
--show-symbol-table --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^pc7:

regression/cbmc-java/inherited_static_field1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
55
--
66
--

regression/cbmc-java/inherited_static_field10/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
Stub static field x found for non-stub type java::Test\. In future this will be a fatal error\.
55
assertion at file Test\.java line 6 .* FAILURE
66
^VERIFICATION FAILED$

regression/cbmc-java/inherited_static_field2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
55
--
66
--

regression/cbmc-java/inherited_static_field3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
55
--
66
--

regression/cbmc-java/inherited_static_field4/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
assertion at file Test\.java line 6 .* FAILURE
55
^VERIFICATION FAILED$
66
--

regression/cbmc-java/inherited_static_field5/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
55
--
66
--

regression/cbmc-java/inherited_static_field6/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
assertion at file Test\.java line 6 .* FAILURE
55
^VERIFICATION FAILED$
66
--

regression/cbmc-java/inherited_static_field7/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
^VERIFICATION SUCCESSFUL$
55
--
66
--

regression/cbmc-java/inherited_static_field8/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
assertion at file Test\.java line 6 .* SUCCESS
55
assertion at file Test\.java line 7 .* FAILURE
66
^VERIFICATION FAILED$

regression/cbmc-java/inherited_static_field9/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
3+
--function Test.main
44
Stub static field x found for non-stub type java::Test\. In future this will be a fatal error\.
55
Stub static field x found for non-stub type java::Parent\. In future this will be a fatal error\.
66
assertion at file Test\.java line 6 .* FAILURE

regression/cbmc-java/isnan1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
3+
--function test.main
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$

regression/cbmc-java/json_trace1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--cover location --trace --json-ui
3+
--cover location --trace --json-ui --function Test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
--

regression/cbmc-java/json_trace3/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--cover location --trace --json-ui --unwind 5
3+
--cover location --trace --json-ui --unwind 5 --function Test.main
44
activate-multi-line-match
55
EXIT=0
66
SIGNAL=0
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
CORE
22
Test.class
3-
--show-goto-functions
3+
--show-goto-functions --function Test.main
44
java::Unused::clinit_wrapper
55
Unused\.<clinit>\(\)
6-
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--lazy-methods --show-goto-functions
3+
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Unused::clinit_wrapper
66
Unused\.<clinit>\(\)
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CORE
22
Test.class
3-
--lazy-methods
3+
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5-
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
CORE
22
Test.class
3-
--show-goto-functions
3+
--show-goto-functions --function Test.main
44
java::Unused1::clinit_wrapper
55
java::Unused2::clinit_wrapper
66
Unused2\.<clinit>\(\)
7-

regression/cbmc-java/lazyloading_synthetic_method_cleanup2/check_clinit_removed_by_lazy_loading.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--lazy-methods --show-goto-functions
3+
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Unused1::clinit_wrapper
66
java::Unused2::clinit_wrapper
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CORE
22
Test.class
3-
--lazy-methods
3+
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5-
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
CORE
22
Test.class
3-
--show-goto-functions
3+
--show-goto-functions --function Test.main
44
java::Opaque\.<clinit>:\(\)V
55
java::Opaque::clinit_wrapper
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--lazy-methods --show-goto-functions
3+
--lazy-methods --show-goto-functions --function Test.main
44
--
55
java::Opaque\.<clinit>:\(\)V
66
java::Opaque::clinit_wrapper
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
CORE
22
Test.class
3-
--lazy-methods
3+
--lazy-methods --function Test.main
44
VERIFICATION SUCCESSFUL
5-
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-goto-functions
3+
--show-goto-functions --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
test\.java line 5 function java::test.main:\(\)V bytecode-index 1

regression/cbmc-java/static_init1/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
static_init.class
3-
3+
--function static_init.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/static_init2/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
static_init.class
3-
3+
--function static_init.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/cbmc-java/trace_options_json_extended/extended.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--trace --json-ui --trace-json-extended
3+
--trace --json-ui --trace-json-extended --function Test.main
44
^EXIT=10$
55
^SIGNAL=0$
66
rawLhs

regression/cbmc-java/trace_options_json_extended/non-extended.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--trace --json-ui
3+
--trace --json-ui --function Test.main
44
^EXIT=10$
55
^SIGNAL=0$
66
--

regression/cbmc-java/virtual7/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test.class
3-
--show-goto-functions
3+
--show-goto-functions --function test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
IF.*"java::C".*THEN GOTO [12]

regression/cbmc-java/virtual8/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test.class
3-
--program-only
3+
--program-only --function Test.main
44
^EXIT=0$
55
^SIGNAL=0$
66
C\.f

regression/jbmc-strings/java_append_char/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_append_char.class
3-
--refine-strings --string-max-length 1000 --no-core-models
3+
--refine-strings --string-max-length 1000 --no-core-models --function test_append_char.main
44
^EXIT=10$
55
^SIGNAL=0$
66
^VERIFICATION FAILED$

regression/jbmc-strings/java_char_array_init/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_init.class
3-
--refine-strings --string-max-length 1000
3+
--refine-strings --string-max-length 1000 --function test_init.main
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* file test_init.java line 31 .* SUCCESS$

regression/jbmc-strings/java_insert_char_array/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_insert_char_array.class
3-
--refine-strings --string-max-length 1000
3+
--refine-strings --string-max-length 1000 --function test_insert_char_array.main
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* line 28.* SUCCESS$

regression/strings-smoke-tests/java_append_string/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_append_string.class
3-
--refine-strings --verbosity 10 --string-max-length 1000
3+
--refine-strings --verbosity 10 --string-max-length 1000 --function test_append_string.main
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$

regression/strings-smoke-tests/java_case/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_case.class
3-
--refine-strings --verbosity 10 --string-max-length 1000
3+
--refine-strings --verbosity 10 --string-max-length 1000 --function test_case.main
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* file test_case.java line 10 .* SUCCESS$

regression/strings-smoke-tests/java_char_array/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_char_array.class
3-
--refine-strings --verbosity 10 --string-max-length 1000
3+
--refine-strings --verbosity 10 --string-max-length 1000 --function test_char_array.main
44
^EXIT=10$
55
^SIGNAL=0$
66
.*assertion.* test_char_array.java line 7 .* SUCCESS$

regression/strings-smoke-tests/java_insert_char_array/test.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
test_insert_char_array.class
3-
--refine-strings --verbosity 10 --string-max-length 1000
3+
--refine-strings --verbosity 10 --string-max-length 1000 --function test_insert_char_array.main
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* file test_insert_char_array.java line 20 .* SUCCESS$

regression/strings-smoke-tests/java_int_to_string/test1.desc

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
CORE
22
Test1.class
3-
--refine-strings --verbosity 10 --string-max-length 1000
3+
--refine-strings --verbosity 10 --string-max-length 1000 --function Test1.main
44
^EXIT=10$
55
^SIGNAL=0$
66
assertion.* line 7 .* SUCCESS$

0 commit comments

Comments
 (0)