From: JungYong KIM Date: Thu, 26 Sep 2019 06:27:20 +0000 (+0900) Subject: Update unittest for d-bus client. X-Git-Tag: accepted/tizen/unified/20190927.064456~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3cb07924380885e7824f6485287954d1b0e5cf66;p=platform%2Fcore%2Fsystem%2Fedge-orchestration.git Update unittest for d-bus client. Signed-off-by: JungYong KIM --- 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 -#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 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; }