From 26d9661aebf68b656af71e5cee27a7a69943706b Mon Sep 17 00:00:00 2001 From: deva Date: Mon, 18 Jan 2010 14:25:51 +0000 Subject: Use new PHTREAD flags --- server/src/connectionpool.cc | 4 ++-- server/src/entitylist.cc | 4 ++-- server/src/environment.cc | 4 ++-- server/src/mutex.cc | 12 ++++++------ server/src/session.cc | 4 ++-- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/server/src/connectionpool.cc b/server/src/connectionpool.cc index 743bb68..07e6aa2 100644 --- a/server/src/connectionpool.cc +++ b/server/src/connectionpool.cc @@ -33,8 +33,8 @@ #ifdef TEST_CONNECTIONPOOL //deps: mutex.cc semaphore.cc -//cflags: -//libs: -lpthread +//cflags: $(PTHREAD_CFLAGS) +//libs: $(PTHREAD_LIBS) #include #include #include diff --git a/server/src/entitylist.cc b/server/src/entitylist.cc index 6440a11..04533c0 100644 --- a/server/src/entitylist.cc +++ b/server/src/entitylist.cc @@ -218,8 +218,8 @@ void EntityList::insertEntity(std::string entity, std::string version, std::stri #ifdef TEST_ENTITYLIST //deps: inotify.cc debug.cc mutex.cc exception.cc versionstr.cc log.cc -//cflags: -I.. -//libs: -lpthread +//cflags: -I.. $(PTHREAD_CFLAGS) +//libs: $(PTHREAD_LIBS) #include "test.h" #include diff --git a/server/src/environment.cc b/server/src/environment.cc index 35d9ad4..14dbd79 100644 --- a/server/src/environment.cc +++ b/server/src/environment.cc @@ -57,8 +57,8 @@ Environment::~Environment() #ifdef TEST_ENVIRONMENT //deps: configuration.cc database.cc artefact.cc pracrodao.cc session.cc mutex.cc semaphore.cc debug.cc pracrodaotest.cc pracrodaopgsql.cc journalwriter.cc journal_commit.cc entitylist.cc inotify.cc exception.cc versionstr.cc tcpsocket.cc macrolist.cc templatelist.cc saxparser.cc log.cc macroheaderparser.cc templateheaderparser.cc -//cflags: -I.. $(PQXX_CXXFLAGS) -//libs: $(PQXX_LIBS) -lpthread -lexpat +//cflags: -I.. $(PQXX_CXXFLAGS) $(PTHREAD_CFLAGS) $(EXPAT_CFLAGS) +//libs: $(PQXX_LIBS) -lpthread $(EXPAT_LIBS) $(PTHREAD_LIBS) #include "test.h" TEST_BEGIN; diff --git a/server/src/mutex.cc b/server/src/mutex.cc index 23ec255..ec0d0e8 100644 --- a/server/src/mutex.cc +++ b/server/src/mutex.cc @@ -66,8 +66,8 @@ MutexAutolock::~MutexAutolock() #ifdef TEST_MUTEX //deps: -//cflags: -//libs: -lpthread +//cflags: $(PTHREAD_CFLAGS) +//libs: $(PTHREAD_LIBS) #include #include @@ -100,12 +100,12 @@ pthread_t tid; pthread_attr_init(&attr); pthread_create(&tid, &attr, thread_run, &mutex); -usleep(100); -TEST_EQUAL(cnt, 0, "Testing if lock prevent cnt from increasing."); +sleep(1); +TEST_EQUAL_INT(cnt, 0, "Testing if lock prevent cnt from increasing."); mutex.unlock(); -usleep(100); -TEST_EQUAL(cnt, 1, "Testing if unlock makes cnt increase."); +sleep(1); +TEST_EQUAL_INT(cnt, 1, "Testing if unlock makes cnt increase."); pthread_join(tid, NULL); pthread_attr_destroy(&attr); diff --git a/server/src/session.cc b/server/src/session.cc index b53df1a..675bf56 100644 --- a/server/src/session.cc +++ b/server/src/session.cc @@ -116,8 +116,8 @@ size_t Sessions::size() #ifdef TEST_SESSION //deps: configuration.cc journalwriter.cc journal_commit.cc mutex.cc debug.cc -//cflags: -I.. -//libs: -lpthread +//cflags: -I.. $(PTHREAD_CFLAGS) +//libs: $(PTHREAD_LIBS) #include TEST_BEGIN; -- cgit v1.2.3