Add array tests
This commit is contained in:
parent
bf4a08e484
commit
8397d32756
5
tests/array_oob_high_read.qbl
Normal file
5
tests/array_oob_high_read.qbl
Normal file
@ -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
|
5
tests/array_oob_high_write.qbl
Normal file
5
tests/array_oob_high_write.qbl
Normal file
@ -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
|
5
tests/array_oob_low_read.qbl
Normal file
5
tests/array_oob_low_read.qbl
Normal file
@ -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
|
5
tests/array_oob_low_write.qbl
Normal file
5
tests/array_oob_low_write.qbl
Normal file
@ -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
|
25
tests/array_tests.qbl
Normal file
25
tests/array_tests.qbl
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user