X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=blobdiff_plain;ds=sidebyside;f=test%2Frmr_si_rcv_test.c;fp=test%2Frmr_si_rcv_test.c;h=fdd1f33739e2449e7cc02909e814f524711ab65a;hb=e15b1382dc618f6832957e67dc638b5e8f3f414d;hp=0000000000000000000000000000000000000000;hpb=2d9d6784b306047e94ca9816813e5007b00fd17e;p=ric-plt%2Flib%2Frmr.git diff --git a/test/rmr_si_rcv_test.c b/test/rmr_si_rcv_test.c new file mode 100644 index 0000000..fdd1f33 --- /dev/null +++ b/test/rmr_si_rcv_test.c @@ -0,0 +1,101 @@ +// :vi sw=4 ts=4 noet: +/* +================================================================================== + Copyright (c) 2020 Nokia + Copyright (c) 2020 AT&T Intellectual Property. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +================================================================================== +*/ + +/* + Mmemonic: rmr_si_rcv_test.c + Abstract: This drives only the receive tests for the SI API. Because + of the threaded nature of SI receives it is not possible to + mix these tests with the other coverage tests which allocate + various contexes. + + Author: E. Scott Daniels + Date: 14 April 2020 (AKD) +*/ + +#include +#include +#include +#include +#include +#include +#include +#include + + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#define DEBUG 1 +#define PARANOID_CHECKS 1 // must have parinoid testing on to not fail on nil pointer tests + + // specific test tools in this directory +#undef NNG_UNDER_TEST +#include "test_support.c" // things like fail_if() +#include "test_ctx_support.c" // dummy context support +#include "test_msg_support.c" +#include "test_gen_rt.c" + + +#include "rmr.h" // things the users see +#include "rmr_symtab.h" +#include "rmr_logging.h" +#include "rmr_agnostic.h" // transport agnostic header + +#include "symtab.c" +#include "logging.c" +#include "rmr_si.c" +#include "mbuf_api.c" + + +static void gen_rt( uta_ctx_t* ctx ); // defined in sr_si_static_test, but used by a few others (eliminate order requirement below) + + // and finally.... +#include "rmr_si_rcv_static_test.c" // the only test driver + + +/* + Drive each of the separate tests and report. +*/ +int main() { + int errors = 0; + + rmr_set_vlevel( 5 ); // enable all debugging + + fprintf( stderr, "\n starting receive tests (%d)\n", errors ); + errors += rmr_rcv_test(); + fprintf( stderr, " error count: %d\n", errors ); + + if( errors == 0 ) { + fprintf( stderr, " all tests were OK\n\n" ); + } else { + fprintf( stderr, " %d modules reported errors\n\n", errors ); + } + + return !!errors; +}