aboutsummaryrefslogtreecommitdiffstats
path: root/tests/osmo-pcap-test
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@gnumonks.org>2012-07-19 13:03:39 +0200
committerPablo Neira Ayuso <pablo@gnumonks.org>2012-07-19 13:03:39 +0200
commit937ab515cb7e2374b92b380e2b3d69f548a6024d (patch)
treea3008646443972dc3108cb9691909df56ecae344 /tests/osmo-pcap-test
parent0db9b568f2922794c412f6d703da0c8e06e5e214 (diff)
tests: osmo-pcap: use logging infrastructure
so far, it was missing and printf was used instead of the generic logging infrastructure that osmocom provides.
Diffstat (limited to 'tests/osmo-pcap-test')
-rw-r--r--tests/osmo-pcap-test/osmux_test.c26
1 files changed, 26 insertions, 0 deletions
diff --git a/tests/osmo-pcap-test/osmux_test.c b/tests/osmo-pcap-test/osmux_test.c
index 0e47004..35a986b 100644
--- a/tests/osmo-pcap-test/osmux_test.c
+++ b/tests/osmo-pcap-test/osmux_test.c
@@ -22,6 +22,9 @@
#include <osmocom/core/msgb.h>
#include <osmocom/core/timer.h>
#include <osmocom/core/select.h>
+#include <osmocom/core/logging.h>
+#include <osmocom/core/application.h>
+#include <osmocom/core/talloc.h>
#include <osmocom/netif/osmux.h>
@@ -108,6 +111,25 @@ static void osmo_pcap_pkt_timer_cb(void *data)
}
}
+#define DOSMUXTEST 0
+
+struct log_info_cat osmux_test_cat[] = {
+ [DOSMUXTEST] = {
+ .name = "DOSMUXTEST",
+ .description = "osmux test",
+ .color = "\033[1;35m",
+ .enabled = 1, .loglevel = LOGL_NOTICE,
+ },
+};
+
+const struct log_info osmux_log_info = {
+ .filter_fn = NULL,
+ .cat = osmux_test_cat,
+ .num_cat = ARRAY_SIZE(osmux_test_cat),
+};
+
+static void *tall_test;
+
int main(int argc, char *argv[])
{
int ret;
@@ -119,6 +141,10 @@ int main(int argc, char *argv[])
exit(EXIT_FAILURE);
}
+ tall_test = talloc_named_const(NULL, 1, "osmux_pcap_test");
+ osmo_init_logging(&osmux_log_info);
+ log_set_log_level(osmo_stderr_target, LOGL_DEBUG);
+
osmo_pcap_init();
printf("\e[1;34mStarting test...\e[0m\n");