diff --git a/tests/array_oob_high_read.qbl b/tests/array_oob_high_read.qbl new file mode 100644 index 0000000..63f0713 --- /dev/null +++ b/tests/array_oob_high_read.qbl @@ -0,0 +1,5 @@ +//invalid,Attempted an out of bounds read for array test (5 >= 4) at 5:12:END: + +arr test { bool 4 } + +5 test.read deq \ No newline at end of file diff --git a/tests/array_oob_high_write.qbl b/tests/array_oob_high_write.qbl new file mode 100644 index 0000000..9cfda34 --- /dev/null +++ b/tests/array_oob_high_write.qbl @@ -0,0 +1,5 @@ +//invalid,Attempted an out of bounds write for array test (5 >= 4) at 5:19:END: + +arr test { bool 4 } + +5 false test.write \ No newline at end of file diff --git a/tests/array_oob_low_read.qbl b/tests/array_oob_low_read.qbl new file mode 100644 index 0000000..a810cca --- /dev/null +++ b/tests/array_oob_low_read.qbl @@ -0,0 +1,5 @@ +//invalid,Attempted an out of bounds read for array test (-1 < 0) at 5:13:END: + +arr test { bool 4 } + +-1 test.read deq \ No newline at end of file diff --git a/tests/array_oob_low_write.qbl b/tests/array_oob_low_write.qbl new file mode 100644 index 0000000..df6a89f --- /dev/null +++ b/tests/array_oob_low_write.qbl @@ -0,0 +1,5 @@ +//invalid,Attempted an out of bounds write for array test (-1 < 0) at 5:19:END: + +arr test { bool 4 } + +-1 true test.write \ No newline at end of file diff --git a/tests/array_tests.qbl b/tests/array_tests.qbl new file mode 100644 index 0000000..a75cb25 --- /dev/null +++ b/tests/array_tests.qbl @@ -0,0 +1,25 @@ +//valid,0000 +//0100 +//2100 +//2103 +//:END: +arr test { int 4 } + +function => dump +{ + true 0 + while + { + dup test.read req print + 1 + test.length dup < req + } + deq "" println +} + +dump +1 1 test.write +dump +0 2 test.write +dump +3 3 test.write +dump