From: Michal Bloch Date: Mon, 21 Jan 2019 11:59:13 +0000 (+0100) Subject: [UTC/ITC][dlog][Non-ACR][Fix incorrect va_list use] X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=aa0758c84abc5a10f60df68f4f86efe7dc1216c6;p=test%2Ftct%2Fnative%2Fapi.git [UTC/ITC][dlog][Non-ACR][Fix incorrect va_list use] Change-Id: I121d7f27c90b00d39e79c9357cb8c68823d601e5 Signed-off-by: Michal Bloch --- diff --git a/src/itc/dlog/ITs-dlog.c b/src/itc/dlog/ITs-dlog.c index 5a10e2fff..9001f819f 100755 --- a/src/itc/dlog/ITs-dlog.c +++ b/src/itc/dlog/ITs-dlog.c @@ -99,6 +99,17 @@ int ITc_dlog_dlog_print_p(void) return 0; } +static int dlog_vprint_wrap_va_list(log_priority pri, const char *tag, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + + int ret = dlog_vprint(pri, tag, fmt, ap); + + va_end(ap); + return ret; +} + /** * @testcase ITc_dlog_dlog_vprint_p * @since_tizen 2.3 @@ -120,7 +131,6 @@ int ITc_dlog_dlog_vprint_p(void) { START_TEST; int nRetVal = -1; - va_list vList = {0}; log_priority earrPriority[MAXENUMSIZE] = {0}; int nTotalEnums = 0; int nEnumCount = 0; @@ -129,7 +139,7 @@ int ITc_dlog_dlog_vprint_p(void) for ( nEnumCount = 0; nEnumCount < nTotalEnums; nEnumCount++ ) { // Target API - nRetVal = dlog_vprint(earrPriority[nEnumCount], "DLOG_TEST", "[Dlog_ITC] Dlog Test Message\n", vList); + nRetVal = dlog_vprint_wrap_va_list(earrPriority[nEnumCount], "DLOG_TEST", "[Dlog_ITC] Dlog Test Message\n"); if ( nRetVal < 0 ) { FPRINTF("[Line : %d][%s] dlog_vprint failed for Enumerator %s\\n", __LINE__, API_NAMESPACE, DlogGetPriorityListValue(earrPriority, &nEnumCount, GETENUM)); diff --git a/src/utc/dlog/utc-SystemFW-dlog-vprint-func.c b/src/utc/dlog/utc-SystemFW-dlog-vprint-func.c index 69f01aa79..c262630f0 100755 --- a/src/utc/dlog/utc-SystemFW-dlog-vprint-func.c +++ b/src/utc/dlog/utc-SystemFW-dlog-vprint-func.c @@ -21,6 +21,17 @@ #define LOG_BUF_SIZE 1024 +static int dlog_vprint_wrap_va_list(log_priority pri, const char *tag, const char *fmt, ...) +{ + va_list ap; + va_start(ap, fmt); + + int ret = dlog_vprint(pri, tag, fmt, ap); + + va_end(ap); + return ret; +} + /** * @testcase utc_SystemFW_dlog_vprint_p * @since_tizen 2.3 @@ -30,9 +41,8 @@ int utc_SystemFW_dlog_vprint_p(void) { int ret = 0; char buf[LOG_BUF_SIZE] = "dlog test message for tct-mgr\n"; - va_list ap; - ret = dlog_vprint(DLOG_INFO, "DLOG_TEST", buf, ap); + ret = dlog_vprint_wrap_va_list(DLOG_INFO, "DLOG_TEST", buf); assert_gt(ret, 0); @@ -47,9 +57,8 @@ int utc_SystemFW_dlog_vprint_p(void) int utc_SystemFW_dlog_vprint_n(void) { int ret = 0; - va_list ap; - ret = dlog_vprint(-1, NULL, NULL, ap); + ret = dlog_vprint_wrap_va_list(-1, NULL, NULL); assert_lt(ret, 1);