From: Gilbok Lee Date: Wed, 4 Dec 2019 09:25:50 +0000 (+0900) Subject: Add coverage exception macros X-Git-Tag: accepted/tizen/6.0/unified/20201030.122238~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F32%2F219332%2F2;p=platform%2Fcore%2Fapi%2Fmediamuxer.git Add coverage exception macros [Version] 0.1.22 [Issue Type] Line coverage Change-Id: I253400585dc7fad32a3f1bd81199d11e5896581e --- diff --git a/include/mediamuxer_util.h b/include/mediamuxer_util.h index 71fcd4e..5a2f399 100644 --- a/include/mediamuxer_util.h +++ b/include/mediamuxer_util.h @@ -22,27 +22,23 @@ #include #include #include +#include +#include #ifdef __cplusplus extern "C" { #endif -/* #define PRINT_ON_CONSOLE */ -#ifdef PRINT_ON_CONSOLE -#include -#include -#define PRINT_F g_print -#define MX_FENTER(); PRINT_F("function:[%s] ENTER\n", __func__); -#define MX_FLEAVE(); PRINT_F("function [%s] LEAVE\n", __func__); -#define MX_C PRINT_F -#define MX_E PRINT_F -#define MX_W PRINT_F -#define MX_I PRINT_F -#define MX_L PRINT_F -#define MX_V PRINT_F +#ifdef TIZEN_EXCLUDE_COVERAGE +#define MX_FENTER() +#define MX_FLEAVE() +#define MX_C(fmt, arg...) +#define MX_E(fmt, arg...) +#define MX_W(fmt, arg...) +#define MX_I(fmt, arg...) +#define MX_L(fmt, arg...) +#define MX_V(fmt, arg...) #else -#include -#include #define MX_FENTER(); LOGI("function:[%s] ENTER", __func__); #define MX_FLEAVE(); LOGI("function [%s] LEAVE", __func__); #define MX_C LOGE /* MMF_DEBUG_LEVEL_0 */ @@ -63,11 +59,11 @@ extern "C" { } while (0) #if 1 -#define MEDIAMUXER_FENTER(); MX_FENTER(); -#define MEDIAMUXER_FLEAVE(); MX_FLEAVE(); +#define MEDIAMUXER_FENTER() MX_FENTER() +#define MEDIAMUXER_FLEAVE() MX_FLEAVE() #else -#define MEDIAMUXER_FENTER(); -#define MEDIAMUXER_FLEAVE(); +#define MEDIAMUXER_FENTER() +#define MEDIAMUXER_FLEAVE() #endif #define MEDIAMUXER_CHECK_NULL(x_var) \ diff --git a/packaging/capi-mediamuxer.spec b/packaging/capi-mediamuxer.spec index b29bdbd..3c7b9fc 100644 --- a/packaging/capi-mediamuxer.spec +++ b/packaging/capi-mediamuxer.spec @@ -1,6 +1,6 @@ Name: capi-mediamuxer Summary: A Media Muxer library in Tizen Native API -Version: 0.1.21 +Version: 0.1.22 Release: 1 Group: Multimedia/API License: Apache-2.0 @@ -54,9 +54,9 @@ export CFLAGS="$CFLAGS -DENABLE_FFMPEG_CODEC" export CFLAGS="$CFLAGS -DSYSCONFDIR=\\\"%{_sysconfdir}\\\" " %if 0%{?gcov:1} -export CFLAGS+=" -fprofile-arcs -ftest-coverage" -export CXXFLAGS+=" -fprofile-arcs -ftest-coverage" -export FFLAGS+=" -fprofile-arcs -ftest-coverage" +export CFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage" +export CXXFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage" +export FFLAGS+=" -DTIZEN_EXCLUDE_COVERAGE -fprofile-arcs -ftest-coverage" export LDFLAGS+=" -lgcov" %endif diff --git a/src/mediamuxer.c b/src/mediamuxer.c index 44f2315..61a2187 100644 --- a/src/mediamuxer.c +++ b/src/mediamuxer.c @@ -428,7 +428,7 @@ int mediamuxer_unset_error_cb(mediamuxer_h muxer) MX_I("mediamuxer_unset_error_cb"); return MEDIAMUXER_ERROR_NONE; } - +//LCOV_EXCL_START static gboolean _mediamuxer_error_cb(mediamuxer_error_e error, void *user_data) { if (user_data == NULL) { @@ -444,7 +444,7 @@ static gboolean _mediamuxer_error_cb(mediamuxer_error_e error, void *user_data) return 0; } - +//LCOV_EXCL_STOP static gboolean _mediamuxer_eos_cb(void *user_data) { if (user_data == NULL) { diff --git a/src/port_custom/mediamuxer_port_custom.c b/src/port_custom/mediamuxer_port_custom.c index 3bd4a46..22a12ec 100644 --- a/src/port_custom/mediamuxer_port_custom.c +++ b/src/port_custom/mediamuxer_port_custom.c @@ -20,6 +20,7 @@ #include #include +//LCOV_EXCL_START static int custom_muxer_init(MMHandleType *pHandle); static int custom_muxer_set_data_sink(MMHandleType pHandle, char *uri, mediamuxer_output_format_e format); @@ -64,3 +65,4 @@ static int custom_muxer_set_data_sink(MMHandleType pHandle, char *uri, MEDIAMUXER_FLEAVE(); return 0; } +//LCOV_EXCL_STOP \ No newline at end of file diff --git a/src/port_ffmpeg/mediamuxer_port_ffmpeg.c b/src/port_ffmpeg/mediamuxer_port_ffmpeg.c index 004cffa..03cfb67 100644 --- a/src/port_ffmpeg/mediamuxer_port_ffmpeg.c +++ b/src/port_ffmpeg/mediamuxer_port_ffmpeg.c @@ -20,6 +20,7 @@ #include #include +//LCOV_EXCL_START static int ffmpeg_muxer_init(MMHandleType *pHandle); static int ffmpeg_muxer_set_data_sink(MMHandleType pHandle, char *uri, mediamuxer_output_format_e format); @@ -65,3 +66,4 @@ static int ffmpeg_muxer_set_data_sink(MMHandleType pHandle, char *uri, MEDIAMUXER_FLEAVE(); return ret; } +//LCOV_EXCL_STOP \ No newline at end of file diff --git a/src/port_gst/mediamuxer_port_gst.c b/src/port_gst/mediamuxer_port_gst.c index 1568d15..74c3f98 100644 --- a/src/port_gst/mediamuxer_port_gst.c +++ b/src/port_gst/mediamuxer_port_gst.c @@ -28,7 +28,7 @@ #define MEDIA_FORMAT_IS_PCM(format) ((format & MEDIA_FORMAT_PCM) == MEDIA_FORMAT_PCM) - +//LCOV_EXCL_START static int gst_muxer_init(MMHandleType *pHandle); static int gst_muxer_set_data_sink(MMHandleType pHandle, char *uri, mediamuxer_output_format_e format); @@ -1386,7 +1386,10 @@ static int gst_muxer_close_track(MMHandleType pHandle, int track_index) break; if (!current || current->track_index != track_index) { - (!current) ? MX_E("Current is Null") : MX_E("Mismatched between track index[%d]", track_index); + if (!current) + MX_E("Current is Null"); + else + MX_E("Mismatched between track index[%d]", track_index); goto ERROR; } @@ -1673,3 +1676,4 @@ static void __set_codec_data(mx_gst_track *track, media_packet_h pkt) gst_caps_unref(new_appsrc_caps); } } +//LCOV_EXCL_STOP \ No newline at end of file