--- hatari/tests/debugger/test-evaluate.c 2019/04/09 08:49:07 1.1 +++ hatari/tests/debugger/test-evaluate.c 2019/04/09 08:56:15 1.1.1.4 @@ -1,5 +1,6 @@ /* * Code to test Hatari expression evaluation in src/debug/evaluate.c + * (including Hatari variable and CPU register values in expressions) */ #include #include @@ -9,6 +10,7 @@ #include "m68000.h" #include "main.h" #include "screen.h" +#include "configuration.h" #include "video.h" #define VBL_VALUE 21 @@ -43,15 +45,12 @@ int main(int argc, const char *argv[]) memset(Regs, 0, sizeof(Regs)); Regs[REG_D0] = 10; memset(STRam, 0, sizeof(STRam)); - /* expressions use long access */ - STRam[2+5] = 0; - STRam[2+6] = 0; - STRam[2+7] = 0; - STRam[2+8] = 3; + /* expressions use long access, 3*3 -> 9 */ + STMemory_WriteLong(2+5, 3); fprintf(stderr, "\nExpressions that should FAIL:\n"); - for (i = 0; i < ARRAYSIZE(failure); i++) { + for (i = 0; i < ARRAY_SIZE(failure); i++) { expression = failure[i]; fprintf(stderr, "- '%s'\n", expression); errstr = Eval_Expression(expression, &result, &offset, false); @@ -68,7 +67,7 @@ int main(int argc, const char *argv[]) fprintf(stderr, "\nExpressions that should SUCCEED with given result:\n"); - for (i = 0; i < ARRAYSIZE(success); i++) { + for (i = 0; i < ARRAY_SIZE(success); i++) { expression = success[i].expression; fprintf(stderr, "- '%s'\n", expression); errstr = Eval_Expression(expression, &result, &offset, false);