Beef up unit tests for SI95 code

This changes adds some unit tests for SI95 modules which had none
prior, and extends some of the existing tests to improve coverage.

Issue-ID: RIC-777

Change-Id: I5d704776fd9094e8b17e35263cc4680bf822b38c
Signed-off-by: E. Scott Daniels <daniels@att.com>
diff --git a/test/alarm_static_test.c b/test/alarm_static_test.c
index a4008e3..783ce17 100644
--- a/test/alarm_static_test.c
+++ b/test/alarm_static_test.c
@@ -26,82 +26,15 @@
 	Date:		22 February 2021
 */
 
-#ifdef KEEP
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <errno.h>
-#include <string.h>
-#include <stdint.h>
-#include <pthread.h>
-#include <semaphore.h>
-
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <errno.h>
-#include <string.h>
-#include <stdint.h>
-#include <ctype.h>
-//#include <sys/epoll.h>
-//#include <pthread.h>
-//#include <semaphore.h>
-
-#define DEBUG 1								// must define before pulling in rmr header files
-#define PARANOID_CHECKS	1					// must have parinoid testing on to not fail on nil pointer tests
-
-
-											// specific test tools in this directory
-#undef NNG_UNDER_TEST
-#include "test_support.c"					// things like fail_if()
-#include "test_msg_support.c"
-#include "test_gen_rt.c"
-
-
-#include "rmr.h"					// things the users see
-#include "rmr_agnostic.h"			// rmr private things
-
-#include "rmr_symtab.h"				// must pull in for context setup
-#include "rmr_agnostic.h"			// transport agnostic header
-
-#include "logging.c"
-#include "rt_generic_static.c"
-#include "tools_static.c"
-#include "symtab.c"
-//#include "rmr_si.c"
-//#include "mbuf_api.c"
-
-#include "test_ctx_support.c"				// dummy context support (needs symtab defs, so not with others above)
-
-
-//static void gen_rt( uta_ctx_t* ctx );		// defined in sr_si_static_test, but used by a few others (eliminate order requirement below)
-
-											// and finally.... the things under test
-#include "alarm.c"
-//#include "tools_static_test.c"				// local test functions pulled directly because of static nature of things
-//#include "symtab_static_test.c"
-//#include "ring_static_test.c"
-//#include "rt_static_test.c"
-//#include "wormhole_static_test.c"
-//#include "mbuf_api_static_test.c"
-//#include "sr_si_static_test.c"
-//#include "lg_buf_static_test.c"
-// do NOT include the receive test static must be stand alone
-
-
-#endif
 
 /*
 	These tests assume there is a dummy process listening on 127.0.0.1:1986; if it's not there
 	the tests still pass, but coverage is reduced because the sends never happen.
 */
 static int alarm_test( ) {
-	int errors = 0;			// number errors found
+	int errors = 0;				// number errors found
 	uta_ctx_t* ctx;
+	uta_ctx_t* pctx;			// tests  into rtable functions need a second context
 	char*	endpt = NULL;
 
 	ctx = mk_dummy_ctx();
@@ -140,20 +73,42 @@
 	uta_alarm_send( ctx, NULL );									// ensure nil message doesn't crash us
 
 
+	// ------ drive the alarm if dropping function in the route table code --------------------------------
+
+	pctx = mk_dummy_ctx();				// grab a private context for rt to use
+
+	/*
+		These tests don't return anything that we can check; driving just to cover the lines and ensure
+		we don't segfault or something bad like that.
+	*/
+	ctx->dcount - 0;
+	alarm_if_drops( ctx,  pctx );			// should do nothing; no drops indicated
+
+	ctx->dcount = 1024;						// make it look like we dropped things
+	alarm_if_drops( ctx,  pctx );			// should drive the code block to send alarm and put is in dropping mode
+
+	ctx->dcount = 1028;						// make it look like we are still  dropping
+	alarm_if_drops( ctx,  pctx );			// drive the just reset time to clear block
+
+	alarm_if_drops( ctx,  pctx );			// drive the check to see if past the clear time (it's not) to reset timer
+
+	fprintf( stderr, "<TEST> pausing 65 seconds before driving last alarm if drops call\n" );
+	sleep( 65 );							// we must pause for longer than the timer so we can drive last block
+	alarm_if_drops( ctx,  pctx );			// should appear that we're not dropping and reset the alarm
+
+
+	// -------------------------- tidy the house ---------------------------------------------------------
 	if( ctx ) {
 		free( ctx->my_name );
 		free( ctx->my_ip );
 		free( ctx );
 	}
 
-	return !!errors;			// 1 or 0 regardless of count
-}
-/*
+	if( pctx ) {
+		free( pctx->my_name );
+		free( pctx->my_ip );
+		free( pctx );
+	}
 
-int main( ) {
-	int errors = 0;
-
-	errors += alarm_test();
-	exit( !!errors );
+	return errors;
 }
-*/
diff --git a/test/hdr_static_test.c b/test/hdr_static_test.c
index 1e30d86..3a555ce 100644
--- a/test/hdr_static_test.c
+++ b/test/hdr_static_test.c
@@ -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.
@@ -105,9 +105,13 @@
 	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;
 }
