> compile NEMU

ysyx_22040000 李心杨
Linux calcite 6.1.69 #1-NixOS SMP PREEMPT_DYNAMIC Wed Dec 20 16:00:29 UTC 2023 x86_64 GNU/Linux
 09:45:22  up 1 day 10:01,  2 users,  load average: 0.56, 0.45, 0.40
This commit is contained in:
tracer-ysyx 2024-01-13 09:45:22 +08:00 committed by xinyangli
parent b2bb61bd4b
commit 2a3b7e9b2e

View file

@ -79,6 +79,10 @@ START_TEST(test_expr_random_100) {
fclose(fp);
int ret = system("gcc /tmp/.code.c -Werror=div-by-zero -o /tmp/.expr");
if(ret == -1) {
// Probably devide by zero. Skip
goto clean_up;
}
ck_assert_msg(!ret, "system ret: %d, error: %s", ret, strerror(ret));
fp = popen("/tmp/.expr", "r");
@ -97,6 +101,7 @@ START_TEST(test_expr_random_100) {
ck_assert_msg(addr == reference, "\n\tbuf = %s\n\taddr = %u, reference = %u\n", buf, addr, reference);
clean_up:
while(buf_ptr != buf + buf_start_pos) {
*(--buf_ptr) = '\0';
}