test(unit): Add nanomsg unit tests
[ric-plt/lib/rmr.git] / test / rt_static_test.c
index 129eec1..ce0eb25 100644 (file)
@@ -1,7 +1,7 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-           Copyright (c) 2019 Nokia 
+           Copyright (c) 2019 Nokia
            Copyright (c) 2018-2019 AT&T Intellectual Property.
 
    Licensed under the Apache License, Version 2.0 (the "License");
@@ -21,7 +21,7 @@
 /*
        Mmemonic:       rt_static_test.c
        Abstract:       Test the route table funcitons. These are meant to be included at compile
-                               time by the test driver.  
+                               time by the test driver.
 
        Author:         E. Scott Daniels
        Date:           3 April 2019
@@ -228,5 +228,15 @@ static int rt_test( ) {
        }
 */
 
+       state = uta_link2( "worm", NULL, NULL );
+       errors += fail_if_true( state, "link2 did not return false when given nil pointers" );
+
+       state = uta_epsock_rr( rt, 122, 0, NULL, NULL );
+       errors += fail_if_true( state, "uta_epsock_rr returned bad state when given nil socket pointer" );
+
+       rt = uta_rt_init( );                                                                            // get us a route table
+       state = uta_epsock_rr( rt, 0, -1, NULL, &nn_sock );
+       errors += fail_if_true( state, "uta_epsock_rr returned bad state (true) when given negative group number" );
+
        return !!errors;                        // 1 or 0 regardless of count
 }