diff --git a/test/mbuf_api_test.c b/test/mbuf_api_test.c
index 75d8445..bbace51 100644
--- a/test/mbuf_api_test.c
+++ b/test/mbuf_api_test.c
@@ -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.
@@ -108,5 +108,5 @@
 		fprintf( stderr, "<OK>	 mbuf_api tests pass\n" );
 	}
 
-	return errors;
+	return !! errors;
 }
diff --git a/test/rmr_nng_api_static_test.c b/test/rmr_nng_api_static_test.c
index 6588907..b7cc5eb 100644
--- a/test/rmr_nng_api_static_test.c
+++ b/test/rmr_nng_api_static_test.c
@@ -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.
@@ -463,5 +463,5 @@
 	if( ! errors ) {
 		fprintf( stderr, "<INFO> all RMr API tests pass\n" );
 	}
-	return !!errors;
+	return errors;
 }
diff --git a/test/rmr_si_api_static_test.c b/test/rmr_si_api_static_test.c
index 5f0a4f4..2e2b7c7 100644
--- a/test/rmr_si_api_static_test.c
+++ b/test/rmr_si_api_static_test.c
@@ -1,8 +1,8 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-	    Copyright (c) 2019-2020 Nokia
-	    Copyright (c) 2018-2020 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.
@@ -99,8 +99,10 @@
 	int		v = 0;					// some value
 	char	wbuf[128];
 	int		i;
+	void*	p;					// generic pointer to test return value
 	int		state;
 	int		max_tries;			// prevent a sticking in any loop
+	uta_ctx_t* ctx;
 
 	v = rmr_ready( NULL );
 	errors += fail_if( v != 0, "rmr_ready returned true before initialisation "  );
@@ -280,9 +282,20 @@
 	rmr_close( rmc );			// no return to check; drive for coverage
 
 
-	// --------------- nil pointer exception checks
+	// ----- mt_rcv edge cases -------------------------------------------------------------------------------------
+	ctx = mk_dummy_ctx();
+	p = rmr_mt_rcv( NULL, msg, 0 );				// give a valid message to cover additional lines
+	errors += fail_if_nil( p, "rmr_rt_rcv did not pointer when given a message with a nil context" );
+	if( msg ) {
+		errors += fail_if_equal( msg->state, RMR_OK, "rmr_mt_rcv returned OK state when given nil context" );
+	}
+
+	p = rmr_mt_rcv( ctx, msg, 0 );				// one shot receive "poll" case
+	errors += fail_if_nil( p, "mt_rcv with one shot time length did not return a pointer" );
+
+
+	// --------------- nil pointer exception checks ----------------------------------------------------------------
 	rmr_rcv_specific( NULL, NULL, "foo", 0 );
-	rmr_mt_rcv( NULL, NULL, 0 );
 	mt_call( NULL, NULL, 0, 1, NULL );
 	rmr_mt_call( NULL, NULL, 0, 1 );
 	rmr_set_low_latency( NULL );
@@ -312,10 +325,32 @@
 	errors += test_ep_counts();
 	init_err( "test error message", rmc, rmc2, ENOMEM );		// drive for coverage
 
