> compile NEMU

221220000 张三
Linux zzy 5.15.146.1-microsoft-standard-WSL2 #1 SMP Thu Jan 11 04:09:03 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux
 19:29:19 up 18:19,  1 user,  load average: 0.52, 0.27, 0.15
This commit is contained in:
tracer-ics2023
2024-08-31 19:29:20 +08:00
committed by zzy
parent abb55daef0
commit ba52c56121

View File

@ -223,9 +223,15 @@ void init_sdb() {
void _test_expr() {
uint32_t expect, res;
char buf[65536] = {0};
if (scanf("%"PRIu32" %s", &expect, buf));
if (!fgets(buf, 65536, stdin)) {
return;
}
char* pos = strtok(buf, " ");
expect = atoi(pos);
pos += strlen(pos) + 1;
bool success = false;
res = expr(buf, &success);
res = expr(pos, &success);
if (res == expect) {
fprintf(stdout, "test_expr True :");
} else {