- // ------------ has str tests -----------------------------------------------------------------
- j = uta_has_str( buf, "Mr. Slate", ',', 1 ); // should fail (-1) because user should use strcmp in this situation
- errors += fail_if_true( j >= 0, "test to ensure has str rejects small max" );
-
- j = uta_has_str( buf, "Mr. Slate", ',', 27 );
- errors += fail_if_true( j < 0, "has string did not find Mr. Slate" );
-
- j = uta_has_str( buf, "Mrs. Slate", ',', 27 );
- errors += fail_if_true( j >= 0, "has string not found Mrs. Slate" );
-
- // ------------ host name 2 ip tests ---------------------------------------------------------
- hname = uta_h2ip( "192.168.1.2" );
- errors += fail_not_equal( strcmp( hname, "192.168.1.2" ), 0, "h2ip did not return IP address when given address" );
- errors += fail_if_nil( hname, "h2ip did not return a pointer" );
- free( hname );
-
- hname = uta_h2ip( "yahoo.com" );
- errors += fail_if_nil( hname, "h2ip did not return a pointer" );
- free( hname );
-
- hname = uta_h2ip( "yahoo.com:1234" ); // should ignore the port
- errors += fail_if_nil( hname, "h2ip did not return a pointer" );
- free( hname );
-
- // ------------ rtg lookup test -------------------------------------------------------------
-#ifdef KEEP
- // pub/sub route table generator is deprecated and should be removed at this point
- ctx.rtg_port = 0;
- ctx.rtg_addr = NULL;
-
- i = uta_lookup_rtg( NULL ); // ensure it handles a nil context
- errors += fail_if_true( i, "rtg lookup returned that it found something when not expected to (nil context)" );
-
- setenv( "RMR_RTG_SVC", "localhost:1234", 1);
- i = uta_lookup_rtg( &ctx );
- errors += fail_if_false( i, "rtg lookup returned that it did not find something when expected to" );
- errors += fail_if_nil( ctx.rtg_addr, "rtg lookup did not return a pointer (with port)" );
- errors += fail_not_equal( ctx.rtg_port, 1234, "rtg lookup did not capture the port" );