diff --git a/nemu/tests/expr_test.c b/nemu/tests/expr_test.c index 3cb30d5..0257e7c 100644 --- a/nemu/tests/expr_test.c +++ b/nemu/tests/expr_test.c @@ -29,11 +29,11 @@ void gen(char c) { } void gen_num(void) { - uint32_t num = rand(); + int32_t num = rand(); int len = 0, ref_len = 0; switch(rand() % 2) { case 0: - len = snprintf(buf_ptr, 100, "%u", num); + len = snprintf(buf_ptr, 100, "%d", num); ref_len = snprintf(ref_buf_ptr, 100, "%uU", num); break; case 1: