Change-Id: I4c546d8e3479b7498c9ed2def85b7f710672b055
fi
LOG_DETAILS="testing if libdlogutil clears the buffer correctly"
+sleep 1 # make sure the earlier logs are handled so that they don't end up handled after the clear
test_libdlogutil clear $LIBDLOGUTIL_CORRECT_PID $type && ok || fail
if [ "$(date +%Y)" -le 2000 ]; then
void clear_main(void)
{
-
dlogutil_config_s *c = dlogutil_config_create();
assert(c);
assert(dlogutil_config_buffer_add(c, LOG_ID_MAIN) == 0);
assert(dlogutil_buffer_clear(s, LOG_ID_MAIN) == 0);
dlogutil_state_destroy(s);
+ // avoid a race condition; let the clear take place
+ nanosleep(&(struct timespec) {
+ .tv_sec = 1,
+ .tv_nsec = 0,
+ }, NULL);
+
assert(dlogutil_config_mode_set_dump(c, DLOGUTIL_MAX_DUMP_SIZE) == 0);
assert(dlogutil_config_connect(c, &s) == 0);
dlogutil_entry_s *e;