summaryrefslogtreecommitdiff
path: root/cpp/src/tests/Shlib.cpp
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2009-12-26 12:42:57 +0000
committerRafael H. Schloming <rhs@apache.org>2009-12-26 12:42:57 +0000
commit248f1fe188fe2307b9dcf2c87a83b653eaa1920c (patch)
treed5d0959a70218946ff72e107a6c106e32479a398 /cpp/src/tests/Shlib.cpp
parent3c83a0e3ec7cf4dc23e83a340b25f5fc1676f937 (diff)
downloadqpid-python-248f1fe188fe2307b9dcf2c87a83b653eaa1920c.tar.gz
synchronized with trunk except for ruby dir
git-svn-id: https://svn.apache.org/repos/asf/qpid/branches/qpid.rnr@893970 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/tests/Shlib.cpp')
-rw-r--r--cpp/src/tests/Shlib.cpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/cpp/src/tests/Shlib.cpp b/cpp/src/tests/Shlib.cpp
index 426a052c9f..692cfcdff9 100644
--- a/cpp/src/tests/Shlib.cpp
+++ b/cpp/src/tests/Shlib.cpp
@@ -24,13 +24,23 @@
#include "unit_test.h"
+namespace qpid {
+namespace tests {
+
QPID_AUTO_TEST_SUITE(ShlibTestSuite)
using namespace qpid::sys;
typedef void (*CallMe)(int*);
+
QPID_AUTO_TEST_CASE(testShlib) {
+ // The CMake-based build passes in the module suffix; if it's not there,
+ // this is a Linux/UNIX libtool-based build.
+#if defined (QPID_MODULE_PREFIX) && defined (QPID_MODULE_SUFFIX)
+ Shlib sh("./" QPID_MODULE_PREFIX "shlibtest" QPID_MODULE_SUFFIX);
+#else
Shlib sh(".libs/libshlibtest.so");
+#endif
// Double cast to avoid ISO warning.
CallMe callMe=sh.getSymbol<CallMe>("callMe");
BOOST_REQUIRE(callMe != 0);
@@ -44,17 +54,23 @@ QPID_AUTO_TEST_CASE(testShlib) {
}
catch (const qpid::Exception&) {}
}
-
+
QPID_AUTO_TEST_CASE(testAutoShlib) {
int unloaded = 0;
{
+#if defined (QPID_MODULE_PREFIX) && defined (QPID_MODULE_SUFFIX)
+ AutoShlib sh("./" QPID_MODULE_PREFIX "shlibtest" QPID_MODULE_SUFFIX);
+#else
AutoShlib sh(".libs/libshlibtest.so");
+#endif
CallMe callMe=sh.getSymbol<CallMe>("callMe");
BOOST_REQUIRE(callMe != 0);
callMe(&unloaded);
}
BOOST_CHECK_EQUAL(42, unloaded);
}
-
+
QPID_AUTO_TEST_SUITE_END()
+
+}} // namespace qpid::tests