X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Frt_static_test.c;h=dbe8d7807739b031eedb9795cc7162a486071666;hb=96f308a4f446cf74ea2dd7471f101f625b5ea609;hp=d87a743496ead0a507995a7613443e1464383d7f;hpb=fc5c77b3d78988aa407118235d7f5978642df753;p=ric-plt%2Flib%2Frmr.git diff --git a/test/rt_static_test.c b/test/rt_static_test.c index d87a743..dbe8d78 100644 --- a/test/rt_static_test.c +++ b/test/rt_static_test.c @@ -98,6 +98,7 @@ fprintf( stderr, " build key: %x %x --> %llx\n", (int) mtype, (int) sid, ( */ static int rt_test( ) { uta_ctx_t* ctx; // context needed to test load static rt + uta_ctx_t* pctx; // "private" context for route manager communication tests route_table_t* rt; // route table route_table_t* crt; // cloned route table rtable_ent_t* rte; // route table entries from table @@ -521,6 +522,36 @@ static int rt_test( ) { errors += fail_not_equal( state, 0, "epsock_meid returned true when given nil socket pointer" ); #endif + // ------------ debugging and such; coverage only calls ---------------------------------------------------------- + ep_stats( ctx->rtable, NULL, "name", NULL, NULL ); // ensure no crash when given nil pointer + rt_epcounts( ctx->rtable, "testing" ); + rt_epcounts( NULL, "testing" ); + + buf = ensure_nlterm( strdup( "Stand up and cheer!" ) ); // force addition of newline + if( buf ) { + errors += fail_not_equal( strcmp( buf, "Stand up and cheer!\n" ), 0, "ensure nlterm didn't add newline" ); + free( buf ); + buf = NULL; + } + + + // ------------- route manager request/response funcitons ------------------------------------------------------- + { + rmr_mbuf_t* smsg; + + smsg = rmr_alloc_msg( ctx, 1024 ); + send_rt_ack( ctx, smsg, "123456", 0, "no reason" ); + + pctx = mk_dummy_ctx(); + ctx->rtg_whid = -1; + state = send_update_req( pctx, ctx ); + errors += fail_not_equal( state, 0, "send_update_req did not return 0" ); + + ctx->rtg_whid = rmr_wh_open( ctx, "localhost:19289" ); + state = send_update_req( pctx, ctx ); + errors += fail_if_equal( state, 0, "send_update_req to an open whid did not return 0" ); + } + // ------------- si only; fd to ep conversion functions --------------------------------------------------------- #ifndef NNG_UNDER_TEST