Skip to content

Commit

Permalink
Try to catch a transient test config failure (#336)
Browse files Browse the repository at this point in the history
This PR adds some debug code to a test to try to catch a very transient
failure when running tests on the github agents.
  • Loading branch information
danielealbano committed Apr 13, 2023
1 parent 5b6a488 commit 65330ab
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/unit_tests/test-config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1923,6 +1923,16 @@ TEST_CASE("config.c", "[config]") {
SECTION("CYAML_LOG_DEBUG") {
char* str_cmp = "[DEBUG ][config] test log message: test argument\n";
test_config_internal_cyaml_log_wrapper(CYAML_LOG_DEBUG, nullptr, "test log message: %s", "test argument");
if (strcmp(str_cmp, test_config_internal_log_sink_printer_data + 22) != 0) {
fprintf(
stderr,
"'%s' (%lu) != '%s' (%lu)\n",
str_cmp,
strlen(str_cmp),
test_config_internal_log_sink_printer_data + 22,
strlen(test_config_internal_log_sink_printer_data + 22));
fflush(stderr);
}
REQUIRE(strcmp(str_cmp, test_config_internal_log_sink_printer_data + 22) == 0);
}

Expand Down

0 comments on commit 65330ab

Please sign in to comment.