X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Frmr_nng_test.c;h=bef4a24eeb9b5dbe97abcc6d104c87d81b05737d;hb=2bd8785ce17397e6f8e686be421c5a6c860a0b8c;hp=1a8df89a5bb76f3cb50462a7cf84e0b91eb74a6a;hpb=412d53dfa2f9b5b56a448797d0dfec3b0f11f666;p=ric-plt%2Flib%2Frmr.git diff --git a/test/rmr_nng_test.c b/test/rmr_nng_test.c index 1a8df89..bef4a24 100644 --- a/test/rmr_nng_test.c +++ b/test/rmr_nng_test.c @@ -62,16 +62,18 @@ #include #include +#define NNG_UNDER_TEST 1 #define EMULATE_NNG #include "test_nng_em.c" // nng/nn emulation (before including things under test) #include "rmr.h" // things the users see #include "rmr_symtab.h" +#include "rmr_logging.h" #include "rmr_agnostic.h" // transport agnostic header -#include "rmr_nng_private.h" // transport specific #include "symtab.c" +#include "logging.c" #include "rmr_nng.c" #include "mbuf_api.c" @@ -79,6 +81,8 @@ static void gen_rt( uta_ctx_t* ctx ); // defined in sr_nng_static_test, but use // specific test tools in this directory #include "test_support.c" // things like fail_if() +#include "test_ctx_support.c" // specifically geared to creating dummy contex structs +#include "test_gen_rt.c" // and finally.... #include "tools_static_test.c" // local test functions pulled directly because of static nature of things #include "symtab_static_test.c" @@ -96,42 +100,47 @@ static void gen_rt( uta_ctx_t* ctx ); // defined in sr_nng_static_test, but use int main() { int errors = 0; - fprintf( stderr, " starting tool tests\n" ); + fprintf( stderr, "\n starting tool tests\n" ); errors += tools_test(); fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting ring tests (%d)\n", errors ); + fprintf( stderr, "\n starting ring tests (%d)\n", errors ); errors += ring_test(); fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting symtab tests\n" ); + fprintf( stderr, "\n starting symtab tests\n" ); errors += symtab_test( ); fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting rtable tests\n" ); + fprintf( stderr, "\n starting rtable tests\n" ); errors += rt_test(); // route table tests fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting RMr API tests\n" ); + fprintf( stderr, "\n starting RMr API tests\n" ); + errors += rmr_api_test(); + + fprintf( stderr, "\n run RMr API tests with src name only env var set\n" ); + setenv( "RMR_SRC_NAMEONLY", "1", 1 ); errors += rmr_api_test(); fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting wormhole tests\n" ); + fprintf( stderr, "\n starting wormhole tests\n" ); errors += worm_test(); // test wormhole funcitons fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting send/receive tests\n" ); + fprintf( stderr, "\n starting send/receive tests\n" ); errors += sr_nng_test(); // test the send/receive static functions fprintf( stderr, " error count: %d\n", errors ); - fprintf( stderr, " starting mbuf api tests\n" ); + fprintf( stderr, "\n starting mbuf api tests\n" ); errors += mbuf_api_test( ); fprintf( stderr, " error count: %d\n", errors ); + test_summary( errors, "tool tests" ); if( errors == 0 ) { - fprintf( stderr, " all tests were OK\n" ); + fprintf( stderr, " all tests were OK\n\n" ); } else { - fprintf( stderr, " %d modules reported errors\n", errors ); + fprintf( stderr, " %d modules reported errors\n\n", errors ); } return !!errors;