+/*
+ Driving ep counts is tricky when trying to do it as a part of the rts function, so
+ we drive that code on it's own.
+*/
+static int test_ep_counts() {
+ int errors = 0;
+ struct endpoint ep; // need a dummy endpoint
+
+ memset( &ep, 0, sizeof( ep ) );
+
+ incr_ep_counts( RMR_OK, &ep );
+ errors += fail_if_false( ep.scounts[EPSC_GOOD] == 1, "ep inc good counter had bad value" );
+
+ incr_ep_counts( RMR_ERR_RETRY, &ep );
+ errors += fail_if_false( ep.scounts[EPSC_TRANS] == 1, "ep inc trans counter had bad value" );
+
+ incr_ep_counts( 99, &ep ); // any non-retry/ok value
+ errors += fail_if_false( ep.scounts[EPSC_FAIL] == 1, "ep inc fail counter had bad value" );
+
+ incr_ep_counts( RMR_OK, NULL ); // ensure nil pointer doesn't crash us
+
+ return errors;
+}
+