Cleanup the test code 73/114073/1
authorMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 10 Feb 2017 02:08:39 +0000 (11:08 +0900)
committerMu-Woong Lee <muwoong.lee@samsung.com>
Fri, 10 Feb 2017 02:08:39 +0000 (11:08 +0900)
Change-Id: If98b88f8531192bfe34e3835ad713935c24ec8ba
Signed-off-by: Mu-Woong Lee <muwoong.lee@samsung.com>
include/ContextStore.h [moved from include/TestAPI.h with 91% similarity]
src/client-dummy/ContextStore.cpp [moved from src/client-dummy/TestAPI.cpp with 96% similarity]
src/client/ContextStore.cpp [moved from src/client/TestAPI.cpp with 93% similarity]
src/server/ContextStoreClientProxy.cpp

similarity index 91%
rename from include/TestAPI.h
rename to include/ContextStore.h
index 66b9257..e68578a 100644 (file)
@@ -14,8 +14,8 @@
  * limitations under the License.
  */
 
-#ifndef __CONTEXT_STORE_TEST_API_H__
-#define __CONTEXT_STORE_TEST_API_H__
+#ifndef __CONTEXT_STORE_H__
+#define __CONTEXT_STORE_H__
 
 #include <ContextStoreTypes.h>
 
@@ -24,6 +24,7 @@ extern "C"
 {
 #endif
 
+/* TEST CODE */
 int context_store_test();
 
 #ifdef __cplusplus
similarity index 96%
rename from src/client-dummy/TestAPI.cpp
rename to src/client-dummy/ContextStore.cpp
index cc3040d..c526a34 100644 (file)
@@ -15,7 +15,7 @@
  */
 
 #include <ContextStoreTypesPrivate.h>
-#include <TestAPI.h>
+#include <ContextStore.h>
 
 using namespace ctx;
 
similarity index 93%
rename from src/client/TestAPI.cpp
rename to src/client/ContextStore.cpp
index cf90d18..97f42ab 100644 (file)
@@ -16,7 +16,7 @@
 
 #include <ContextStoreTypesPrivate.h>
 #include <DBusClient.h>
-#include <TestAPI.h>
+#include <ContextStore.h>
 
 using namespace ctx;
 
@@ -32,5 +32,8 @@ EXPORT_API int context_store_test()
 
        _I(YELLOW("Return: %d (%s)"), err, CTX_ERROR_STR(err));
 
+       if (output)
+               g_variant_unref(output);
+
        return err;
 }
index bf86158..d4ea4b1 100644 (file)
@@ -31,12 +31,7 @@ ContextStoreClientProxy::~ContextStoreClientProxy()
 
 void ContextStoreClientProxy::onMethodCalled(MethodCall* methodCall)
 {
-       /* TODO: Remove this test code */
-       char* param = g_variant_print(methodCall->getParam(), FALSE);
-       _I("Caller: %s, Method: %s", methodCall->getSender()->getBusName().c_str(), methodCall->getMethodName().c_str());
-       _I("Parameters: %s", param);
-       g_free(param);
-       methodCall->reply(E_FAILED);
+       // 'methodCall' should be deleted.
        delete methodCall;
 }