aboutsummaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
Diffstat (limited to 'tests')
-rw-r--r--tests/Makefile4
-rw-r--r--tests/boundtest.c19
2 files changed, 21 insertions, 2 deletions
diff --git a/tests/Makefile b/tests/Makefile
index f91e4fd..019c890 100644
--- a/tests/Makefile
+++ b/tests/Makefile
@@ -81,8 +81,8 @@ test4: test.ref
@if diff -u test.ref test4.out ; then echo "BCheck Auto Test OK"; fi
# memory and bound check auto test
-BOUNDS_OK = 1 4 8 10
-BOUNDS_FAIL= 2 5 7 9 11 12 13
+BOUNDS_OK = 1 4 8 10 14
+BOUNDS_FAIL= 2 5 7 9 11 12 13 15
btest: boundtest.c
@echo ------------ $@ ------------
diff --git a/tests/boundtest.c b/tests/boundtest.c
index 9bc9828..c2b2953 100644
--- a/tests/boundtest.c
+++ b/tests/boundtest.c
@@ -169,6 +169,23 @@ int test13(void)
return strlen(tab);
}
+int test14(void)
+{
+ char *p = alloca(TAB_SIZE);
+ memset(p, 'a', TAB_SIZE);
+ p[TAB_SIZE-1] = 0;
+ return strlen(p);
+}
+
+/* error */
+int test15(void)
+{
+ char *p = alloca(TAB_SIZE-1);
+ memset(p, 'a', TAB_SIZE);
+ p[TAB_SIZE-1] = 0;
+ return strlen(p);
+}
+
int (*table_test[])(void) = {
test1,
test1,
@@ -184,6 +201,8 @@ int (*table_test[])(void) = {
test11,
test12,
test13,
+ test14,
+ test15,
};
int main(int argc, char **argv)