From 6b3c7cc36d6ea21b91a6d2beee29ee657f03b0a1 Mon Sep 17 00:00:00 2001 From: Tyler Dauwalder Date: Sun, 21 Jul 2002 19:50:15 +0000 Subject: [PATCH] Fixed dynamic loading problems for remote object tests git-svn-id: file:///srv/svn/repos/haiku/trunk/current@372 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- .../barchivable/InstantiateObjectTester.cpp | 23 ++++++++++--------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/src/tests/kits/support/barchivable/InstantiateObjectTester.cpp b/src/tests/kits/support/barchivable/InstantiateObjectTester.cpp index 865d91e691..6d24b0069b 100644 --- a/src/tests/kits/support/barchivable/InstantiateObjectTester.cpp +++ b/src/tests/kits/support/barchivable/InstantiateObjectTester.cpp @@ -23,6 +23,7 @@ // Project Includes ------------------------------------------------------------ #include +#include // Local Includes -------------------------------------------------------------- #include "remoteobjectdef/RemoteTestObject.h" @@ -41,7 +42,11 @@ const char* gLocalSig = "application/x-vnd.LocalSignature"; const char* gRemoteClassName = "TRemoteTestObject"; const char* gRemoteSig = "application/x-vnd.RemoteObjectDef"; const char* gValidSig = gRemoteSig; - +#if !TEST_R5 +const char* gRemoteLib = "/lib/libsupporttest_RemoteTestObject.so"; +#else +const char* gRemoteLib = "/lib_r5/libsupporttest_RemoteTestObject_r5.so"; +#endif void FormatAndThrow(int line, const char* file, const char* msg, int err); @@ -456,17 +461,13 @@ void TInstantiateObjectTester::LoadAddon() if (fAddonId > 0) return; - BRoster Roster; - entry_ref ref; - status_t err = Roster.FindApp(gRemoteSig, &ref); + // We're not testing the roster, so I'm going to just + // find the add-on manually. + std::string libPath = std::string(BTestShell::GlobalTestDir()) + gRemoteLib; + cout << "dir == '" << libPath << "'" << endl; + fAddonId = load_add_on(libPath.c_str()); - if (err) - { - FORMAT_AND_THROW(" failed to find app: ", err); - } - - BPath Path(&ref); - fAddonId = load_add_on(Path.Path()); + RES(fAddonId); if (fAddonId <= 0) { FORMAT_AND_THROW(" failed to load addon: ", fAddonId);