tests/include/tc_nano_timeout_common.h
/*
 * Verify a timeout is in range, either a diff of 0 or 1 to account for tick
 * boundaries.
 */
Verify a timeout is in range, either a diff of 0 or 1 to account for tick
boundaries.
Verify a timeout is in range either a diff of 0 or 1 to account for tick boundaries .
static inline int is_timeout_in_range(s32_t orig_ticks, s32_t expected)
{
	s32_t diff = sys_tick_get() - orig_ticks;
#if SHORT_TIMEOUTS
	if (diff != expected && diff != expected + 1) {
		TC_ERROR(" *** timeout skew: expected %d/%d, got %d\n",
					expected, expected + 1, diff);
		return 0;
	}
	return 1;
#else
	return diff >= expected;
#endif
}
static inline int is_timeout_in_range ( s32_t orig_ticks , s32_t expected ) { s32_t diff = sys_tick_get ( ) - orig_ticks ; #if SHORT_TIMEOUTS if ( diff != expected && diff != expected + 1 ) { TC_ERROR ( " \n " , expected , expected + 1 , diff ) ; return 0 ; } return 1 ; #else return diff >= expected ; #endif }
Verify a timeout is in range, either a diff of 0 or 1 to account for tick
 boundaries.
Verify a timeout is in range either a diff of 0 or 1 to account for tick boundaries .
/*
	 * This should be the real test: however, there is an issue with the
	 * Jenkins auto-builders and QEMU for ARM, where (it seems) if the
	 * builder is overloaded, they do not give enough time to a QEMU instance
	 * so the Zephyr ticker can increment multiple times (so the interrupt
	 * handling happens) before the regular processing does occur, which gives
	 * the impression that more ticks have elapsed than expected.
	 */ /* TC_PRINT("timeout in range (%d vs %d)\n", diff, expected); */