From 7b477b32b8dc3f2dcfa23b95b04259374f474e80 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Tue, 11 Apr 2017 12:43:33 +0200 Subject: [PATCH] let unit test sys_arch check that a mutex is not taken recursively --- test/unit/arch/sys_arch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/unit/arch/sys_arch.c b/test/unit/arch/sys_arch.c index 3ef98199..3d4dec6a 100644 --- a/test/unit/arch/sys_arch.c +++ b/test/unit/arch/sys_arch.c @@ -156,7 +156,8 @@ void sys_mutex_lock(sys_mutex_t *mutex) { /* nothing to do, no multithreading supported */ LWIP_ASSERT("mutex != NULL", mutex != NULL); - LWIP_ASSERT("*mutex >= 1", *mutex >= 1); + /* check that the mutext is valid and unlocked (no nested locking) */ + LWIP_ASSERT("*mutex >= 1", *mutex == 1); /* we count up just to check the correct pairing of lock/unlock */ (*mutex)++; LWIP_ASSERT("*mutex >= 1", *mutex >= 1);