Skip to content

Commit 8fc89c3

Browse files
committed
Add fault-localization regression tests
Moving the (three) tests from a dedicated folder to cbmc to run them, also making use of all three configurations that the cbmc folder is being tested with.
1 parent 8dd9f80 commit 8fc89c3

File tree

12 files changed

+59
-66
lines changed

12 files changed

+59
-66
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c)
7+
x = 0;
8+
else
9+
x++;
10+
assert(x == 0);
11+
assert(x != 0);
12+
}
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
KNOWNBUG
2+
main.c
3+
--localize-faults
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
line 7 function main$
7+
line 9 function main$
8+
^VERIFICATION FAILED$
9+
--
10+
--
11+
With --localize-faults, CBMC only reports the first assertion as failing.
12+
Without --localize-faults, CBMC correctly reports both assertions as failing.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c)
7+
x = 0;
8+
else
9+
x++;
10+
assert(x == 0);
11+
assert(x == 0 || c == 0);
12+
}
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
KNOWNBUG
2+
main.c
3+
--localize-faults
4+
^EXIT=10$
5+
^SIGNAL=0$
6+
line 9 function main$
7+
^VERIFICATION FAILED$
8+
--
9+
--
10+
CBMC wrongly reports line 7 as the faulty statement when instead it should be
11+
line 9.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
#include <assert.h>
2+
3+
void main()
4+
{
5+
int x, c;
6+
if(c)
7+
x = 0;
8+
else
9+
x++;
10+
assert(x == 0);
11+
assert(x != 0);
12+
}

regression/fault-localization/Makefile

Lines changed: 0 additions & 19 deletions
This file was deleted.

regression/fault-localization/all_properties1/main.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

regression/fault-localization/all_properties1/test.desc

Lines changed: 0 additions & 9 deletions
This file was deleted.

regression/fault-localization/all_properties2/main.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

regression/fault-localization/all_properties2/test.desc

Lines changed: 0 additions & 8 deletions
This file was deleted.

regression/fault-localization/stop_on_fail1/main.c

Lines changed: 0 additions & 10 deletions
This file was deleted.

0 commit comments

Comments
 (0)