+	ctx = mk_dummy_ctx();
+	ctx->river_hash = rmr_sym_alloc( 129 );
+
+	buf2mbuf( NULL, NULL, 0, 0 );								// things in mt_call_si_static
+
+	state = mt_data_cb( NULL, 0, "123", 3 );
+	errors += fail_not_equal( state, 0, "mt_data_cb didn't respond correctly when ctx is nil" );
+
+	state = mt_data_cb( ctx, -1, "123", 3 );
+	errors += fail_not_equal( state, 0, "mt_data_cb didn't respond correctly when ctx is nil" );
+
+	ctx->nrivers = 1;
+	state = mt_data_cb( ctx, 23, "123", 3 );					// force add river to hash reference
+	errors += fail_not_equal( state, 0, "mt_data_cb didn't respond correctly when ctx is nil" );
+
+	mt_disc_cb( NULL, 0 );
+	mt_disc_cb( ctx, 128 );					// for a FD we know isn't there
+
+
+	p = mt_receive( NULL );
+	errors += fail_not_nil( p, "mt_receive returned non-nil pointer when given nil context" );
+
 	// --------------- phew, done ------------------------------------------------------------------------------
 
 	if( ! errors ) {
 		fprintf( stderr, "<INFO> all RMr API tests pass\n" );
 	}
-	return !!errors;
+	return errors;
 }
diff --git a/test/rmr_si_rcv_static_test.c b/test/rmr_si_rcv_static_test.c
index 57313f8..b040359 100644
--- a/test/rmr_si_rcv_static_test.c
+++ b/test/rmr_si_rcv_static_test.c
@@ -1,8 +1,8 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-	    Copyright (c) 2019-2020 Nokia
-	    Copyright (c) 2018-2020 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.
@@ -270,5 +270,5 @@
 		fprintf( stderr, "<INFO> receive tests failures noticed \n" );
 	}
 
-	return !!errors;
+	return errors;
 }
diff --git a/test/rmr_si_test.c b/test/rmr_si_test.c
index 491242d..256e2bd 100644
--- a/test/rmr_si_test.c
+++ b/test/rmr_si_test.c
@@ -1,8 +1,8 @@
 // :vi sw=4 ts=4 noet:
 /*
 ==================================================================================
-	Copyright (c) 2020 Nokia
-	Copyright (c) 2020 AT&T Intellectual Property.
+	Copyright (c) 2020-2021 Nokia
+	Copyright (c) 2020-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.
@@ -142,13 +142,10 @@
 	fprintf( stderr, "\n<INFO> starting RMr API tests\n" );
 	errors += rmr_api_test();
 
-/// ---- all ok above here
-/*
 	fprintf( stderr, "\n<INFO> run RMr API tests with src name only env var set\n" );
 	setenv( "RMR_SRC_NAMEONLY", "1", 1 );
 	errors += rmr_api_test();
 	fprintf( stderr, "<INFO> error count: %d\n", errors );
-*/
 
 	test_summary( errors, "rmr_si tests" );
 	if( errors == 0 ) {
diff --git a/test/rt_nano_static_test.c b/test/rt_nano_static_test.c
index d56f01f..3e66638 100644
--- a/test/rt_nano_static_test.c
+++ b/test/rt_nano_static_test.c
@@ -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.
@@ -261,5 +261,5 @@
 	errors += fail_if_equal( state, -1, "call to link2_ep with nil ep returned true when false expected" );
 
 
-	return !!errors;			// 1 or 0 regardless of count
+	return errors;
 }
diff --git a/test/rt_static_test.c b/test/rt_static_test.c
index 3bdd312..6973a79 100644
--- a/test/rt_static_test.c
+++ b/test/rt_static_test.c
@@ -2,8 +2,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.
@@ -714,5 +714,5 @@
 	// ------ specific edge case tests -------------------------------------------------------------------------------
 	errors += lg_clone_test( );
 
-	return !!errors;			// 1 or 0 regardless of count
+	return errors;			// 1 or 0 regardless of count
 }
