From 9a4a17d5a7175c3b7738afe1efbbaeebb71109cb Mon Sep 17 00:00:00 2001 From: Francesco Chemolli Date: Mon, 24 Sep 2012 05:10:23 -0600 Subject: [PATCH] Make IPC base path absolute in testRock --- src/tests/testRock.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/tests/testRock.cc b/src/tests/testRock.cc index c64f9167ec..34b1ff112d 100644 --- a/src/tests/testRock.cc +++ b/src/tests/testRock.cc @@ -17,6 +17,9 @@ #if HAVE_STDEXCEPT #include #endif +#if HAVE_UNISTD_H +#include +#endif #define TESTDIR "testRock__testRockSearch" @@ -24,6 +27,8 @@ CPPUNIT_TEST_SUITE_REGISTRATION( testRock ); extern REMOVALPOLICYCREATE createRemovalPolicy_lru; +static char cwd[MAXPATHLEN]; + static void addSwapDir(testRock::SwapDirPointer aStore) { @@ -41,7 +46,9 @@ testRock::setUp() throw std::runtime_error("Failed to clean test work directory"); // use current directory for shared segments (on path-based OSes) - Ipc::Mem::Segment::BasePath = "."; + Ipc::Mem::Segment::BasePath = getcwd(cwd,MAXPATHLEN); + if (Ipc::Mem::Segment::BasePath == NULL) + Ipc::Mem::Segment::BasePath = "."; Store::Root(new StoreController); -- 2.47.2