feat(routing): Support session based routing
[ric-plt/lib/rmr.git] / test / rt_static_test.c
index f1e6981..710c75e 100644 (file)
@@ -1,14 +1,14 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-        Copyright (c) 2019 Nokia 
-        Copyright (c) 2018-2019 AT&T Intellectual Property.
+           Copyright (c) 2019 Nokia 
+           Copyright (c) 2018-2019 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
+          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,
@@ -75,8 +75,9 @@ static int rt_test( ) {
        nng_socket nn_sock;             // this is a struct in nng, so difficult to validate
 
        setenv( "ENV_VERBOSE_FILE", ".ut_rmr_verbose", 1 );                     // allow for verbose code in rtc to be driven
-       i = open( ".rmr_verbose", O_CREAT, 0664 );
+       i = open( ".ut_rmr_verbose", O_RDWR | O_CREAT, 0644 );
        if( i >= 0 ) {
+               write( 1, "2\n", 2 );
                close( i );
        }
 
@@ -227,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
 }