tests: suppress expected hex conversion error logs
Some checks are pending
CIFuzz / Fuzzing (push) Waiting to run
Meson Continuous Integration / Build and Test on MacOS Latest (push) Waiting to run
Meson Continuous Integration / Build and Test on Ubuntu Latest (push) Waiting to run

Set the core log level to OGS_LOG_FATAL during invalid-input checks
in conv_test1(), then restore the previous level. This suppresses
expected errors while preserving fatal diagnostics.
This commit is contained in:
Sukchan Lee 2026-10-18 13:58:31 +09:00
parent dc68815bb1
commit 2449ff80f3

View file

@ -22,6 +22,7 @@
static void conv_test1(abts_case *tc, void *data)
{
ogs_log_level_e saved_log_level;
uint8_t expected[4] = { 0x01, 0xab, 0xCD, 0xef };
uint8_t output[4] = { 0xff, 0xff, 0xff, 0xff };
char non_ascii[8] = {
@ -32,6 +33,9 @@ static void conv_test1(abts_case *tc, void *data)
"01abCDef", output, sizeof(output)));
ABTS_TRUE(tc, memcmp(expected, output, sizeof(output)) == 0);
saved_log_level = ogs_log_get_domain_level(OGS_LOG_DOMAIN);
ogs_log_set_domain_level(OGS_LOG_DOMAIN, OGS_LOG_FATAL);
ABTS_INT_EQUAL(tc, OGS_ERROR,
ogs_ascii_to_hex_checked("01abCD", 6, output, sizeof(output)));
ABTS_INT_EQUAL(tc, OGS_ERROR,
@ -51,6 +55,8 @@ static void conv_test1(abts_case *tc, void *data)
ABTS_INT_EQUAL(tc, OGS_ERROR,
ogs_ascii_to_hex_checked("01abCDef", 8, NULL, sizeof(output)));
ogs_log_set_domain_level(OGS_LOG_DOMAIN, saved_log_level);
ABTS_TRUE(tc, memcmp(expected, output, sizeof(output)) == 0);
}