summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael McTernan <Michael.McTernan@wavemobile.com>2015-03-30 13:22:14 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-04-01 20:50:26 +0200
commit4e0543f730b255849305787ecce89867e89f40f8 (patch)
treeff19c575e8718f509af0f856787d4e7bf942c7d3
parentf8699ca51eeb4f3d34336501abcaf071b4a95a47 (diff)
Tests: Fix broken loggingrb testcase.
The loggingrb (ringbuffer) test case was not actually being built or ran, instead still using the normal logging test. This patch fixes the makefile, then the loggingrb testcase is changed to use the current loggingrb API so that it builds and passes. Signed-off-by: Michael McTernan <mike.mcternan@wavemobile.com>
-rw-r--r--tests/Makefile.am2
-rw-r--r--tests/loggingrb/loggingrb_test.c11
2 files changed, 6 insertions, 7 deletions
diff --git a/tests/Makefile.am b/tests/Makefile.am
index 809bf649..8db2533a 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -79,7 +79,7 @@ logging_logging_test_LDADD = $(top_builddir)/src/libosmocore.la
fr_fr_test_SOURCES = fr/fr_test.c
fr_fr_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/gb/libosmogb.la $(LIBRARY_DL)
-loggingrb_loggingrb_test_SOURCES = logging/logging_test.c
+loggingrb_loggingrb_test_SOURCES = loggingrb/loggingrb_test.c
loggingrb_loggingrb_test_LDADD = $(top_builddir)/src/libosmocore.la $(top_builddir)/src/vty/libosmovty.la
strrb_strrb_test_SOURCES = strrb/strrb_test.c
diff --git a/tests/loggingrb/loggingrb_test.c b/tests/loggingrb/loggingrb_test.c
index 9957b536..ebc0181b 100644
--- a/tests/loggingrb/loggingrb_test.c
+++ b/tests/loggingrb/loggingrb_test.c
@@ -21,8 +21,7 @@
#include <osmocom/core/logging.h>
#include <osmocom/core/utils.h>
-#include <osmocom/core/ringb.h>
-#include <osmocom/vty/logging_rbvty.h>
+#include <osmocom/core/loggingrb.h>
enum {
DRLL,
@@ -61,7 +60,7 @@ int main(int argc, char **argv)
struct log_target *ringbuf_target;
log_init(&log_info, NULL);
- ringbuf_target = log_target_create_rbvty(NULL, 0x1000);
+ ringbuf_target = log_target_create_rb(0x1000);
log_add_target(ringbuf_target);
log_set_all_filter(ringbuf_target, 1);
log_set_print_filename(ringbuf_target, 0);
@@ -74,9 +73,9 @@ int main(int argc, char **argv)
DEBUGP(DRLL, "You should see this\n");
DEBUGP(DCC, "You should see this\n");
DEBUGP(DMM, "You should not see this\n");
- fprintf(stderr, ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 0));
- fprintf(stderr, ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 1));
- OSMO_ASSERT(!ringbuffer_get_nth(ringbuf_target->tgt_rbvty.rb, 2));
+ fprintf(stderr, log_target_rb_get(ringbuf_target, 0));
+ fprintf(stderr, log_target_rb_get(ringbuf_target, 1));
+ OSMO_ASSERT(!log_target_rb_get(ringbuf_target, 2));
return 0;
}