diff options
author | Andrés <andmarti@gmail.com> | 2021-06-10 23:27:28 -0300 |
---|---|---|
committer | Andrés <andmarti@gmail.com> | 2021-06-10 23:27:28 -0300 |
commit | 09592fd121d86e098130638c86c253ec9beca484 (patch) | |
tree | 335ed283ab9c90605e305a66a1928af9ecc8a416 /tests | |
parent | f228076b745bc15cc65179d1df29f60888985483 (diff) |
work on issue #569. still WIP
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test8.sc | 74 | ||||
-rwxr-xr-x | tests/test8.sh | 28 |
2 files changed, 102 insertions, 0 deletions
diff --git a/tests/test8.sc b/tests/test8.sc new file mode 100644 index 0000000..1dfed9d --- /dev/null +++ b/tests/test8.sc @@ -0,0 +1,74 @@ +# This data file was generated by the Spreadsheet Calculator Improvised (sc-im) +# You almost certainly shouldn't edit it. + +set external_functions +newsheet "Sheet1" +movetosheet "Sheet1" +let A0 = 1 +let B0 = 2 +let C0 = 3 +let D0 = 4 +let E0 = 5 +let F0 = 6 +let G0 = 7 +let H0 = 8 +let I0 = 9 +let J0 = 10 +let K0 = 11 +let L0 = 12 +let M0 = 13 +let N0 = 14 +let O0 = 15 +let P0 = 16 +let Q0 = 17 +let R0 = 18 +let S0 = 29 +let T0 = 30 +let U0 = 31 +let V0 = 32 +let W0 = 33 +let A1 = 2 +let A2 = 3 +let A3 = 4 +let A4 = 5 +let A5 = 6 +let A6 = 7 +let A7 = 8 +let A8 = 9 +let A9 = 10 +let A10 = 11 +let A11 = 12 +let A12 = 13 +let A13 = 14 +let A14 = 15 +let A15 = 16 +let A16 = 17 +let A17 = 18 +let A18 = 19 +let A19 = 20 +let A20 = 21 +let A21 = 22 +let A22 = 23 +let A23 = 24 +let A24 = 25 +let A25 = 26 +let A26 = 27 +let A27 = 28 +let A28 = 29 +let A29 = 30 +let A30 = 31 +let A31 = 32 +let A32 = 33 +let A33 = 34 +let A34 = 35 +let A35 = 36 +let A36 = 37 +let A37 = 38 +let A38 = 39 +let A39 = 40 +let A40 = 41 +let A41 = 42 +let A42 = 43 +let A43 = 44 +let A44 = 45 +goto A1 diff --git a/tests/test8.sh b/tests/test8.sh new file mode 100755 index 0000000..690aa01 --- /dev/null +++ b/tests/test8.sh @@ -0,0 +1,28 @@ +#!/bin/bash +## SEE https://github.com/lehmannro/assert.sh for usage + +#Exit immediately if a command exits with a non-zero status. +set -e + +NAME=test8 + +VALGRIND_CMD='valgrind -v --log-file=${NAME}_vallog --tool=memcheck --track-origins=yes --leak-check=full --show-leak-kinds=all --show-reachable=no' +. assert.sh + +CMD='DELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nDELETECOL B\nGETNUM B0\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nDELETEROW 2\nUNDO\nUNDO\nGETNUM A2' +assert "echo -e '${CMD}' | $VALGRIND_CMD ../src/sc-im ${NAME}.sc --nocurses --nodebug --quit_afterload 2>&1 |grep -v '^$\|Interp\|Change'" "14\n13" + +#we check valgrind log +assert_iffound_notcond ${NAME}_vallog "definitely lost.*bytes" "0 bytes" +assert_iffound_notcond ${NAME}_vallog "indirectly lost.*bytes" "0 bytes" +assert_iffound_notcond ${NAME}_vallog "possibly lost.*bytes" "0 bytes" +assert_iffound_notcond ${NAME}_vallog "Uninitialised value was created by a heap allocation" +assert_iffound_notcond ${NAME}_vallog "Conditional jump or move depends on uninitialised value" +assert_iffound_notcond ${NAME}_vallog "Invalid read of size" +assert_iffound_notcond ${NAME}_vallog "Invalid write of size" +assert_iffound_notcond ${NAME}_vallog "Invalid free() / delete" +if [ "$1" != "keep-vallog" ];then + rm ${NAME}_vallog +fi + +assert_end ${NAME} |