X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;f=test%2Ftools_test.c;h=70cce441befc02902d30bf8b229566cab75e3280;hb=77526eb4f4ef7b2be5fda0c8d719d3c46c75c5c7;hp=4bcd597d659c919e7fee2d765b95c924439fefe3;hpb=68d09fa5028e47e763c44c30647da31e77eda64a;p=ric-plt%2Flib%2Frmr.git diff --git a/test/tools_test.c b/test/tools_test.c index 4bcd597..70cce44 100644 --- a/test/tools_test.c +++ b/test/tools_test.c @@ -20,7 +20,7 @@ /* - Mnemonic: tools_testh.c + Mnemonic: tools_test.c Abstract: Unit tests for the RMr tools module. Author: E. Scott Daniels Date: 21 January 2019 @@ -39,41 +39,30 @@ #include #include "rmr.h" +#include "rmr_logging.h" #include "rmr_agnostic.h" -#include "test_support.c" // our private library of test tools - -// ===== dummy context for tools testing so we don't have to pull in all of the nano/nng specific stuff ===== -struct uta_ctx { - char* my_name; // dns name of this host to set in sender field of a message - int shutdown; // thread notification if we need to tell them to stop - int max_mlen; // max message length payload+header - int max_plen; // max payload length - int flags; // CTXFL_ constants - int nrtele; // number of elements in the routing table - int send_retries; // number of retries send_msg() should attempt if eagain/timeout indicated by nng - //nng_socket nn_sock; // our general listen socket - route_table_t* rtable; // the active route table - route_table_t* old_rtable; // the previously used rt, sits here to allow for draining - route_table_t* new_rtable; // route table under construction - if_addrs_t* ip_list; // list manager of the IP addresses that are on our known interfaces - void* mring; // ring where msgs are queued while waiting for a call response msg - - char* rtg_addr; // addr/port of the route table generation publisher - int rtg_port; // the port that the rtg listens on - - wh_mgt_t* wormholes; // management of user opened wormholes - //epoll_stuff_t* eps; // epoll information needed for the rcv with timeout call - - //pthread_t rtc_th; // thread info for the rtc listener -}; +#define NO_EMULATION +#include "test_support.c" // our private library of test tools +#include "logging.c" // tools references logging, so pull in too #include "tools_static.c" #include "tools_static_test.c" int main( ) { + int errors = 0; + fprintf( stderr, ">>>> starting tools_test\n" ); - return tools_test() > 0; + errors += tools_test() > 0; + + test_summary( errors, "tool tests" ); + if( errors == 0 ) { + fprintf( stderr, " all tool tests were OK\n\n" ); + } else { + fprintf( stderr, " %d errors in tool code\n\n", errors ); + } + + return !!errors; }