diff options
Diffstat (limited to 'test/test.c')
-rw-r--r-- | test/test.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/test/test.c b/test/test.c index 02e56788a..aeb2b4058 100644 --- a/test/test.c +++ b/test/test.c @@ -145,6 +145,7 @@ bool_t _test_assert_sequence(unsigned point, char *expected) { }
if (*expected)
return _test_fail(point);
+ clear_tokens();
return FALSE;
}
@@ -174,16 +175,17 @@ void test_wait_threads(void) { }
}
-void test_cpu_pulse(unsigned ms) {
+#if CH_DBG_THREADS_PROFILING
+void test_cpu_pulse(unsigned duration) {
- systime_t duration = MS2ST(ms);
- systime_t start = chTimeNow();
- while (chTimeIsWithin(start, start + duration)) {
+ systime_t end = chThdSelf()->p_time + MS2ST(duration);
+ while (chThdSelf()->p_time < end) {
#if defined(WIN32)
ChkIntSources();
#endif
}
}
+#endif
systime_t test_wait_tick(void) {
|