diff --git a/test/unit/arch/sys_arch.c b/test/unit/arch/sys_arch.c index cd7675d7..3ef98199 100644 --- a/test/unit/arch/sys_arch.c +++ b/test/unit/arch/sys_arch.c @@ -97,7 +97,7 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) /* wait infinite */ LWIP_ASSERT("cannot wait without waiting callback", the_waiting_fn != NULL); do { - int expectSomething = the_waiting_fn(sem); + int expectSomething = the_waiting_fn(sem, NULL); LWIP_ASSERT("*sem > 0", *sem > 0); LWIP_ASSERT("expecting a semaphore count but it's 0", !expectSomething || (*sem > 1)); ret++; @@ -106,7 +106,7 @@ u32_t sys_arch_sem_wait(sys_sem_t *sem, u32_t timeout) else { if (the_waiting_fn) { - int expectSomething = the_waiting_fn(sem); + int expectSomething = the_waiting_fn(sem, NULL); LWIP_ASSERT("expecting a semaphore count but it's 0", !expectSomething || (*sem > 1)); } LWIP_ASSERT("*sem > 0", *sem > 0); @@ -275,7 +275,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout) /* wait infinite */ LWIP_ASSERT("cannot wait without waiting callback", the_waiting_fn != NULL); do { - int expectSomething = the_waiting_fn(q); + int expectSomething = the_waiting_fn(NULL, q); LWIP_ASSERT("q->used >= 0", q->used >= 0); LWIP_ASSERT("expecting item available but it's 0", !expectSomething || (q->used > 0)); ret++; @@ -284,7 +284,7 @@ u32_t sys_arch_mbox_fetch(sys_mbox_t *q, void **msg, u32_t timeout) else { if (the_waiting_fn) { - int expectSomething = the_waiting_fn(q); + int expectSomething = the_waiting_fn(NULL, q); LWIP_ASSERT("expecting item available count but it's 0", !expectSomething || (q->used > 0)); } LWIP_ASSERT("q->used >= 0", q->used >= 0); diff --git a/test/unit/arch/sys_arch.h b/test/unit/arch/sys_arch.h index 0003da9d..663cbcb6 100644 --- a/test/unit/arch/sys_arch.h +++ b/test/unit/arch/sys_arch.h @@ -56,12 +56,12 @@ typedef u32_t sys_thread_t; #define SYS_ARCH_PROTECT(lev) #define SYS_ARCH_UNPROTECT(lev) -/* to implement doing something while waiting: +/* to implement doing something while blocking on an mbox or semaphore: * pass a function to test_sys_arch_wait_callback() that returns * '0' if waiting again and * '1' if now there should be something to do (used for asserting) */ -typedef int (*test_sys_arch_waiting_fn)(void* wait_element); +typedef int (*test_sys_arch_waiting_fn)(sys_sem_t* wait_sem, sys_mbox_t* wait_mbox); void test_sys_arch_wait_callback(test_sys_arch_waiting_fn waiting_fn); #endif /* LWIP_HDR_TEST_SYS_ARCH_H */