mirror of
https://github.com/open5gs/open5gs.git
synced 2026-10-19 01:42:08 +00:00
tests: suppress expected hex conversion error logs
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:
parent
dc68815bb1
commit
2449ff80f3
1 changed files with 6 additions and 0 deletions
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue