diff --git a/Makefile.am b/Makefile.am index ac8c0a1b4..c23c7611c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,5 +1,5 @@ # Copyright (C) Lumiera.org -# 2007, Christian Thaeter +# 2007, 2009 Christian Thaeter # 2008, Joel Holdsworth # # This program is free software; you can redistribute it and/or @@ -35,8 +35,9 @@ CLEANFILES = # global pre-processor flags. Per-target variables should include # these at the front (if possible) for consistency -AM_CPPFLAGS = -I$(top_srcdir)/src/ \ - $(NOBUGMT_LUMIERA_CFLAGS) +AM_CPPFLAGS = -I$(top_srcdir)/src/ \ + $(NOBUGMT_LUMIERA_CFLAGS) \ + $(VALGRIND_CFLAGS) # Only use subdirs if really needed, prefer the include scheme below #SUBDIRS += diff --git a/SConstruct b/SConstruct index 9707a7b16..c2e703031 100644 --- a/SConstruct +++ b/SConstruct @@ -215,7 +215,7 @@ def configurePlatform(env): if not conf.CheckLibWithHeader('dl', 'dlfcn.h', 'C'): problems.append('Functions for runtime dynamic loading not available.') - if not conf.CheckPkgConfig('nobugmt', 0.3): + if not conf.CheckPkgConfig('nobugmt', 200909.1): problems.append('Did not find NoBug [http://www.pipapo.org/pipawiki/NoBug].') else: conf.env.mergeConf('nobugmt') @@ -227,10 +227,12 @@ def configurePlatform(env): conf.env.Append(CCFLAGS = ' -pthread') if conf.CheckCHeader('execinfo.h'): - conf.env.Append(CPPFLAGS = ' -DHAS_EXECINFO_H') + conf.env.Append(CPPFLAGS = ' -DHAVE_EXECINFO_H') if conf.CheckCHeader('valgrind/valgrind.h'): - conf.env.Append(CPPFLAGS = ' -DHAS_VALGRIND_VALGIND_H') + conf.env.Append(CPPFLAGS = ' -DHAVE_VALGRIND_H') + else: + print 'Valgrind not found. The use of Valgrind is optional; building without.' if not conf.CheckCXXHeader('tr1/memory'): problems.append('We rely on the std::tr1 proposed standard extension for shared_ptr.') diff --git a/configure.ac b/configure.ac index d69749882..cc7eee8b6 100644 --- a/configure.ac +++ b/configure.ac @@ -40,6 +40,7 @@ AC_PROG_CXX AC_LIBTOOL_DLOPEN AC_PROG_LIBTOOL +PKG_PROG_PKG_CONFIG([0.22]) # # test for headers @@ -85,9 +86,6 @@ AC_ARG_ENABLE(release, AC_HELP_STRING([--enable-release], [select NoBug RELEASE # C headers and libraries AC_LANG_PUSH([C]) -AC_CHECK_HEADER([execinfo.h], AC_DEFINE(HAVE_EXECINFO_H)) -# there is a warning in nobug, disabled til fixed AC_CHECK_HEADER([valgrind/valgrind.h], AC_DEFINE(HAVE_VALGRIND_VALGRIND_H)) - AC_CHECK_LIB(dl, dlopen, [LUMIERA_PLUGIN_LIBS="$LUMIERA_PLUGIN_LIBS -ldl"], [AC_MSG_ERROR([Dynamic linking not supported, report a bug])] ) @@ -186,15 +184,14 @@ AC_SUBST(LUMIERA_GUI_LIBS) AC_SUBST(LUMIERA_GUI_CFLAGS) ############## Nobug Dependancies -PKG_CHECK_MODULES(NOBUG_LUMIERA, [nobug >= 0.3rc1], - AC_DEFINE(HAVE_NOBUG_H), - AC_MSG_ERROR([NoBug pkg-config metadata missing (http://www.pipapo.org/pipawiki/NoBug)]) -) -PKG_CHECK_MODULES(NOBUGMT_LUMIERA, [nobugmt >= 0.3rc1], +AC_CHECK_HEADER([execinfo.h], AC_DEFINE(HAVE_EXECINFO_H)) +PKG_CHECK_MODULES(VALGRIND, [valgrind], AC_DEFINE(HAVE_VALGRIND_H), + AC_MSG_NOTICE([valgrind not found (optional)])) + +PKG_CHECK_MODULES(NOBUGMT_LUMIERA, [nobugmt >= 200909.1], AC_DEFINE(HAVE_NOBUGMT_H), AC_MSG_ERROR([NoBug pkg-config metadata missing (http://www.pipapo.org/pipawiki/NoBug)]) ) - # END Nobug Dependancies # Print a summary diff --git a/src/backend/filedescriptor.c b/src/backend/filedescriptor.c index 5ab30eba8..64ab6c01b 100644 --- a/src/backend/filedescriptor.c +++ b/src/backend/filedescriptor.c @@ -298,7 +298,7 @@ lumiera_filedescriptor_delete (LumieraFiledescriptor self, const char* name) if (self->handle && name && ((self->flags & O_RDWR) == O_RDWR)) { - TRACE (filedescriptor_dbg, "truncate %s to %lld", name, self->realsize); + TRACE (filedescriptor_dbg, "truncate %s to %lld", name, (long long)self->realsize); lumiera_filehandlecache_checkout (lumiera_fhcache, self->handle); int dummy = ftruncate (lumiera_filehandle_handle (self->handle), self->realsize); (void) dummy; /* this is present to silence a warning */ diff --git a/src/backend/mmapings.c b/src/backend/mmapings.c index ebf0c12db..3e052ce91 100644 --- a/src/backend/mmapings.c +++ b/src/backend/mmapings.c @@ -121,7 +121,7 @@ lumiera_mmapings_mmap_acquire (LumieraMMapings self, LumieraFile file, LList acq else { /* create new mmap */ - TRACE (mmapings_dbg, "mmap not found, creating", mmap); + TRACE (mmapings_dbg, "mmap not found, creating"); ret = lumiera_mmap_new (file, start, size); llist_insert_head (&self->mmaps, &ret->searchnode); diff --git a/src/common/appstate.cpp b/src/common/appstate.cpp index f20025ab2..1b949e2b0 100644 --- a/src/common/appstate.cpp +++ b/src/common/appstate.cpp @@ -186,7 +186,7 @@ namespace lumiera { AppState::abort (lumiera::Error& problem) { - INFO (common, "Address of Config Facade = %x", &lumiera::Config::instance()); //////////TODO: a temp hack to force configfacade.cpp to be linked into lumiera exe. + INFO (common, "Address of Config Facade = %p", &lumiera::Config::instance()); //////////TODO: a temp hack to force configfacade.cpp to be linked into lumiera exe. ERROR (common, "Aborting Lumiera after unhandled error: %s", cStr(problem.what())); diff --git a/src/gui/dialogs/render.cpp b/src/gui/dialogs/render.cpp index 64dcd23d5..88a8c41ff 100644 --- a/src/gui/dialogs/render.cpp +++ b/src/gui/dialogs/render.cpp @@ -94,7 +94,7 @@ void Render::on_button_browse() int result = dialog.run(); INFO(gui, "%d", result); if(result == RESPONSE_OK) - INFO(gui, "%d", "RESPONSE_OK"); + INFO(gui, "%s", "RESPONSE_OK"); } } // namespace dialogs diff --git a/src/gui/output/xvdisplayer.cpp b/src/gui/output/xvdisplayer.cpp index fe0c37d2f..5799f93dc 100644 --- a/src/gui/output/xvdisplayer.cpp +++ b/src/gui/output/xvdisplayer.cpp @@ -62,7 +62,7 @@ XvDisplayer::XvDisplayer( Gtk::Widget *drawing_area, int width, int height ) : for ( unsigned int n = 0; gotPort == false && n < count; ++n ) { // Diagnostics - INFO(gui, "%s, %d, %d", adaptorInfo[ n ].name, + INFO(gui, "%s, %u, %u", adaptorInfo[ n ].name, adaptorInfo[ n ].base_id, adaptorInfo[ n ].num_ports - 1); for ( unsigned int port = adaptorInfo[ n ].base_id; diff --git a/src/lib/condition.h b/src/lib/condition.h index a2e02cebd..f90d079d8 100644 --- a/src/lib/condition.h +++ b/src/lib/condition.h @@ -52,7 +52,7 @@ ({ \ lumiera_cond_section_.lock = (cnd); \ NOBUG_IF_ALPHA(lumiera_cond_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire condmutex", &lumiera_cond_section_, \ + RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire condmutex", \ NOBUG_RESOURCE_WAITING, lumiera_cond_section_.rh); \ if (pthread_mutex_lock (&(cnd)->cndmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -74,7 +74,7 @@ REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_cond_section_.lock = cnd; \ NOBUG_IF_ALPHA(lumiera_cond_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire condmutex", &lumiera_cond_section_, \ + RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire condmutex", \ NOBUG_RESOURCE_WAITING, lumiera_cond_section_.rh); \ if (pthread_mutex_lock (&(cnd)->cndmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ diff --git a/src/lib/mpool.c b/src/lib/mpool.c index 9d28266cf..f9b3056c6 100644 --- a/src/lib/mpool.c +++ b/src/lib/mpool.c @@ -22,6 +22,7 @@ #include #include #include +#include #include #include "mpool.h" @@ -47,7 +48,7 @@ typedef const mpoolcluster* const_MPoolcluster; struct mpoolcluster_struct { llist node; /* all clusters */ - void* data[]; /* bitmap and elements */ + char data[]; /* bitmap and elements */ }; @@ -116,7 +117,7 @@ bitmap_bit_get_nth (MPoolcluster cluster, unsigned index) uintptr_t quot = index>>MPOOL_DIV_SHIFT; uintptr_t rem = index & ~((~MPOOL_C(0))<data; + uintptr_t* bitmap = (uintptr_t*)&cluster->data; return bitmap[quot] & ((uintptr_t)1<freelist); + TRACE (mpool_dbg, "dtor: cluster %p: obj %p: freelist %p", cluster, obj, &self->freelist); self->destroy (obj); } } @@ -166,7 +167,7 @@ mpool_cluster_alloc_ (MPool self) return NULL; /* clear the bitmap */ - memset (cluster->data, 0, MPOOL_BITMAP_SIZE (self->elements_per_cluster)); + memset (&cluster->data, 0, MPOOL_BITMAP_SIZE (self->elements_per_cluster)); /* initialize freelist */ for (unsigned i = 0; i < self->elements_per_cluster; ++i) @@ -240,7 +241,7 @@ alloc_near (MPoolcluster cluster, MPool self, void* locality) uintptr_t quot = index>>MPOOL_DIV_SHIFT; uintptr_t rem = index & ~((~MPOOL_C(0))<data; + uintptr_t* bitmap = (uintptr_t*)&cluster->data; unsigned r = ~0U; /* the bitmap word at locality */ @@ -276,10 +277,10 @@ bitmap_set_element (MPoolcluster cluster, MPool self, void* element) uintptr_t quot = index>>MPOOL_DIV_SHIFT; uintptr_t rem = index & ~((~MPOOL_C(0))<data; + uintptr_t* bitmap = (uintptr_t*)&cluster->data; bitmap[quot] |= ((uintptr_t)1<>MPOOL_DIV_SHIFT; uintptr_t rem = index & ~((~MPOOL_C(0))<data; + uintptr_t* bitmap = (uintptr_t*)&cluster->data; bitmap[quot] &= ~((uintptr_t)1<>MPOOL_DIV_SHIFT; uintptr_t rem = index & ~((~MPOOL_C(0))<data; + uintptr_t* bitmap = (uintptr_t*)&cluster->data; unsigned r = ~0U; /* the bitmap word at locality */ @@ -492,7 +493,7 @@ nobug_mpool_dump (const_MPool self, if (depth > 2) { - DUMP_LOG (" clusters %p: ", self->clusters); + DUMP_LOG (" clusters %p: ", &self->clusters); int i = 0; LLIST_FOREACH (&self->clusters, cluster) DUMP_LOG (" %p: %u", cluster, ++i); @@ -500,7 +501,7 @@ nobug_mpool_dump (const_MPool self, if (depth > 3) { - DUMP_LOG (" freelist %p: ", self->freelist); + DUMP_LOG (" freelist %p: ", &self->freelist); int i = 0; LLIST_FOREACH (&self->freelist, node) DUMP_LOG (" %p: %u", node, ++i); diff --git a/src/lib/mutex.h b/src/lib/mutex.h index a76707933..cead7dec0 100644 --- a/src/lib/mutex.h +++ b/src/lib/mutex.h @@ -46,7 +46,7 @@ ({ \ lumiera_lock_section_.lock = (mtx); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire mutex", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire mutex", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_mutex_lock (&(mtx)->mutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -76,7 +76,7 @@ REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = mtx; \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire mutex", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire mutex", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_mutex_lock (&(mtx)->mutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ diff --git a/src/lib/reccondition.h b/src/lib/reccondition.h index dcf4e33a4..8ba3479ac 100644 --- a/src/lib/reccondition.h +++ b/src/lib/reccondition.h @@ -50,7 +50,7 @@ ({ \ lumiera_reccond_section_.lock = (cnd); \ NOBUG_IF_ALPHA(lumiera_reccond_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire reccondmutex", &lumiera_reccond_section_, \ + RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire reccondmutex", \ NOBUG_RESOURCE_WAITING, lumiera_reccond_section_.rh); \ if (pthread_mutex_lock (&(cnd)->reccndmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -73,7 +73,7 @@ REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_reccond_section_.lock = (cnd); \ NOBUG_IF_ALPHA(lumiera_reccond_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire reccondmutex", &lumiera_reccond_section_, \ + RESOURCE_ENTER (nobugflag, (cnd)->rh, "acquire reccondmutex", \ NOBUG_RESOURCE_WAITING, lumiera_reccond_section_.rh); \ if (pthread_mutex_lock (&(cnd)->reccndmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ diff --git a/src/lib/recmutex.h b/src/lib/recmutex.h index a893d3bed..ec0cea6e4 100644 --- a/src/lib/recmutex.h +++ b/src/lib/recmutex.h @@ -45,7 +45,7 @@ ({ \ lumiera_lock_section_.lock = (mtx); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire recmutex", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire recmutex", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_mutex_lock (&(mtx)->recmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -67,7 +67,7 @@ REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = (mtx); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire recmutex", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (mtx)->rh, "acquire recmutex", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_mutex_lock (&(mtx)->recmutex)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ diff --git a/src/lib/rwlock.h b/src/lib/rwlock.h index aa0814b37..1e72347cd 100644 --- a/src/lib/rwlock.h +++ b/src/lib/rwlock.h @@ -55,7 +55,7 @@ LUMIERA_ERROR_DECLARE(RWLOCK_WRLOCK); lumiera_lock_section_.lock = (rwlck); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire readlock", \ - &lumiera_lock_section_, NOBUG_RESOURCE_WAITING, \ + NOBUG_RESOURCE_WAITING, \ lumiera_lock_section_.rh); \ if (pthread_rwlock_rdlock (&(rwlck)->rwlock)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -78,7 +78,7 @@ LUMIERA_ERROR_DECLARE(RWLOCK_WRLOCK); REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = (rwlck); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire readlock", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire readlock", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_rwlock_rdlock (&(rwlck)->rwlock)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -106,7 +106,7 @@ LUMIERA_ERROR_DECLARE(RWLOCK_WRLOCK); lumiera_lock_section_.lock = (rwlck); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire writelock", \ - &lumiera_lock_section_, NOBUG_RESOURCE_WAITING, \ + NOBUG_RESOURCE_WAITING, \ lumiera_lock_section_.rh); \ if (pthread_rwlock_wrlock (&(rwlck)->rwlock)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ @@ -128,7 +128,7 @@ LUMIERA_ERROR_DECLARE(RWLOCK_WRLOCK); REQUIRE (lumiera_lock_section_old_->lock, "section prematurely unlocked"); \ lumiera_lock_section_.lock = (rwlck); \ NOBUG_IF_ALPHA(lumiera_lock_section_.flag = &NOBUG_FLAG(nobugflag);) \ - RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire writelock", &lumiera_lock_section_, \ + RESOURCE_ENTER (nobugflag, (rwlck)->rh, "acquire writelock", \ NOBUG_RESOURCE_WAITING, lumiera_lock_section_.rh); \ if (pthread_rwlock_wrlock (&(twlck)->rwlock)) \ LUMIERA_DIE (LOCK_ACQUIRE); \ diff --git a/src/lib/scoped-holder.hpp b/src/lib/scoped-holder.hpp index 0a1a1d3a8..392a36d58 100644 --- a/src/lib/scoped-holder.hpp +++ b/src/lib/scoped-holder.hpp @@ -117,7 +117,7 @@ namespace lib { transfer_control (ScopedPtrHolder& from, ScopedPtrHolder& to) { if (!from) return; - TRACE (test, "transfer_control... from=%x to=%x",&from, &to); + TRACE (test, "transfer_control... from=%p to=%p",&from, &to); must_be_null (to); to.swap(from); } @@ -229,7 +229,7 @@ namespace lib { transfer_control (ScopedHolder& from, ScopedHolder& to) { if (!from) return; - TRACE (test, "transfer_control... from=%x to=%x",&from, &to); + TRACE (test, "transfer_control... from=%p to=%p",&from, &to); must_be_empty (to); to.create(); try diff --git a/src/lib/test/test-helper.hpp b/src/lib/test/test-helper.hpp index 268e15cbf..ef004ec88 100644 --- a/src/lib/test/test-helper.hpp +++ b/src/lib/test/test-helper.hpp @@ -128,7 +128,7 @@ namespace test{ try \ { \ ERRONEOUS_STATEMENT ; \ - NOTREACHED; \ + NOTREACHED(); \ } \ catch (...) \ { \ diff --git a/src/proc/asset.cpp b/src/proc/asset.cpp index 77fe6ace6..3d4b8fc79 100644 --- a/src/proc/asset.cpp +++ b/src/proc/asset.cpp @@ -58,12 +58,12 @@ namespace asset { Asset::Asset (const Ident& idi) : ident(idi), id(AssetManager::reg (this, idi)), enabled(true) { - TRACE (assetmem, "ctor Asset(id=%lu) : adr=%x %s", size_t(id), this, cStr(this->ident) ); + TRACE (assetmem, "ctor Asset(id=%lu) : adr=%p %s", size_t(id), this, cStr(this->ident) ); } Asset::~Asset () { - TRACE (assetmem, "dtor Asset(id=%lu) : adr=%x", size_t(id), this ); + TRACE (assetmem, "dtor Asset(id=%lu) : adr=%p", size_t(id), this ); } diff --git a/src/proc/control/command-registry.hpp b/src/proc/control/command-registry.hpp index 9dd5206a9..93916bba1 100644 --- a/src/proc/control/command-registry.hpp +++ b/src/proc/control/command-registry.hpp @@ -71,7 +71,7 @@ namespace control { */ class CommandRegistry : public lib::Sync<> - , protected TypedAllocationManager + , public TypedAllocationManager { public: diff --git a/src/proc/mobject/placement.cpp b/src/proc/mobject/placement.cpp index 4af940bb4..71a930e2d 100644 --- a/src/proc/mobject/placement.cpp +++ b/src/proc/mobject/placement.cpp @@ -49,7 +49,7 @@ namespace mobject { Placement::operator string () const { - static format fmt("Placement<%s> %|50T.| use-cnt=%x ID(%x) adr=%x pointee=%x"); + static format fmt("Placement<%s> %|50T.| use-cnt=%u ID(%x) adr=%p pointee=%p"); return str(fmt % typeid(*get()).name() % use_count() % (size_t)getID() % this diff --git a/tests/components/proc/asset/asset-diagnostics.hpp b/tests/components/proc/asset/asset-diagnostics.hpp index ef135f560..2ae2a232f 100644 --- a/tests/components/proc/asset/asset-diagnostics.hpp +++ b/tests/components/proc/asset/asset-diagnostics.hpp @@ -59,7 +59,7 @@ namespace asset cout << "Asset(NULL)\n"; else { - format fmt("%s %|50T.| id=%s adr=%x smart-ptr=%x use-count=%d"); + format fmt("%s %|50T.| id=%s adr=%p smart-ptr=%p use-count=%u"); cout << fmt % str(aa) % aa->getID() % aa.get() % &aa % (aa.use_count() - 1) << "\n"; } } diff --git a/tests/components/proc/asset/createassettest.cpp b/tests/components/proc/asset/createassettest.cpp index 70b0fa808..719b7756f 100644 --- a/tests/components/proc/asset/createassettest.cpp +++ b/tests/components/proc/asset/createassettest.cpp @@ -113,13 +113,13 @@ namespace asset try { // can't be found if specifying wrong Asset kind.... aMang.getAsset (ID(mm1->getID())); - NOTREACHED; + NOTREACHED(); } catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_WRONG_ASSET_KIND);} try { // try accessing nonexistant ID aMang.getAsset (ID (1234567890)); - NOTREACHED; + NOTREACHED(); } catch (lumiera::error::Invalid& xxx) {ASSERT (xxx.getID()==LUMIERA_ERROR_UNKNOWN_ASSET_ID);} lumiera_error (); // reset errorflag diff --git a/tests/components/proc/mobject/placement-ref-test.cpp b/tests/components/proc/mobject/placement-ref-test.cpp index 37347f161..9bbe17109 100644 --- a/tests/components/proc/mobject/placement-ref-test.cpp +++ b/tests/components/proc/mobject/placement-ref-test.cpp @@ -154,7 +154,7 @@ namespace test { try { *ref1; - NOTREACHED; + NOTREACHED(); } catch (...) { @@ -170,7 +170,7 @@ namespace test { try { *ref2; - NOTREACHED; + NOTREACHED(); } catch (...) { diff --git a/tests/lib/allocationclustertest.cpp b/tests/lib/allocationclustertest.cpp index 1badb8ac9..6b07775ad 100644 --- a/tests/lib/allocationclustertest.cpp +++ b/tests/lib/allocationclustertest.cpp @@ -176,7 +176,7 @@ namespace lib { ASSERT (&ref2); ASSERT (&ref3); ASSERT (&rX); - TRACE (test, "sizeof( Dummy<1234> ) = %d", sizeof(rX)); + TRACE (test, "sizeof( Dummy<1234> ) = %u", sizeof(rX)); ASSERT (123==ref2.getID()); ASSERT (3+4+5==rX.getID()); diff --git a/tests/lib/meta/config-flags-test.cpp b/tests/lib/meta/config-flags-test.cpp index a7cbcbe13..a0ace5922 100644 --- a/tests/lib/meta/config-flags-test.cpp +++ b/tests/lib/meta/config-flags-test.cpp @@ -315,7 +315,7 @@ namespace test { try { INVOKE_CONFIG_SELECTOR (23); - NOTREACHED ; + NOTREACHED (); } catch (lumiera::error::Invalid& err) { diff --git a/tests/lib/meta/generator-test.cpp b/tests/lib/meta/generator-test.cpp index dc7abbcbe..36a98b7a6 100644 --- a/tests/lib/meta/generator-test.cpp +++ b/tests/lib/meta/generator-test.cpp @@ -135,7 +135,7 @@ namespace test { subInterface.eat (b13); me_can_has_more_numberz.eat(); - INFO (test, "SizeOf = %i", sizeof(me_can_has_more_numberz)); + INFO (test, "SizeOf = %u", sizeof(me_can_has_more_numberz)); } }; diff --git a/tests/lib/scoped-holder-test.cpp b/tests/lib/scoped-holder-test.cpp index 62011d193..918e7416b 100644 --- a/tests/lib/scoped-holder-test.cpp +++ b/tests/lib/scoped-holder-test.cpp @@ -103,10 +103,10 @@ namespace test{ ASSERT (rawP == &(*holder)); ASSERT (rawP->add(-5) == holder->add(-5)); - TRACE (test, "holder at %x", &holder); - TRACE (test, "object at %x", holder.get() ); - TRACE (test, "size(object) = %d", sizeof(*holder)); - TRACE (test, "size(holder) = %d", sizeof(holder)); + TRACE (test, "holder at %p", &holder); + TRACE (test, "object at %p", holder.get() ); + TRACE (test, "size(object) = %u", sizeof(*holder)); + TRACE (test, "size(holder) = %u", sizeof(holder)); } ASSERT (0==checksum); } @@ -124,7 +124,7 @@ namespace test{ try { create_contained_object (holder); - NOTREACHED ; + NOTREACHED (); } catch (int val) { @@ -160,7 +160,7 @@ namespace test{ try { holder2 = holder; - NOTREACHED ; + NOTREACHED (); } catch (lumiera::error::Logic&) { @@ -173,7 +173,7 @@ namespace test{ try { holder = holder2; - NOTREACHED ; + NOTREACHED (); } catch (lumiera::error::Logic&) { @@ -190,7 +190,7 @@ namespace test{ try { holder = holder2; - NOTREACHED ; + NOTREACHED (); } catch (lumiera::error::Logic&) { @@ -203,7 +203,7 @@ namespace test{ try { HO holder3 (holder2); - NOTREACHED ; + NOTREACHED (); } catch (lumiera::error::Logic&) { diff --git a/tests/lib/scopedholdertransfertest.cpp b/tests/lib/scopedholdertransfertest.cpp index 274a4b31f..c47cd2a76 100644 --- a/tests/lib/scopedholdertransfertest.cpp +++ b/tests/lib/scopedholdertransfertest.cpp @@ -52,18 +52,18 @@ namespace lib { public: FixedDummy() { - TRACE (test, "CTOR FixedDummy() --> this=%x val=%d", this, getVal()); + TRACE (test, "CTOR FixedDummy() --> this=%p val=%d", this, getVal()); } ~FixedDummy() { - TRACE (test, "DTOR ~FixedDummy() this=%x val=%d", this, getVal()); + TRACE (test, "DTOR ~FixedDummy() this=%p val=%d", this, getVal()); } friend void transfer_control (FixedDummy& from, FixedDummy& to) { - TRACE (test, "TRANSFER target=%x <-- source=%x (%d,%d)", &to,&from, to.getVal(),from.getVal()); + TRACE (test, "TRANSFER target=%p <-- source=%p (%d,%d)", &to,&from, to.getVal(),from.getVal()); if (throw_in_transfer) throw to.getVal(); @@ -199,7 +199,7 @@ namespace lib { try { create_contained_object (table[3]); - NOTREACHED ; + NOTREACHED (); } catch (int val) { diff --git a/tests/lib/subsystem-runner-test.cpp b/tests/lib/subsystem-runner-test.cpp index 648b32d0c..82e04364a 100644 --- a/tests/lib/subsystem-runner-test.cpp +++ b/tests/lib/subsystem-runner-test.cpp @@ -288,7 +288,7 @@ namespace lumiera { try { runner.maybeRun (unit2); - NOTREACHED; + NOTREACHED(); } catch (lumiera::Error&) { @@ -297,7 +297,7 @@ namespace lumiera { try { runner.maybeRun (unit3); - NOTREACHED; + NOTREACHED(); } catch (lumiera::Error&) { @@ -398,7 +398,7 @@ namespace lumiera { try { runner.maybeRun (unit4); - NOTREACHED; + NOTREACHED(); } catch (lumiera::Error&) { diff --git a/tests/lib/thread-wrapper-join-test.cpp b/tests/lib/thread-wrapper-join-test.cpp index 57793d2ac..e7e80cd08 100644 --- a/tests/lib/thread-wrapper-join-test.cpp +++ b/tests/lib/thread-wrapper-join-test.cpp @@ -97,7 +97,7 @@ namespace backend { try { waitingHandle.join(); // protocol error: handle wasn't passed for starting a Thread; - NOTREACHED; + NOTREACHED(); } catch (lumiera::error::Logic& logo) { lumiera_error(); } @@ -115,7 +115,7 @@ namespace backend { Thread("test Thread joining-3", bind (&ThreadWrapperJoin_test::theAction, this, 333), waitingHandle); // but then pass it again for another thread.... - NOTREACHED; + NOTREACHED(); } catch (...) { diff --git a/tests/lib/vectortransfertest.cpp b/tests/lib/vectortransfertest.cpp index 6254db7aa..f165f2ece 100644 --- a/tests/lib/vectortransfertest.cpp +++ b/tests/lib/vectortransfertest.cpp @@ -46,13 +46,13 @@ namespace lib { public: TransDummy() { - TRACE (test, "CTOR TransDummy() --> this=%x", this); + TRACE (test, "CTOR TransDummy() --> this=%p", this); setVal(0); // we use val_==0 to mark the "empty" state } ~TransDummy() { - TRACE (test, "DTOR ~TransDummy() this=%x", this); + TRACE (test, "DTOR ~TransDummy() this=%p", this); } /* to make Dummy usable within vector, we need to provide @@ -64,14 +64,14 @@ namespace lib { TransDummy (const TransDummy& o) : Dummy() { - TRACE (test, "COPY-ctor TransDummy( ref=%x ) --> this=%x", &o,this); + TRACE (test, "COPY-ctor TransDummy( ref=%p ) --> this=%p", &o,this); ASSERT (!o, "protocol violation: real copy operations inhibited"); } TransDummy& operator= (TransDummy const& ref) { - TRACE (test, "COPY target=%x <-- source=%x", this,&ref); + TRACE (test, "COPY target=%p <-- source=%p", this,&ref); ASSERT (!(*this)); ASSERT (!ref, "protocol violation: real copy operations inhibited"); return *this; @@ -81,7 +81,7 @@ namespace lib { setup (int x=0) { setVal (x? x : (rand() % 10000)); - TRACE (test, "CREATE val=%d ---> this=%x", getVal(),this); + TRACE (test, "CREATE val=%d ---> this=%p", getVal(),this); } @@ -100,7 +100,7 @@ namespace lib { void transfer_control (TransDummy& from, TransDummy& to) { - TRACE (test, "TRANSFER target=%x <-- source=%x", &to,&from); + TRACE (test, "TRANSFER target=%p <-- source=%p", &to,&from); ASSERT (!to, "protocol violation: target already manages another object"); to.setVal (from.getVal()); from.setVal(0); diff --git a/tests/library/test-safeclib.c b/tests/library/test-safeclib.c index a5dfa47a9..8b745928f 100644 --- a/tests/library/test-safeclib.c +++ b/tests/library/test-safeclib.c @@ -27,7 +27,7 @@ TESTS_BEGIN TEST ("allocation0") { lumiera_malloc (0); - NOTREACHED; + NOTREACHED(); } TEST ("allocation1024") @@ -51,7 +51,7 @@ TEST ("allocationtoobig") rl.rlim_max = 100*1024*1024; setrlimit (RLIMIT_AS, &rl); lumiera_malloc (200*1024*1024); - NOTREACHED; + NOTREACHED(); } TEST ("streq") diff --git a/tests/test.sh b/tests/test.sh index ce4ef4dee..89de9ae54 100755 --- a/tests/test.sh +++ b/tests/test.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/usr/bin/env bash # Copyright (C) Lumiera.org # 2007 - 2008, Christian Thaeter # @@ -26,10 +26,11 @@ # stop testing on the first failure export LC_ALL=C -NOBUG_LOGREGEX='^\(\*\*[0-9]*\*\* \)\?[0-9]\{10,\}: \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\|TODO\|PLANNED\|FIXME\|DEPRECATED\|UNIMPLEMENTED\|NOTREACHED\):' +NOBUG_LOGREGEX='^\(\*\*[0-9]*\*\* \)\?[0-9]\{10,\}: \(TRACE\|INFO\|NOTICE\|WARNING\|ERR\|TODO\|PLANNED\|FIXME\|DEPRECATED\|UNIMPLEMENTED\):' arg0="$0" srcdir="$(dirname "$arg0")" +vgsuppression_mangle='/^\(\(==\)\|\(\*\*\)[0-9]*\(==\)\|\(\*\*\)\)\|\(\(\*\*[0-9]*\*\* \)\?[0-9]\{10,\}: ECHO:\)/d;' ulimit -S -t 5 -v 524288 valgrind="" @@ -44,10 +45,10 @@ else if [[ -x ".libs/vgsuppression" ]]; then ./libtool --mode=execute valgrind --leak-check=yes --show-reachable=yes -q --gen-suppressions=all vgsuppression 2>&1 \ - | sed '/^\(==\)\|\(\*\*\)[0-9]*\(==\)\|\(\*\*\)/d;' >vgsuppression.supp + | sed -e "$vgsuppression_mangle" >vgsuppression.supp else valgrind --leak-check=yes --show-reachable=yes -q --gen-suppressions=all ./vgsuppression 2>&1 \ - | sed '/^\(==\)\|\(\*\*\)[0-9]*\(==\)\|\(\*\*\)/d;' >vgsuppression.supp + | sed -e "$vgsuppression_mangle" >vgsuppression.supp fi fi valgrind="$(which valgrind) --leak-check=yes --show-reachable=no --suppressions=vgsuppression.supp -q $VALGRINDFLAGS" @@ -117,6 +118,7 @@ function TEST() rm -f ,send_stdin rm -f ,expect_stdout rm -f ,expect_stderr + expect_return=0 while read -r line; do cmd="${line%%:*}" @@ -125,7 +127,6 @@ function TEST() if [[ ! "$arg" ]]; then arg='^$' fi - expect_return=0 case $cmd in 'in') @@ -180,17 +181,24 @@ function TEST() echo -n >,testtmp - if ! test -x $TESTBIN; then + local CALL + if declare -F | grep $TESTBIN >&/dev/null; then + CALL= + elif test -x $TESTBIN; then + CALL="env $TESTBIN_PREFIX" + else + CALL='-' echo -n >,stdout echo "test binary '$TESTBIN' not found" >,stderr ((fails+=1)) + fi - else + if test "$CALL" != '-'; then if test -f ,send_stdin; then - env $TESTBIN_PREFIX $TESTBIN "$@" <,send_stdin 2>,stderr >,stdout + $CALL $TESTBIN "$@" <,send_stdin 2>,stderr >,stdout else - env $TESTBIN_PREFIX $TESTBIN "$@" 2>,stderr >,stdout + $CALL $TESTBIN "$@" 2>,stderr >,stdout fi &>/dev/null return=$?