diff --git a/test/si95_test.c b/test/si95_test.c
index 809d9a1..8e9ee50 100644
--- a/test/si95_test.c
+++ b/test/si95_test.c
@@ -1,8 +1,8 @@
 // :vi sw=4 ts=4 noet:
 /*
 ==================================================================================
-	Copyright (c) 2020 Nokia
-	Copyright (c) 2020 AT&T Intellectual Property.
+	Copyright (c) 2020-2021 Nokia
+	Copyright (c) 2020-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.
@@ -35,26 +35,18 @@
 #include <errno.h>
 #include <pthread.h>
 #include <ctype.h>
+#include <unistd.h>
+#include <strings.h>
+#include <stdint.h>
+#include <sys/epoll.h>
+#include <semaphore.h>
+
 
 #include <netdb.h>		// these four needed for si address tests
 #include <stdio.h>
 #include <ctype.h>
 #include <netinet/in.h>
 
-
-
-#include <unistd.h>
-#include <stdio.h>
-#include <stdlib.h>
-#include <strings.h>
-#include <errno.h>
-#include <string.h>
-#include <stdint.h>
-#include <ctype.h>
-#include <sys/epoll.h>
-#include <pthread.h>
-#include <semaphore.h>
-
 #define DEBUG 1
 
 											// specific test tools in this directory
@@ -66,14 +58,39 @@
 #include "test_support.c"					// things like fail_if()
 #include "test_transport_em.c"				// system/transport emulation (open, close, connect, etc)
 
-/*
-#include "rmr.h"					// things the users see
-#include "rmr_symtab.h"
-#include "rmr_agnostic.h"			// transport agnostic header
-*/
 #include <rmr_logging.h>
 #include <logging.c>
 
+
+// ------------- dummy functions to force edge cases when we can ---------------------------------------
+
+#define SYSTEM_UNDER_TEST	1				// for conditional code
+
+/*
+	These are global so they can be reset for individual tests.
+*/
+static int good_mallocs = 0;		// number of initial good malocs before failurs
+static int bad_mallocs = 1;			// number of failed mallocs (consecutive)
+
+static void* test_malloc( size_t n ) {
+
+fprintf( stderr, ">>>> test malloc: %d %d\n", good_mallocs, bad_mallocs );
+	if( good_mallocs ) {
+		good_mallocs--;
+		return malloc( n );
+	}
+
+	if( bad_mallocs ) {
+		bad_mallocs--;
+		errno = ENOMEM;
+		return NULL;
+	}
+
+	return malloc( n );
+}
+
+// -----------------------------------------------------------------------------------------------------
+
 #include <si95/siaddress.c>
 //#include <si95/sialloc.c>
 #include <si95/sibldpoll.c>
@@ -95,7 +112,9 @@
 #include <si95/sishutdown.c>
 #include <si95/siterm.c>
 #include <si95/sitrash.c>
-//#include <si95/siwait.c>
+#define malloc test_malloc
+#include <si95/siwait.c>
+#undef malloc
 
 // ---------------------------------------------------------------------
 
@@ -270,6 +289,15 @@
 static int poll() {
 	int errors  = 0;
 	int status;
+	struct ginfo_blk* dummy;
+
+
+	dummy = SIinitialise( 0 );				// get one to fiddle to drive edge cases
+	dummy->flags |= GIF_SHUTDOWN;			// shutdown edge condition
+	SIpoll( dummy, 1 );
+
+	memset( dummy, 0, sizeof( *dummy ) );	// force bad cookie check code to drive
+	SIpoll( dummy, 1 );
 
 	status = SIpoll( si_ctx, 1 );
 	errors += fail_if_true( status != 0, "poll failed" );
@@ -436,6 +464,29 @@
 }
 
 
