File tree Expand file tree Collapse file tree 2 files changed +21
-1
lines changed
regression/cbmc/Array_operations1 Expand file tree Collapse file tree 2 files changed +21
-1
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,23 @@ void test_equal()
1212 __CPROVER_assert (array1 [index ] == array2 [index ], "arrays are equal" );
1313}
1414
15+ void test_unequal ()
16+ {
17+ int a1 [10 ];
18+ int a2 [16 ];
19+
20+ __CPROVER_assert (
21+ !__CPROVER_array_equal (a1 , a2 ), "different sizes arrays are unequal" );
22+
23+ float a3 [10 ];
24+ void * lost_type1 = a1 ;
25+ void * lost_type3 = a3 ;
26+
27+ __CPROVER_assert (
28+ !__CPROVER_array_equal (lost_type1 , lost_type3 ),
29+ "different typed arrays are unequal" );
30+ }
31+
1532void test_copy ()
1633{
1734 char array1 [100 ], array2 [100 ], array3 [90 ];
@@ -54,4 +71,5 @@ int main()
5471 test_copy ();
5572 test_replace ();
5673 test_set ();
74+ test_unequal ();
5775}
Original file line number Diff line number Diff line change 44^EXIT=10$
55^SIGNAL=0$
66^\[test_copy\.assertion\.4\] .* expected to fail: FAILURE$
7- ^\*\* 1 of 8 failed
7+ ^\[test_unequal\.assertion\.1\] .* different sizes arrays are unequal: SUCCESS
8+ ^\[test_unequal\.assertion\.2\] .* different typed arrays are unequal: SUCCESS
9+ ^\*\* 1 of 10 failed
810^VERIFICATION FAILED$
911--
1012^warning: ignoring
You can’t perform that action at this time.
0 commit comments