Skip to content

Commit bf7e20b

Browse files
committed
Add tests of the parsing of the --object-bits argument
In order to ensure that this functionality is not broken by subsequent refactorings.
1 parent af5bc99 commit bf7e20b

File tree

5 files changed

+39
-0
lines changed

5 files changed

+39
-0
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.c
3+
--object-bits foobar
4+
object-bits must be positive and less than the pointer width
5+
^EXIT=1$
6+
^SIGNAL=0$
7+
--
8+
Test parsing of an invalid non numeric object-bits setting.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
2+
#include <assert.h>
3+
#include <stdlib.h>
4+
5+
int main(int argc, char **argv)
6+
{
7+
void *p = malloc(1);
8+
}
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.c
3+
--object-bits 65
4+
object-bits must be positive and less than the pointer width
5+
^EXIT=1$
6+
^SIGNAL=0$
7+
--
8+
Test parsing of a too large object-bits setting.
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
test.c
3+
--object-bits 8
4+
^EXIT=0$
5+
^SIGNAL=0$
6+
--
7+
Test parsing of a valid object-bits setting.
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
CORE
2+
test.c
3+
--object-bits 0
4+
object-bits must be positive and less than the pointer width
5+
^EXIT=1$
6+
^SIGNAL=0$
7+
--
8+
Test parsing of a too small object-bits setting.

0 commit comments

Comments
 (0)