+/*
+	Wait testing.  This is tricky because we don't have any sessions and thus it's difficult
+	to drive much of SIwait().
+*/
+static int wait_tests() {
+	int errors = 0;
+	struct ginfo_blk* dummy;
+
+
+	dummy = SIinitialise( 0 );				// get one to fiddle to drive edge cases
+	SIwait( dummy );						// malloc should "fail"
+
+	dummy->flags |= GIF_SHUTDOWN;
+	SIwait( dummy );
+
+	memset( dummy, 0, sizeof( *dummy ) );	// force bad cookie check code to drive
+	SIwait( dummy );
+
+	SIwait( si_ctx );						// should drive once through the loop
+
+	return errors;
+}
+
 // ----------------------------------------------------------------------------------------
 
 /*
@@ -459,6 +510,7 @@
 	errors += send_tests();
 
 	errors += poll();
+	errors += wait_tests();
 
 	errors += cleanup();
 
diff --git a/test/sr_nano_static_test.c b/test/sr_nano_static_test.c
index 9f88562..815f68b 100644
--- a/test/sr_nano_static_test.c
+++ b/test/sr_nano_static_test.c
@@ -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.
@@ -269,7 +269,5 @@
 	rtc( ctx );
 
 
-	// --- drive the route table things which are nanomsg specific ------
-
-	return !!errors;
+	return errors;
 }
diff --git a/test/sr_nng_static_test.c b/test/sr_nng_static_test.c
index b11934d..9597c20 100644
--- a/test/sr_nng_static_test.c
+++ b/test/sr_nng_static_test.c
@@ -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.
@@ -278,5 +278,5 @@
 	errors += fail_not_equal( strncmp( payload_str, mbuf->payload, strlen( payload_str )), 0, "realloc payload (clone+nocopy) validation of unchanged payload fails" );
 
 
-	return !!errors;
+	return errors;
 }
diff --git a/test/sr_si_static_test.c b/test/sr_si_static_test.c
index 213a08b..b86ab89 100644
--- a/test/sr_si_static_test.c
+++ b/test/sr_si_static_test.c
@@ -1,8 +1,8 @@
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
-	    Copyright (c) 2020 Nokia
-	    Copyright (c) 2020 AT&T Intellectual Property.
+	    Copyright (c) 2020-2021 Nokia
+	    Copyright (c) 2020-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.
@@ -277,6 +277,6 @@
 	dump_n( payload_str, "A dump", strlen( payload_str ) );
 	dump_40( payload_str, "another dump" );
 
-	return !!errors;
+	return errors;
 
 }
diff --git a/test/symtab_static_test.c b/test/symtab_static_test.c
index c512966..5bf2985 100644
--- a/test/symtab_static_test.c
+++ b/test/symtab_static_test.c
@@ -1,7 +1,7 @@
 /*
 ==================================================================================
-	    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.
@@ -136,6 +136,6 @@
 	rmr_sym_free( NULL );			// ensure it doesn't barf when given a nil pointer
 	rmr_sym_free( st );
 
-	return !!( errors + symtab_state );
+	return  errors + (!!symtab_state );
 }
 
diff --git a/test/symtab_test.c b/test/symtab_test.c
index 8cb8b15..9beae8d 100644
--- a/test/symtab_test.c
+++ b/test/symtab_test.c
@@ -1,7 +1,7 @@
 /*
 ==================================================================================
-	    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.
@@ -247,6 +247,8 @@
 	rmr_sym_free( NULL );			// ensure it doesn't barf when given a nil pointer
 	rmr_sym_free( st );
 
+	errors += thread_test();		// test as best we can for race issues
+
 	test_summary( errors, "symtab tests" );
 	if( state + errors == 0 ) {
 		fprintf( stderr, "<PASS> all symtab tests were OK\n\n" );
@@ -254,7 +256,6 @@
 		fprintf( stderr, "<FAIL> %d errors in symtab code\n\n", errors );
 	}
 
-	errors += thread_test();
 
 	return !!(state + errors);
 }
diff --git a/test/tools_static_test.c b/test/tools_static_test.c
index c6e4e8b..b914c38 100644
--- a/test/tools_static_test.c
+++ b/test/tools_static_test.c
@@ -1,4 +1,3 @@
-	if_addrs_t*	ifl;			// interface lis2
 // : vi ts=4 sw=4 noet :
 /*
 ==================================================================================
@@ -333,5 +332,5 @@
 	errors += ztbf_test();
 
 	test_summary( errors, "tools" );
-	return !!errors;			// 1 or 0 regardless of count
+	return errors;
 }
diff --git a/test/wormhole_static_test.c b/test/wormhole_static_test.c
index 9d5fd58..cbca81d 100644
--- a/test/wormhole_static_test.c
+++ b/test/wormhole_static_test.c
@@ -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.
@@ -218,5 +218,5 @@
 		free( ctx );
 	}
 
-	return !!errors;			// 1 or 0 regardless of count
+	return errors;
 }
diff --git a/test/wrapper_static_test.c b/test/wrapper_static_test.c
index 3ca71ba..8f7d1ca 100644
--- a/test/wrapper_static_test.c
+++ b/test/wrapper_static_test.c
@@ -59,5 +59,5 @@
 
 	// -------------------------------------------------------------------------------------------------
 
-	return !!errors;			// 1 or 0 regardless of count
+	return errors;
 }