Beef up unit tests for SI95 code
[ric-plt/lib/rmr.git] / test / hdr_static_test.c
index 1e50390..3a555ce 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.
@@ -34,6 +34,8 @@
 #include <string.h>
 #include <stdint.h>
 #include <netdb.h>
+#include <pthread.h>
+#include <semaphore.h>
 
 #include <nng/nng.h>
 #include <nng/protocol/pubsub0/pub.h>
 #include <nng/protocol/pipeline0/push.h>
 #include <nng/protocol/pipeline0/pull.h>
 
-#include "../src/common/include/rmr.h"
-#include "../src/common/include/rmr_agnostic.h"
-#include "../src/nng/include/rmr_nng_private.h"
+#include "rmr.h"
+#include "rmr_agnostic.h"
 
 #define EMULATE_NNG
-#include "test_nng_em.c"
-#include "../src/nng/src/sr_nng_static.c"
+#define NNG_UNDER_TEST
+#include "sr_nng_static.c"
 
 #include "test_support.c"
 
@@ -104,9 +105,13 @@ static int hdr_test( ) {
        if( ! errors ) {
                fprintf( stderr, "<INFO> all msg header tests pass\n" );
        }
-       return !! errors;
+       return errors;
 }
 
 int main() {
-       return hdr_test();
+       int errors = 0;
+
+       errors +=  hdr_test();
+
+       return !! errors;
 }