diff --git a/tests/Makefile.am b/tests/Makefile.am index 74d035034..c7ec4edae 100644 --- a/tests/Makefile.am +++ b/tests/Makefile.am @@ -24,10 +24,7 @@ test_error_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/sr test_error_LDADD = liblumi.a -lnobugmt -lpthread -ldl check_PROGRAMS += test-locking -test_locking_SOURCES = \ - $(tests_srcdir)/locking/test-locking.c \ - $(tests_srcdir)/locking/mutex.c \ - $(tests_srcdir)/locking/condition.c +test_locking_SOURCES = $(tests_srcdir)/library/test-locking.c test_locking_CPPFLAGS = $(AM_CPPFLAGS) -std=gnu99 -Wall -Werror -I$(top_srcdir)/src/ test_locking_LDADD = liblumi.a -lnobugmt -lpthread -ldl -lm diff --git a/tests/locking/test-locking.c b/tests/library/test-locking.c similarity index 92% rename from tests/locking/test-locking.c rename to tests/library/test-locking.c index c95aa652e..79eba76a0 100644 --- a/tests/locking/test-locking.c +++ b/tests/library/test-locking.c @@ -19,20 +19,26 @@ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */ -#include -#include #include "tests/test.h" #include "lib/mutex.h" +#include "lib/condition.h" -int conditionforgotunlock (); +#include +#include TESTS_BEGIN TEST ("conditionforgotunlock") { - return conditionforgotunlock (); + lumiera_condition c; + lumiera_condition_init (&c); + + lumiera_conditionacquirer l; + lumiera_conditionacquirer_init (&l, &c, LUMIERA_LOCKED); + return 0; } + TEST ("mutexsection") { lumiera_mutex m; diff --git a/tests/locking/condition.c b/tests/locking/condition.c deleted file mode 100644 index 7d79e9a7e..000000000 --- a/tests/locking/condition.c +++ /dev/null @@ -1,49 +0,0 @@ -/* - test condition functions - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "lib/condition.h" - -#if 0 -waiting_thread() -{ - lock; - wait; - unlock; -} - - -signaling_thread() -{ - signal(); -} -#endif - - -int -conditionforgotunlock () -{ - lumiera_condition c; - lumiera_condition_init (&c); - - lumiera_conditionacquirer l; - lumiera_conditionacquirer_init (&l, &c, LUMIERA_LOCKED); - return 0; -} diff --git a/tests/locking/mutex.c b/tests/locking/mutex.c deleted file mode 100644 index f4f8c18f6..000000000 --- a/tests/locking/mutex.c +++ /dev/null @@ -1,32 +0,0 @@ -/* - test mutex functions - - Copyright (C) Lumiera.org - 2008, Christian Thaeter - - This program is free software; you can redistribute it and/or - modify it under the terms of the GNU General Public License as - published by the Free Software Foundation; either version 2 of the - License, or (at your option) any later version. - - This program is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. -*/ - -#include "lib/mutex.h" - -int mutexforgotunlock() -{ - lumiera_mutex m; - lumiera_mutex_init (&m); - - lumiera_mutexacquirer l; - lumiera_mutexacquirer_init_mutex (&l, &m, LUMIERA_LOCKED); - return 0; -}