Fixed dynamic loading problems for remote object tests

git-svn-id: file:///srv/svn/repos/haiku/trunk/current@372 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Tyler Dauwalder 2002-07-21 19:50:15 +00:00
parent 3ff18ff146
commit 6b3c7cc36d

View File

@ -23,6 +23,7 @@
// Project Includes ------------------------------------------------------------ // Project Includes ------------------------------------------------------------
#include <cppunit/Exception.h> #include <cppunit/Exception.h>
#include <TestShell.h>
// Local Includes -------------------------------------------------------------- // Local Includes --------------------------------------------------------------
#include "remoteobjectdef/RemoteTestObject.h" #include "remoteobjectdef/RemoteTestObject.h"
@ -41,7 +42,11 @@ const char* gLocalSig = "application/x-vnd.LocalSignature";
const char* gRemoteClassName = "TRemoteTestObject"; const char* gRemoteClassName = "TRemoteTestObject";
const char* gRemoteSig = "application/x-vnd.RemoteObjectDef"; const char* gRemoteSig = "application/x-vnd.RemoteObjectDef";
const char* gValidSig = gRemoteSig; 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); void FormatAndThrow(int line, const char* file, const char* msg, int err);
@ -456,17 +461,13 @@ void TInstantiateObjectTester::LoadAddon()
if (fAddonId > 0) if (fAddonId > 0)
return; return;
BRoster Roster; // We're not testing the roster, so I'm going to just
entry_ref ref; // find the add-on manually.
status_t err = Roster.FindApp(gRemoteSig, &ref); std::string libPath = std::string(BTestShell::GlobalTestDir()) + gRemoteLib;
cout << "dir == '" << libPath << "'" << endl;
fAddonId = load_add_on(libPath.c_str());
if (err) RES(fAddonId);
{
FORMAT_AND_THROW(" failed to find app: ", err);
}
BPath Path(&ref);
fAddonId = load_add_on(Path.Path());
if (fAddonId <= 0) if (fAddonId <= 0)
{ {
FORMAT_AND_THROW(" failed to load addon: ", fAddonId); FORMAT_AND_THROW(" failed to load addon: ", fAddonId);