Skip to content

Commit 9d2bfda

Browse files
author
klaas
committed
Fixed test descriptions to put comments in the correct place and updated some stylistic issues with test cases.
1 parent e0c3138 commit 9d2bfda

File tree

22 files changed

+98
-35
lines changed

22 files changed

+98
-35
lines changed

regression/contracts/function_apply_01/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ __CPROVER_ensures(__CPROVER_return_value == 0)
1212
return 1;
1313
}
1414

15-
int main() {
15+
int main()
16+
{
1617
int x = foo();
1718
assert(x == 0);
1819
return 0;
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
KNOWNBUG # Applying code contracts currently also checks them.
1+
KNOWNBUG
22
main.c
33
--apply-code-contracts
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
Applying code contracts currently also checks them.

regression/contracts/function_check_01/main.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ int min(int a, int b)
1212
(__CPROVER_return_value == a || __CPROVER_return_value == b)
1313
)
1414
{
15-
if (a <= b) {
15+
if (a <= b)
16+
{
1617
return a;
17-
} else {
18+
}
19+
else
20+
{
1821
return b;
1922
}
2023
}
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
KNOWNBUG # --check-code-contracts not implemented yet.
1+
KNOWNBUG
22
main.c
33
--check-code-contracts
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
--check-code-contracts not implemented yet.

regression/contracts/function_check_02/main.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,16 @@ __CPROVER_ensures(
88
__CPROVER_forall {int i; (0 <= i && i < 10) ==> arr[i] == i}
99
)
1010
{
11-
for(int i = 0; i < 10; i++) {
11+
for(int i = 0; i < 10; i++)
12+
{
1213
arr[i] = i;
1314
}
1415

1516
return 0;
1617
}
1718

18-
int main() {
19+
int main()
20+
{
1921
int arr[10];
2022
initialize(arr);
2123
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
KNOWNBUG # Ensures statements currently do not allow quantified predicates unless the function has void return type.
1+
KNOWNBUG
22
main.c
33
--check-code-contracts
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
Ensures statements currently do not allow quantified predicates unless the
10+
function has void return type.

regression/contracts/function_check_03/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ __CPROVER_ensures(
1919
}
2020
}
2121

22-
int main() {
22+
int main()
23+
{
2324
int arr[10];
2425
initialize(arr, 10);
2526
}
Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
1-
KNOWNBUG # Loop invariants currently do not support memory reads.
1+
KNOWNBUG
22
main.c
33
--check-code-contracts
44
^EXIT=0$
55
^SIGNAL=0$
66
^VERIFICATION SUCCESSFUL$
7+
--
8+
--
9+
Loop invariants currently do not support memory reads in at least some
10+
circumstances.

regression/contracts/function_check_04/main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,8 @@ __CPROVER_ensures(__CPROVER_return_value == 0)
1111
return 1;
1212
}
1313

14-
int main() {
14+
int main()
15+
{
1516
int x = foo();
1617
assert(x == 0);
1718
return 0;
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
KNOWNBUG # --check-code-contracts not implemented yet.
1+
KNOWNBUG
22
main.c
33
--check-code-contracts
44
^\[main.assertion.1\] assertion x == 0: SUCCESS$
55
^\[foo.1\] : FAILURE$
66
^VERIFICATION FAILED$
7+
--
8+
--
9+
--check-code-contracts not implemented yet.

0 commit comments

Comments
 (0)