CI: Add silent cmake SonarCloud scan
[ric-plt/lib/rmr.git] / test / sr_nano_static_test.c
index efeba23..cb2b9ff 100644 (file)
@@ -1,8 +1,8 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-           Copyright (c) 2019 Nokia
-           Copyright (c) 2018-2019 AT&T Intellectual Property.
+           Copyright (c) 2019-2021 Nokia
+           Copyright (c) 2018-2021 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.
@@ -43,7 +43,7 @@
 /*
        Generate a simple route table (for all but direct route table testing).
        This table contains multiple tables inasmuch as a second update set of
-       records follows the initial set. 
+       records follows the initial set.
 */
 static void gen_rt( uta_ctx_t* ctx ) {
        int             fd;
@@ -60,8 +60,8 @@ static void gen_rt( uta_ctx_t* ctx ) {
                "newrt|start\n"                                                         // false start to drive detection
                "xxx|badentry to drive default case"
                "newrt|start\n"
-           "rte|0|localhost:4560,localhost:4562\n"                                     // these are legitimate entries for our testing
-           "rte|1|localhost:4562;localhost:4561,localhost:4569\n"
+           "rte|0|localhost:4560,localhost:4562,dummy-test:1111\n"                                     // these are legitimate entries for our testing
+           "rte|1|localhost:4562;localhost:4561,localhost:4569,10.7.9.86:4560\n"
            "rte|2|localhost:4562| 10\n"                                                                // new subid at end
            "mse|4|10|localhost:4561\n"                                                                 // new msg/subid specifier rec
            "mse|4|localhost:4561\n"                                                                    // new mse entry with less than needed fields
@@ -183,7 +183,7 @@ static int sr_nano_test() {
        ctx->mring = NULL;              //uta_mk_ring( 128 );
        ctx->max_plen = RMR_MAX_RCV_BYTES + sizeof( uta_mhdr_t );
        ctx->max_mlen = ctx->max_plen + sizeof( uta_mhdr_t );
-       ctx->my_name = strdup( "dummy-test" );
+       ctx->my_name = strdup( "dummy-test:1111" );
        ctx->my_ip = strdup( "30.4.19.86:1111" );
        uta_lookup_rtg( ctx );
 
@@ -198,7 +198,7 @@ static int sr_nano_test() {
        ctx->rtable = NULL;
        gen_mlnl_rt( ctx );                                             // ensure that a file with missing last new line does not trip us up
        errors += fail_if_nil( ctx->rtable, "read  route table file with missing last newline did not produce a table" );
-       
+
        ctx->rtable = NULL;
        gen_rt( ctx );                                                          // forces a static load with some known info since we don't start the rtc()
        errors += fail_if_nil( ctx->rtable, "read  multi test route table file did not produce a table" );
@@ -268,8 +268,7 @@ static int sr_nano_test() {
        rtc( NULL );                            // coverage test with nil pointer
        rtc( ctx );
 
+       unlink( ".ut_rmr_verbose" );
 
-       // --- drive the route table things which are nanomsg specific ------
-
-       return !!errors;
+       return errors;
 }