summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJungYong KIM <jyong2.kim@samsung.com>2019-09-26 15:27:20 +0900
committerJungYong KIM <jyong2.kim@samsung.com>2019-09-26 15:27:20 +0900
commit3cb07924380885e7824f6485287954d1b0e5cf66 (patch)
treed86abcf8db0b209121fb0ddbbacb68205e137aa5
parentb59f69f94c45637693f7451d1301df9ef174d754 (diff)
downloadedge-orchestration-3cb07924380885e7824f6485287954d1b0e5cf66.tar.gz
edge-orchestration-3cb07924380885e7824f6485287954d1b0e5cf66.tar.bz2
edge-orchestration-3cb07924380885e7824f6485287954d1b0e5cf66.zip
Update unittest for d-bus client.
Signed-off-by: JungYong KIM <jyong2.kim@samsung.com>
-rw-r--r--CMain/inc/orchestration_server.h5
-rw-r--r--CMain/unittest/test_orchestration_server.cpp8
2 files changed, 7 insertions, 6 deletions
diff --git a/CMain/inc/orchestration_server.h b/CMain/inc/orchestration_server.h
index 3e2105a..e4397a1 100644
--- a/CMain/inc/orchestration_server.h
+++ b/CMain/inc/orchestration_server.h
@@ -25,7 +25,7 @@ extern "C"
#include <orchestration.h>
-#define DEBUG(format, ...) printLog("[%s:%d] "format, __FILE__, __LINE__, ##__VA_ARGS__);
+#define DEBUG(fmt, ...) printf("[%s:%d] ", __FILE__, __LINE__); printf((fmt), ##__VA_ARGS__);
typedef enum {
/* Errors of Orchestration*/
@@ -46,10 +46,9 @@ typedef int (*request_service_cb)(char* app_name, RequestServiceInfo service_inf
void set_default_dbus_interface(void);
int orchestration_server_initialize(request_service_cb cb);
void orchestration_server_finish(void);
-void printLog(const char *format, ...);
#ifdef __cplusplus
}
#endif
-#endif /* __ORCHESTRATION_SERVER_H__ */ \ No newline at end of file
+#endif /* __ORCHESTRATION_SERVER_H__ */
diff --git a/CMain/unittest/test_orchestration_server.cpp b/CMain/unittest/test_orchestration_server.cpp
index 0a7a8db..44a0846 100644
--- a/CMain/unittest/test_orchestration_server.cpp
+++ b/CMain/unittest/test_orchestration_server.cpp
@@ -24,16 +24,18 @@ extern "C"
#include <gtest/gtest.h>
const char *APP_NAME = "APP_NAME";
-const char *SERVICE_INFO = "SERVICE_INFO";
+const char *EXECUTE_TYPE = "NATIVE";
+const char *EXECUTE_COMMAND = "HELLO-TEST";
GDBusConnection *valid_GDBusConnection;
GDBusNodeInfo *valid_GDBusNodeInfo;
GDBusInterfaceInfo *valid_GDBusinterface;
gboolean requestCbResult;
-int fake_request_cb(char *app_name, char *service_info)
+int fake_request_cb(char* app_name, RequestServiceInfo service_info[], int count)
{
- if (app_name == APP_NAME && service_info == SERVICE_INFO)
+ if (app_name == APP_NAME && count == 1 && service_info[0].ExecutionType == EXECUTE_TYPE &&
+ service_info[0].ExeCmd == EXECUTE_COMMAND)
{
return 1;
}