Skip to content

Commit 9987033

Browse files
author
Thomas Kiley
committed
Add a test for array of void* pointers
1 parent b727c58 commit 9987033

File tree

2 files changed

+20
-0
lines changed

2 files changed

+20
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#include <assert.h>
2+
#include <stdbool.h>
23

34
void test_function(void *input)
45
{
56
assert(input == 0);
67
}
8+
9+
void test_void_array(void *input_array[10])
10+
{
11+
__CPROVER_assume(input_array != 0);
12+
assert(input_array[0] == 0);
13+
assert(false);
14+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
CORE
2+
main.c
3+
--harness-type call-function --function test_function
4+
\[test_void_array\.assertion\.1\] line 11 assertion input_array\[0\] == 0: SUCCESS
5+
\[test_void_array\.assertion\.2\] line 12 assertion false: FAILURE
6+
^VERIFICATION FAILED$
7+
^EXIT=10$
8+
^SIGNAL=0$
9+
--
10+
--
11+
Ensure the harness is able to initalize an array of void* pointers where
12+
the array is non-null, but the elements are null.

0 commit comments

Comments
 (0)