Change in libosmocore[master]: tests: Set print_category values explicitly

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Thu Feb 18 18:36:18 UTC 2021


pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/22961 )


Change subject: tests: Set print_category values explicitly
......................................................................

tests: Set print_category values explicitly

This will alow easily changing default values for print_category vs
print_category_hex later.

In any case, every test relying on logging output validation should
always explicitly state the config to avoid issues in the future if
default values change.

Related: OS#5034
Change-Id: If29b40557d5c2bcda04b964f344070bad58d8f28
---
M tests/fsm/fsm_test.c
M tests/gb/bssgp_fc_test.c
M tests/gb/gprs_ns2_test.c
M tests/gb/gprs_ns_test.c
M tests/logging/logging_test.c
M tests/loggingrb/loggingrb_test.c
M tests/socket/socket_sctp_test.c
M tests/socket/socket_test.c
M tests/write_queue/wqueue_test.c
9 files changed, 17 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/61/22961/1

diff --git a/tests/fsm/fsm_test.c b/tests/fsm/fsm_test.c
index fe48b2b..23e24cf 100644
--- a/tests/fsm/fsm_test.c
+++ b/tests/fsm/fsm_test.c
@@ -414,6 +414,8 @@
 	log_add_target(stderr_target);
 	log_set_print_filename(stderr_target, 0);
 	log_set_use_color(stderr_target, 0);
+	log_set_print_category(stderr_target, 0);
+	log_set_print_category_hex(stderr_target, 0);
 	g_ctrl = ctrl_handle_alloc(NULL, NULL, NULL);
 
 	g_ctx = NULL;
diff --git a/tests/gb/bssgp_fc_test.c b/tests/gb/bssgp_fc_test.c
index cc38777..23bcd57 100644
--- a/tests/gb/bssgp_fc_test.c
+++ b/tests/gb/bssgp_fc_test.c
@@ -149,6 +149,8 @@
 	osmo_init_logging2(ctx, &info);
 	log_set_use_color(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
+	log_set_print_category(osmo_stderr_target, 0);
+	log_set_print_category_hex(osmo_stderr_target, 0);
 
 	tall_msgb_ctx = msgb_talloc_ctx_init(ctx, 0);
 
diff --git a/tests/gb/gprs_ns2_test.c b/tests/gb/gprs_ns2_test.c
index 6d71a8c..dfd28be 100644
--- a/tests/gb/gprs_ns2_test.c
+++ b/tests/gb/gprs_ns2_test.c
@@ -431,6 +431,8 @@
 	log_set_use_color(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
+	log_set_print_category(osmo_stderr_target, 0);
+	log_set_print_category_hex(osmo_stderr_target, 0);
 	log_set_log_level(osmo_stderr_target, LOGL_INFO);
 	unitdata = talloc_zero(ctx, struct osmo_wqueue);
 	osmo_wqueue_init(unitdata, 100);
diff --git a/tests/gb/gprs_ns_test.c b/tests/gb/gprs_ns_test.c
index f70e493..e8e8b80 100644
--- a/tests/gb/gprs_ns_test.c
+++ b/tests/gb/gprs_ns_test.c
@@ -904,6 +904,8 @@
 	void *ctx = talloc_named_const(NULL, 0, "gprs_ns_test");
 	osmo_init_logging2(ctx, &info);
 	log_set_use_color(osmo_stderr_target, 0);
+	log_set_print_category(osmo_stderr_target, 0);
+	log_set_print_category_hex(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
 	osmo_signal_register_handler(SS_L_NS, &test_signal, NULL);
 
diff --git a/tests/logging/logging_test.c b/tests/logging/logging_test.c
index b9cb57f..d036dc5 100644
--- a/tests/logging/logging_test.c
+++ b/tests/logging/logging_test.c
@@ -78,6 +78,7 @@
 	log_add_target(stderr_target);
 	log_set_all_filter(stderr_target, 1);
 	log_set_print_filename(stderr_target, 0);
+	log_set_print_category_hex(stderr_target, 0);
 	log_set_print_category(stderr_target, 1);
 	log_set_use_color(stderr_target, 0);
 
diff --git a/tests/loggingrb/loggingrb_test.c b/tests/loggingrb/loggingrb_test.c
index 0b2ae5b..4a4d1f9 100644
--- a/tests/loggingrb/loggingrb_test.c
+++ b/tests/loggingrb/loggingrb_test.c
@@ -65,6 +65,8 @@
 	log_add_target(ringbuf_target);
 	log_set_all_filter(ringbuf_target, 1);
 	log_set_print_filename(ringbuf_target, 0);
+	log_set_print_category(ringbuf_target, 0);
+	log_set_print_category_hex(ringbuf_target, 0);
 
 	log_parse_category_mask(ringbuf_target, "DRLL:DCC");
 	log_parse_category_mask(ringbuf_target, "DRLL");
diff --git a/tests/socket/socket_sctp_test.c b/tests/socket/socket_sctp_test.c
index e70b8be..9705038 100644
--- a/tests/socket/socket_sctp_test.c
+++ b/tests/socket/socket_sctp_test.c
@@ -223,6 +223,8 @@
 	osmo_init_logging2(ctx, &info);
 	log_set_use_color(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
+	log_set_print_category(osmo_stderr_target, 0);
+	log_set_print_category_hex(osmo_stderr_target, 0);
 #ifdef HAVE_LIBSCTP
 	test_sockinit2_multiaddr_simple();
 	test_sockinit2_multiaddr_several();
diff --git a/tests/socket/socket_test.c b/tests/socket/socket_test.c
index 0bf2127..9619553 100644
--- a/tests/socket/socket_test.c
+++ b/tests/socket/socket_test.c
@@ -401,6 +401,8 @@
 	osmo_init_logging2(ctx, &info);
 	log_set_use_color(osmo_stderr_target, 0);
 	log_set_print_filename(osmo_stderr_target, 0);
+	log_set_print_category(osmo_stderr_target, 0);
+	log_set_print_category_hex(osmo_stderr_target, 0);
 
 	test_sockinit();
 	test_sockinit2();
diff --git a/tests/write_queue/wqueue_test.c b/tests/write_queue/wqueue_test.c
index 827e4e8..9c7a36e 100644
--- a/tests/write_queue/wqueue_test.c
+++ b/tests/write_queue/wqueue_test.c
@@ -73,6 +73,8 @@
 	stderr_target = log_target_create_stderr();
 	log_add_target(stderr_target);
 	log_set_print_filename(stderr_target, 0);
+	log_set_print_category_hex(stderr_target, 0);
+	log_set_print_category(stderr_target, 0);
 
 	test_wqueue_limit();
 

-- 
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/22961
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: If29b40557d5c2bcda04b964f344070bad58d8f28
Gerrit-Change-Number: 22961
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20210218/13dc8170/attachment.htm>


More information about the gerrit-log mailing list