moved the locking tests from test/locking/ to test/library/

This commit is contained in:
Christian Thaeter 2008-08-09 10:29:51 +02:00
parent 07f06d0d88
commit 777458741a
4 changed files with 11 additions and 89 deletions

View file

@ -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

View file

@ -19,20 +19,26 @@
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
*/
#include <stdio.h>
#include <string.h>
#include "tests/test.h"
#include "lib/mutex.h"
#include "lib/condition.h"
int conditionforgotunlock ();
#include <stdio.h>
#include <string.h>
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;

View file

@ -1,49 +0,0 @@
/*
test condition functions
Copyright (C) Lumiera.org
2008, Christian Thaeter <ct@pipapo.org>
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;
}

View file

@ -1,32 +0,0 @@
/*
test mutex functions
Copyright (C) Lumiera.org
2008, Christian Thaeter <ct@pipapo.org>
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;
}