#include <sys/ioctl.h>
#include <linux/logger.h>
+/* This is supposed to check a 1000ms timeout, so ideally this would be just a
+ * little bit over 1000 (to account for non-timeout overhead). But the kernel
+ * does not actually guarantee that we will wake up at once, the timeout is just
+ * a minimum. On busy and/or emulated systems the total wait can stretch for a
+ * fairly long time. Here the value is an arbitrary compromise that happens to
+ * pass the test on my tortured system without being too absurd. */
+#define ONE_SECOND_LENIENCE_MS 1300
+
enum test_mode {
MODE_DUMP,
MODE_TIMER,
if (e) {
assert(r == 0);
- assert(dt < 1100);
+ assert(dt < ONE_SECOND_LENIENCE_MS);
log_priority prio;
r = dlogutil_entry_get_priority(e, &prio);
assert(dt >= 1000);
} else {
assert(r == TIZEN_ERROR_NO_DATA);
- assert(dt < 1100);
+ assert(dt < ONE_SECOND_LENIENCE_MS);
}
break;
}