Skip to content

Commit 47aca59

Browse files
authored
[CN-Test-Gen] Fix issue with printing errors (#908)
Introduced by ba4a383
1 parent ee59264 commit 47aca59

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

runtime/libcn/include/cn-testing/test.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ size_t cn_gen_compute_size(enum cn_gen_sizing_strategy strategy,
111111
if (!replay) { \
112112
cn_gen_set_input_timer(cn_gen_get_milliseconds()); \
113113
} else { \
114-
cn_gen_set_input_timer(0); \
114+
cn_gen_set_input_timeout(0); \
115115
} \
116116
struct cn_gen_##Name##_record* res = cn_gen_##Name(); \
117117
if (cn_gen_backtrack_type() != CN_GEN_BACKTRACK_NONE) { \

runtime/libcn/src/cn-testing/test.c

+6-1
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,12 @@ int cn_test_main(int argc, char* argv[]) {
344344
cn_printf(CN_LOGGING_ERROR, "\n");
345345

346346
cn_test_reproduce(&repros[i]);
347-
test_case->func(true, CN_TEST_GEN_PROGRESS_NONE, sizing_strategy, trap);
347+
enum cn_test_result replay_result =
348+
test_case->func(true, CN_TEST_GEN_PROGRESS_NONE, sizing_strategy, trap);
349+
if (replay_result != CN_TEST_FAIL) {
350+
fprintf(stderr, "Replay of failure did not fail.\n");
351+
abort();
352+
}
348353

349354
set_cn_logging_level(CN_LOGGING_NONE);
350355

0 commit comments

Comments
 (0)