generate Add mbuf api funcion to reference to trace dat1
[ric-plt/lib/rmr.git] / test / sr_nng_static_test.c
index c58b281..294207c 100644 (file)
 #include <errno.h>
 #include <string.h>
 #include <stdint.h>
+#include <pthread.h>
+#include <semaphore.h>
 
-#include "../src/common/include/rmr.h"
-#include "../src/common/include/rmr_agnostic.h"
+#include "rmr.h"
+#include "rmr_agnostic.h"
 
 /*
        Generate a simple route table (for all but direct route table testing).
@@ -128,6 +130,7 @@ static int sr_nng_test() {
        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_ip = strdup( "30.4.19.86:1111" );
        uta_lookup_rtg( ctx );
 
        gen_rt( ctx );                                                          // forces a static load with some known info since we don't start the rtc()
@@ -162,7 +165,7 @@ static int sr_nng_test() {
                mbuf = rmr_rcv_msg( ctx, NULL );
        }
 
-       size = 2048 - sizeof( uta_mhdr_t );             // emulated nng receive allocates 2K payloads
+       size = 2048 - em_hdr_size();            // emulated nng receive allocates 2K buffers -- subtract off header size
        state = rmr_payload_size( mbuf );
        errors += fail_not_equal( state, size, "payload size didn't return expected value" );   // receive should always give 4k buffer