From cfc166a98f2c5a8e9dc72080b1fc5f693969dc94 Mon Sep 17 00:00:00 2001 From: Sung-Jin Park Date: Tue, 1 Sep 2020 21:17:36 +0900 Subject: [PATCH] tests: set default XDG_RUNTIME_DIR to /tmp Change-Id: Id447afec35ddbf83f4d09ec57a040ac9e6a2fcbe Signed-off-by: Sung-Jin Park --- tests/DSBufferManager-test.cpp | 17 ++++++++------- tests/DSBufferRef-test.cpp | 18 ++++++++-------- tests/DSBufferTBMImpl-test.cpp | 17 ++++++++------- tests/DSCanvas-test.cpp | 13 ++++++++---- tests/DSClient-test.cpp | 17 ++++++++------- tests/DSCompositor-test.cpp | 17 ++++++++------- tests/DSDebugLog-test.cpp | 13 ++++++++---- tests/DSDisplayArea-test.cpp | 17 ++++++++------- tests/DSDisplayDeviceTDMImpl-test.cpp | 18 ++++++++-------- tests/DSEventLoop-test.cpp | 13 ++++++++---- tests/DSInput-test.cpp | 13 ++++++++---- tests/DSKeyboard-test.cpp | 17 ++++++++------- tests/DSObject-test.cpp | 13 ++++++++---- tests/DSOutputImpl-test.cpp | 13 ++++++++---- tests/DSPointer-test.cpp | 17 ++++++++------- tests/DSPolicyArea-test.cpp | 13 ++++++++---- tests/DSProperty-test.cpp | 13 ++++++++---- tests/DSRefBase-test.cpp | 13 ++++++++---- tests/DSRenderEngineDaliImpl-test.cpp | 3 ++- tests/DSRenderEngineEcoreEvasImpl-test.cpp | 13 ++++++++---- tests/DSSeat-test.cpp | 17 ++++++++------- tests/DSSignal-test.cpp | 13 ++++++++---- tests/DSSignalBroker-test.cpp | 15 ++++++++----- tests/DSTextInput-test.cpp | 17 ++++++++------- tests/DSTizenAppinfo-test.cpp | 17 ++++++++------- tests/DSTouch-test.cpp | 17 ++++++++------- tests/DSTraceInfo-test.cpp | 17 ++++++++------- tests/DSWaylandBuffer-test.cpp | 13 ++++++++---- tests/DSWaylandCallback-test.cpp | 9 ++++++-- tests/DSWaylandClient-test.cpp | 17 ++++++++------- tests/DSWaylandCompositor-test.cpp | 17 ++++++++------- tests/DSWaylandExtension-test.cpp | 13 ++++++++---- tests/DSWaylandInputMethod-test.cpp | 3 ++- tests/DSWaylandInputMethodContext-test.cpp | 17 ++++++++------- tests/DSWaylandInputPanel-test.cpp | 17 ++++++++------- tests/DSWaylandInputPanelSurface-test.cpp | 17 ++++++++------- tests/DSWaylandKeyboard-test.cpp | 3 ++- tests/DSWaylandOutput-test.cpp | 13 ++++++++---- tests/DSWaylandPointer-test.cpp | 17 ++++++++------- tests/DSWaylandProtocolTrace-test.cpp | 28 ++++++++++++------------- tests/DSWaylandSeat-test.cpp | 17 ++++++++------- tests/DSWaylandSurface-test.cpp | 17 ++++++++------- tests/DSWaylandTextInput-test.cpp | 17 ++++++++------- tests/DSWaylandTextInputManager-test.cpp | 17 ++++++++------- tests/DSWaylandTizenAppinfo-test.cpp | 13 ++++++++---- tests/DSWaylandTizenIndicator-test.cpp | 13 ++++++++---- tests/DSWaylandTizenInputDevice-test.cpp | 13 ++++++++---- tests/DSWaylandTizenInputDeviceManager-test.cpp | 13 ++++++++---- tests/DSWaylandTizenLaunchEffect-test.cpp | 15 ++++++++----- tests/DSWaylandTizenPolicy-test.cpp | 13 ++++++++---- tests/DSWaylandTizenPolicyExt-test.cpp | 9 ++++++-- tests/DSWaylandTizenSurface-test.cpp | 13 ++++++++---- tests/DSWaylandTizenSurfaceShm-test.cpp | 13 ++++++++---- tests/DSWaylandTouch-test.cpp | 17 ++++++++------- tests/DSWaylandZxdgShellV6-test.cpp | 9 ++++++-- tests/DSWindow-test.cpp | 13 ++++++++---- tests/DSWindowManager-test.cpp | 15 +++++++------ tests/DSWindowShell-test.cpp | 13 ++++++++---- tests/DSXkb-test.cpp | 13 ++++++++---- tests/DSZone-test.cpp | 13 ++++++++---- tests/libds-tests.cpp | 1 + 61 files changed, 521 insertions(+), 341 deletions(-) diff --git a/tests/DSBufferManager-test.cpp b/tests/DSBufferManager-test.cpp index e21c556..9f6a1d2 100644 --- a/tests/DSBufferManager-test.cpp +++ b/tests/DSBufferManager-test.cpp @@ -32,14 +32,15 @@ using namespace display_server; class DSBufferManagerTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSBufferManagerTest, GetBufferManager) diff --git a/tests/DSBufferRef-test.cpp b/tests/DSBufferRef-test.cpp index 55a7c85..fa99f39 100644 --- a/tests/DSBufferRef-test.cpp +++ b/tests/DSBufferRef-test.cpp @@ -31,15 +31,15 @@ using namespace display_server; class DSBufferRefTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSBufferRefTest, CreateBufferRef) diff --git a/tests/DSBufferTBMImpl-test.cpp b/tests/DSBufferTBMImpl-test.cpp index 6f801e6..fac2480 100644 --- a/tests/DSBufferTBMImpl-test.cpp +++ b/tests/DSBufferTBMImpl-test.cpp @@ -31,14 +31,15 @@ using namespace display_server; class DSBufferTBMImplTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSBufferTBMImplTest, CreateBuffer) diff --git a/tests/DSCanvas-test.cpp b/tests/DSCanvas-test.cpp index 022e74d..a81a83e 100644 --- a/tests/DSCanvas-test.cpp +++ b/tests/DSCanvas-test.cpp @@ -33,10 +33,15 @@ using namespace display_server; class DSCanvasTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSCanvasTest, NewDSCanvas) diff --git a/tests/DSClient-test.cpp b/tests/DSClient-test.cpp index 4c16109..0896cc8 100644 --- a/tests/DSClient-test.cpp +++ b/tests/DSClient-test.cpp @@ -35,14 +35,15 @@ using namespace display_server; class DSClientTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSClientTest, NewDSClientWithDSWaylandClient) diff --git a/tests/DSCompositor-test.cpp b/tests/DSCompositor-test.cpp index 135920c..8de9fae 100644 --- a/tests/DSCompositor-test.cpp +++ b/tests/DSCompositor-test.cpp @@ -30,15 +30,16 @@ using namespace display_server; class DSCompositorTest : public ::testing::Test { public: - void SetUp(void) override - { + void SetUp(void) override + { // for wl_display_add_socket(private_loop->wl_display, "tdm-socket") at tdm_server_init - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; class MockCompositor : public DSCompositor diff --git a/tests/DSDebugLog-test.cpp b/tests/DSDebugLog-test.cpp index 78322b4..179a620 100644 --- a/tests/DSDebugLog-test.cpp +++ b/tests/DSDebugLog-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSDebugLogTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSDebugLogTest, GetInstance) diff --git a/tests/DSDisplayArea-test.cpp b/tests/DSDisplayArea-test.cpp index ac22be6..3fb3af7 100644 --- a/tests/DSDisplayArea-test.cpp +++ b/tests/DSDisplayArea-test.cpp @@ -33,15 +33,16 @@ using namespace display_server; class DSDisplayAreaTest : public ::testing::Test { public: - void SetUp(void) override - { + void SetUp(void) override + { // for wl_display_add_socket(private_loop->wl_display, "tdm-socket") at tdm_server_init - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSDisplayAreaTest, NewDSDisplayArea) diff --git a/tests/DSDisplayDeviceTDMImpl-test.cpp b/tests/DSDisplayDeviceTDMImpl-test.cpp index b23e6bd..dfc8e94 100644 --- a/tests/DSDisplayDeviceTDMImpl-test.cpp +++ b/tests/DSDisplayDeviceTDMImpl-test.cpp @@ -31,15 +31,15 @@ using namespace display_server; class DSDisplayDeviceTDMImplTest : public ::testing::Test { public: - void SetUp(void) override - { - // for wl_display_add_socket(private_loop->wl_display, "tdm-socket") at tdm_server_init - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; // DSDisplayDeviceTDMImpl diff --git a/tests/DSEventLoop-test.cpp b/tests/DSEventLoop-test.cpp index 5621af0..40915e5 100644 --- a/tests/DSEventLoop-test.cpp +++ b/tests/DSEventLoop-test.cpp @@ -30,10 +30,15 @@ using namespace display_server; class DSEventLoopTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSEventLoopTest, NewDSEventLoop) diff --git a/tests/DSInput-test.cpp b/tests/DSInput-test.cpp index 0109988..3090b30 100644 --- a/tests/DSInput-test.cpp +++ b/tests/DSInput-test.cpp @@ -31,10 +31,15 @@ using namespace display_server; class DSInputTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; class MockInput : public DSObject diff --git a/tests/DSKeyboard-test.cpp b/tests/DSKeyboard-test.cpp index 3c724b0..94aa630 100644 --- a/tests/DSKeyboard-test.cpp +++ b/tests/DSKeyboard-test.cpp @@ -34,14 +34,15 @@ using namespace display_server; class DSKeyboardTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSKeyboardTest, NewDSKeyboardWithDSSeat) diff --git a/tests/DSObject-test.cpp b/tests/DSObject-test.cpp index 065a96f..48e3465 100644 --- a/tests/DSObject-test.cpp +++ b/tests/DSObject-test.cpp @@ -30,10 +30,15 @@ using namespace display_server; class DSObjectTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Temporary classes for implemting PImpl Idiom based on DSObject/DSObjectPrivate classes */ diff --git a/tests/DSOutputImpl-test.cpp b/tests/DSOutputImpl-test.cpp index 044264b..9f2d9df 100644 --- a/tests/DSOutputImpl-test.cpp +++ b/tests/DSOutputImpl-test.cpp @@ -32,10 +32,15 @@ using namespace display_server; class DSOutputTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSOutputTest, NewDSOutput) diff --git a/tests/DSPointer-test.cpp b/tests/DSPointer-test.cpp index f0cf678..d482d8a 100644 --- a/tests/DSPointer-test.cpp +++ b/tests/DSPointer-test.cpp @@ -34,14 +34,15 @@ using namespace display_server; class DSPointerTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSPointerTest, NewDSPointerWithDSSeat) diff --git a/tests/DSPolicyArea-test.cpp b/tests/DSPolicyArea-test.cpp index cc106ff..af945c9 100644 --- a/tests/DSPolicyArea-test.cpp +++ b/tests/DSPolicyArea-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSPolicyAreaTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSPolicyAreaTest, NewDSPolicyArea) diff --git a/tests/DSProperty-test.cpp b/tests/DSProperty-test.cpp index caaa2ca..85ae4f1 100644 --- a/tests/DSProperty-test.cpp +++ b/tests/DSProperty-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSPropertyTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSPropertyTest, CreateProperty) diff --git a/tests/DSRefBase-test.cpp b/tests/DSRefBase-test.cpp index 26952be..f5198e9 100644 --- a/tests/DSRefBase-test.cpp +++ b/tests/DSRefBase-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSRefBaseTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSRefBaseTest, CreateRefBase) diff --git a/tests/DSRenderEngineDaliImpl-test.cpp b/tests/DSRenderEngineDaliImpl-test.cpp index f3e6143..d794532 100644 --- a/tests/DSRenderEngineDaliImpl-test.cpp +++ b/tests/DSRenderEngineDaliImpl-test.cpp @@ -59,7 +59,8 @@ public: __eventLoop->run(); - setenv("XDG_RUNTIME_DIR", "/run", 1); + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); setenv("TBM_DISPLAY_SERVER", "1", 1); } void TearDown(void) override diff --git a/tests/DSRenderEngineEcoreEvasImpl-test.cpp b/tests/DSRenderEngineEcoreEvasImpl-test.cpp index ff917fd..4b93a28 100644 --- a/tests/DSRenderEngineEcoreEvasImpl-test.cpp +++ b/tests/DSRenderEngineEcoreEvasImpl-test.cpp @@ -31,10 +31,15 @@ using namespace display_server; class DSRenderEngineEcoreEvasTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSRenderEngineEcoreEvasTest, RenderEngine_Create) diff --git a/tests/DSSeat-test.cpp b/tests/DSSeat-test.cpp index 03a4190..e20da03 100644 --- a/tests/DSSeat-test.cpp +++ b/tests/DSSeat-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSSeatTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; class MockCompositor : public DSCompositor diff --git a/tests/DSSignal-test.cpp b/tests/DSSignal-test.cpp index b37fe21..02db211 100644 --- a/tests/DSSignal-test.cpp +++ b/tests/DSSignal-test.cpp @@ -30,10 +30,15 @@ using namespace display_server; class DSSignalTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; class SenderMock : public DSObject diff --git a/tests/DSSignalBroker-test.cpp b/tests/DSSignalBroker-test.cpp index 4484885..644cc27 100644 --- a/tests/DSSignalBroker-test.cpp +++ b/tests/DSSignalBroker-test.cpp @@ -192,10 +192,15 @@ public: class DSSignalBrokerTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; std::shared_ptr __receiver; @@ -284,4 +289,4 @@ TEST_F(DSSignalBrokerTest, emitMultiItems) // 4. see Changes EXPECT_TRUE(receiver->result3 == "Test"); -} \ No newline at end of file +} diff --git a/tests/DSTextInput-test.cpp b/tests/DSTextInput-test.cpp index 721f0f3..55ba75d 100644 --- a/tests/DSTextInput-test.cpp +++ b/tests/DSTextInput-test.cpp @@ -29,14 +29,15 @@ using namespace display_server; class DSTextInputTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSTizenAppinfo-test.cpp b/tests/DSTizenAppinfo-test.cpp index b893611..2b2b7bc 100644 --- a/tests/DSTizenAppinfo-test.cpp +++ b/tests/DSTizenAppinfo-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSTizenAppinfoTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSTizenAppinfoTest, NewTizenAppinfo) diff --git a/tests/DSTouch-test.cpp b/tests/DSTouch-test.cpp index 870cedf..ec62871 100644 --- a/tests/DSTouch-test.cpp +++ b/tests/DSTouch-test.cpp @@ -34,14 +34,15 @@ using namespace display_server; class DSTouchTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSTouchTest, NewDSTouchWithDSSeat) diff --git a/tests/DSTraceInfo-test.cpp b/tests/DSTraceInfo-test.cpp index e382c2e..5d99ebb 100644 --- a/tests/DSTraceInfo-test.cpp +++ b/tests/DSTraceInfo-test.cpp @@ -29,14 +29,15 @@ using namespace display_server; class DSTraceInfoTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSTraceInfoTest, NewTraceInfo) diff --git a/tests/DSWaylandBuffer-test.cpp b/tests/DSWaylandBuffer-test.cpp index 850bc52..e0e2fcd 100644 --- a/tests/DSWaylandBuffer-test.cpp +++ b/tests/DSWaylandBuffer-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandBufferTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandBufferTest, NewDSWaylandBuffer) diff --git a/tests/DSWaylandCallback-test.cpp b/tests/DSWaylandCallback-test.cpp index d44a541..9c7a0e3 100644 --- a/tests/DSWaylandCallback-test.cpp +++ b/tests/DSWaylandCallback-test.cpp @@ -30,9 +30,14 @@ class DSWaylandCallbackTest : public ::testing::Test { public: void SetUp(void) override - {} + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } void TearDown(void) override - {} + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandCallbackTest, NewDSWaylandCallback) diff --git a/tests/DSWaylandClient-test.cpp b/tests/DSWaylandClient-test.cpp index 7c6625a..e08707f 100644 --- a/tests/DSWaylandClient-test.cpp +++ b/tests/DSWaylandClient-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSWaylandClientTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandCompositor-test.cpp b/tests/DSWaylandCompositor-test.cpp index 7d0a735..c2bf133 100644 --- a/tests/DSWaylandCompositor-test.cpp +++ b/tests/DSWaylandCompositor-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSWaylandCompositorTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandExtension-test.cpp b/tests/DSWaylandExtension-test.cpp index c73aa79..eb9388e 100644 --- a/tests/DSWaylandExtension-test.cpp +++ b/tests/DSWaylandExtension-test.cpp @@ -31,10 +31,15 @@ using namespace display_server; class DSWaylandExtensionTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandExtensionTest, NewWaylandExtension) diff --git a/tests/DSWaylandInputMethod-test.cpp b/tests/DSWaylandInputMethod-test.cpp index 152b953..98aeae4 100644 --- a/tests/DSWaylandInputMethod-test.cpp +++ b/tests/DSWaylandInputMethod-test.cpp @@ -31,7 +31,8 @@ class DSWaylandInputMethodTest : public ::testing::Test public: void SetUp(void) override { - setenv("XDG_RUNTIME_DIR", "/run", 1); + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); } void TearDown(void) override { diff --git a/tests/DSWaylandInputMethodContext-test.cpp b/tests/DSWaylandInputMethodContext-test.cpp index 6b2808e..ec2d51b 100644 --- a/tests/DSWaylandInputMethodContext-test.cpp +++ b/tests/DSWaylandInputMethodContext-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSWaylandInputMethodContextTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandInputPanel-test.cpp b/tests/DSWaylandInputPanel-test.cpp index 04d72a2..b367486 100644 --- a/tests/DSWaylandInputPanel-test.cpp +++ b/tests/DSWaylandInputPanel-test.cpp @@ -29,14 +29,15 @@ using namespace display_server; class DSWaylandInputPanelTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandInputPanelSurface-test.cpp b/tests/DSWaylandInputPanelSurface-test.cpp index c6ee3e1..3de9fa2 100644 --- a/tests/DSWaylandInputPanelSurface-test.cpp +++ b/tests/DSWaylandInputPanelSurface-test.cpp @@ -29,14 +29,15 @@ using namespace display_server; class DSWaylandInputPanelSurfaceTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandKeyboard-test.cpp b/tests/DSWaylandKeyboard-test.cpp index 2cac0bf..4146bcf 100644 --- a/tests/DSWaylandKeyboard-test.cpp +++ b/tests/DSWaylandKeyboard-test.cpp @@ -33,7 +33,8 @@ class DSWaylandKeyboardTest : public ::testing::Test public: void SetUp(void) override { - setenv("XDG_RUNTIME_DIR", "/run", 1); + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); } void TearDown(void) override { diff --git a/tests/DSWaylandOutput-test.cpp b/tests/DSWaylandOutput-test.cpp index 9794705..0009b60 100644 --- a/tests/DSWaylandOutput-test.cpp +++ b/tests/DSWaylandOutput-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandOutputTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandOutputTest, NewDSWaylandOutput) diff --git a/tests/DSWaylandPointer-test.cpp b/tests/DSWaylandPointer-test.cpp index 119b16b..05cf9c0 100644 --- a/tests/DSWaylandPointer-test.cpp +++ b/tests/DSWaylandPointer-test.cpp @@ -31,14 +31,15 @@ using namespace display_server; class DSWaylandPointerTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandProtocolTrace-test.cpp b/tests/DSWaylandProtocolTrace-test.cpp index a7d3b6f..c5451ce 100644 --- a/tests/DSWaylandProtocolTrace-test.cpp +++ b/tests/DSWaylandProtocolTrace-test.cpp @@ -29,19 +29,19 @@ using namespace display_server; class DSWaylandProtocolTraceTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - setenv("E_INFO_RULE_FILE", "/tmp/rule", 1); - setenv("E_INFO_TRACE_FILE", "/tmp/trace", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - unsetenv("E_INFO_RULE_FILE"); - unsetenv("E_INFO_TRACE_FILE"); - } - + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + setenv("E_INFO_RULE_FILE", "/tmp/rule", 1); + setenv("E_INFO_TRACE_FILE", "/tmp/trace", 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + unsetenv("E_INFO_RULE_FILE"); + unsetenv("E_INFO_TRACE_FILE"); + } }; TEST_F(DSWaylandProtocolTraceTest, NewDSWaylandProtocolTrace) @@ -146,4 +146,4 @@ TEST_F(DSWaylandProtocolTraceTest, DSWaylandProtocolTraceEnableTraceTrue) EXPECT_TRUE(pTrace->enableProtocolTrace(trace_state) == 1); DSWaylandProtocolTrace::releaseInstance(); } -} \ No newline at end of file +} diff --git a/tests/DSWaylandSeat-test.cpp b/tests/DSWaylandSeat-test.cpp index 8d2f000..06f67b7 100644 --- a/tests/DSWaylandSeat-test.cpp +++ b/tests/DSWaylandSeat-test.cpp @@ -32,14 +32,15 @@ using namespace display_server; class DSWaylandSeatTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandSurface-test.cpp b/tests/DSWaylandSurface-test.cpp index a83794b..a83d794 100644 --- a/tests/DSWaylandSurface-test.cpp +++ b/tests/DSWaylandSurface-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSWaylandSurfaceTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; static void diff --git a/tests/DSWaylandTextInput-test.cpp b/tests/DSWaylandTextInput-test.cpp index 5a3e18e..4dd5414 100644 --- a/tests/DSWaylandTextInput-test.cpp +++ b/tests/DSWaylandTextInput-test.cpp @@ -30,14 +30,15 @@ using namespace display_server; class DSWaylandTextInputTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandTextInputManager-test.cpp b/tests/DSWaylandTextInputManager-test.cpp index abca02b..03e34dd 100644 --- a/tests/DSWaylandTextInputManager-test.cpp +++ b/tests/DSWaylandTextInputManager-test.cpp @@ -29,14 +29,15 @@ using namespace display_server; class DSWaylandTextInputManagerTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandTizenAppinfo-test.cpp b/tests/DSWaylandTizenAppinfo-test.cpp index 212700d..8589a32 100644 --- a/tests/DSWaylandTizenAppinfo-test.cpp +++ b/tests/DSWaylandTizenAppinfo-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenAppinfoTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenAppinfoTest, New_Appinfo) diff --git a/tests/DSWaylandTizenIndicator-test.cpp b/tests/DSWaylandTizenIndicator-test.cpp index 50df9de..2f3c4eb 100644 --- a/tests/DSWaylandTizenIndicator-test.cpp +++ b/tests/DSWaylandTizenIndicator-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenIndicatorTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenIndicatorTest, NewDSWaylandTizenIndicator) diff --git a/tests/DSWaylandTizenInputDevice-test.cpp b/tests/DSWaylandTizenInputDevice-test.cpp index 5ebd223..8ca5d0a 100644 --- a/tests/DSWaylandTizenInputDevice-test.cpp +++ b/tests/DSWaylandTizenInputDevice-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenInputDeviceTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenInputDeviceTest, NewDSWaylandTizenInputDevice) diff --git a/tests/DSWaylandTizenInputDeviceManager-test.cpp b/tests/DSWaylandTizenInputDeviceManager-test.cpp index aa437c7..09836aa 100644 --- a/tests/DSWaylandTizenInputDeviceManager-test.cpp +++ b/tests/DSWaylandTizenInputDeviceManager-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenInputDeviceManagerTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenInputDeviceManagerTest, NewDSWaylandTizenInputDeviceManager) diff --git a/tests/DSWaylandTizenLaunchEffect-test.cpp b/tests/DSWaylandTizenLaunchEffect-test.cpp index 6a1eecd..14ed80a 100644 --- a/tests/DSWaylandTizenLaunchEffect-test.cpp +++ b/tests/DSWaylandTizenLaunchEffect-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenLaunchEffectTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenLaunchEffectTest, New_LaunchEffect) @@ -61,4 +66,4 @@ TEST_F(DSWaylandTizenLaunchEffectTest, Initialize_LaunchEffect) delete tzLaunchEffect; DSWaylandCompositor::releaseInstance(); -} \ No newline at end of file +} diff --git a/tests/DSWaylandTizenPolicy-test.cpp b/tests/DSWaylandTizenPolicy-test.cpp index 81e5839..27ab7df 100644 --- a/tests/DSWaylandTizenPolicy-test.cpp +++ b/tests/DSWaylandTizenPolicy-test.cpp @@ -30,10 +30,15 @@ using namespace display_server; class DSWaylandTizenPolicyTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenPolicyTest, new_P1) diff --git a/tests/DSWaylandTizenPolicyExt-test.cpp b/tests/DSWaylandTizenPolicyExt-test.cpp index f5868e3..0f27e06 100644 --- a/tests/DSWaylandTizenPolicyExt-test.cpp +++ b/tests/DSWaylandTizenPolicyExt-test.cpp @@ -30,9 +30,14 @@ class DSWaylandTizenPolicyExtTest : public ::testing::Test { public: void SetUp(void) override - {} + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } void TearDown(void) override - {} + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenPolicyExtTest, NewDSWaylandTizenPolicyExt) diff --git a/tests/DSWaylandTizenSurface-test.cpp b/tests/DSWaylandTizenSurface-test.cpp index b4d04c7..ec979e4 100644 --- a/tests/DSWaylandTizenSurface-test.cpp +++ b/tests/DSWaylandTizenSurface-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenSurfaceTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenSurfaceTest, NewDSWaylandTizenSurface) diff --git a/tests/DSWaylandTizenSurfaceShm-test.cpp b/tests/DSWaylandTizenSurfaceShm-test.cpp index 6471826..4579b4c 100644 --- a/tests/DSWaylandTizenSurfaceShm-test.cpp +++ b/tests/DSWaylandTizenSurfaceShm-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSWaylandTizenSurfaceShmTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandTizenSurfaceShmTest, NewDSWaylandTizenSurfaceShm) diff --git a/tests/DSWaylandTouch-test.cpp b/tests/DSWaylandTouch-test.cpp index 60a2c46..a7c8a14 100644 --- a/tests/DSWaylandTouch-test.cpp +++ b/tests/DSWaylandTouch-test.cpp @@ -31,14 +31,15 @@ using namespace display_server; class DSWaylandTouchTest : public ::testing::Test { public: - void SetUp(void) override - { - setenv("XDG_RUNTIME_DIR", "/run", 1); - } - void TearDown(void) override - { - unsetenv("XDG_RUNTIME_DIR"); - } + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; /* Test cases */ diff --git a/tests/DSWaylandZxdgShellV6-test.cpp b/tests/DSWaylandZxdgShellV6-test.cpp index aae14f2..593bbc0 100644 --- a/tests/DSWaylandZxdgShellV6-test.cpp +++ b/tests/DSWaylandZxdgShellV6-test.cpp @@ -30,9 +30,14 @@ class DSWaylandZxdgShellV6Test : public ::testing::Test { public: void SetUp(void) override - {} + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } void TearDown(void) override - {} + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWaylandZxdgShellV6Test, NewDSWaylandZxdgShellV6) diff --git a/tests/DSWindow-test.cpp b/tests/DSWindow-test.cpp index 1ac52c9..d0f7695 100644 --- a/tests/DSWindow-test.cpp +++ b/tests/DSWindow-test.cpp @@ -32,10 +32,15 @@ using namespace display_server; class DSWindowTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWindowTest, NewDSWindow) diff --git a/tests/DSWindowManager-test.cpp b/tests/DSWindowManager-test.cpp index 319d418..cc3de04 100644 --- a/tests/DSWindowManager-test.cpp +++ b/tests/DSWindowManager-test.cpp @@ -36,15 +36,18 @@ DSWindowManager* g_winMgr = nullptr; class DSWindowManagerTest : public ::testing::Test { public: - void SetUp(void) override - { + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); g_winMgr = DSWindowManager::getInstance(); - } - void TearDown(void) override - { + } + void TearDown(void) override + { DSWindowManager::releaseInstance(); g_winMgr = nullptr; - } + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWindowManagerTest, GetWindowManager) diff --git a/tests/DSWindowShell-test.cpp b/tests/DSWindowShell-test.cpp index 43ce069..bb5b3a7 100644 --- a/tests/DSWindowShell-test.cpp +++ b/tests/DSWindowShell-test.cpp @@ -34,10 +34,15 @@ using namespace display_server; class DSWindowShellTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSWindowShellTest, NewDSWindowShell) diff --git a/tests/DSXkb-test.cpp b/tests/DSXkb-test.cpp index c57d66a..b28c036 100644 --- a/tests/DSXkb-test.cpp +++ b/tests/DSXkb-test.cpp @@ -29,10 +29,15 @@ using namespace display_server; class DSXkbTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; TEST_F(DSXkbTest, NewDSXkb) diff --git a/tests/DSZone-test.cpp b/tests/DSZone-test.cpp index 83a685b..7e69b18 100644 --- a/tests/DSZone-test.cpp +++ b/tests/DSZone-test.cpp @@ -33,10 +33,15 @@ using namespace display_server; class DSZoneTest : public ::testing::Test { public: - void SetUp(void) override - {} - void TearDown(void) override - {} + void SetUp(void) override + { + char *xdir = getenv("DEFAULT_XDG_RUNTIME_DIR"); + setenv("XDG_RUNTIME_DIR", xdir, 1); + } + void TearDown(void) override + { + unsetenv("XDG_RUNTIME_DIR"); + } }; class TestZone : public DSObject diff --git a/tests/libds-tests.cpp b/tests/libds-tests.cpp index 4a9ed5a..6446522 100644 --- a/tests/libds-tests.cpp +++ b/tests/libds-tests.cpp @@ -32,6 +32,7 @@ int main(int argc, char **argv) #ifdef TIZEN_TEST_GCOV setenv("GCOV_PREFIX", "/tmp", 1); #endif + setenv("DEFAULT_XDG_RUNTIME_DIR", "/tmp", 1); try { ::testing::InitGoogleMock(&argc, argv); -- 2.7.4