Fix build when using gcov and gtests build flags 52/237652/1
authorNishant Chaprana <n.chaprana@samsung.com>
Thu, 2 Jul 2020 06:44:59 +0000 (12:14 +0530)
committerNishant Chaprana <n.chaprana@samsung.com>
Thu, 2 Jul 2020 06:44:59 +0000 (12:14 +0530)
[   75s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/firewall.cpp: In member function 'error_e Firewall::GetLock(int*)':
[   75s] /usr/include/dlog/dlog-internal.h:72:31: error: format '%d' expects argument of type 'int', but argument 8 has type 'int*' [-Werror=format=]
[   75s]    72 |   __dlog_print(id, prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__); \
[   75s] /usr/include/dlog/dlog-internal.h:166:27: note: in expansion of macro 'LOG_'
[   75s]   166 | #define LOGD(format, ...) LOG_(LOG_ID_MAIN, DLOG_DEBUG, LOG_TAG, format, ##__VA_ARGS__)
[   75s]       |                           ^~~~
[   75s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/stcmgr.h:30:32: note: in expansion of macro 'LOGD'
[   75s]    30 | #define GLOGD(format, args...) LOGD(format, ##args)
[   75s]       |                                ^~~~
[   75s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/firewall.cpp:484:2: note: in expansion of macro 'GLOGD'
[   75s]   484 |  GLOGD("Succeeded to get lock state[%d]", state);
[   75s]       |  ^~~~~
[   75s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/firewall.cpp:484:38: note: format string is defined here
[   75s]   484 |  GLOGD("Succeeded to get lock state[%d]", state);
[   75s]       |                                     ~^
[   75s]       |                                      |
[   75s]       |                                      int
[   75s]       |                                     %n

[   78s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/statistics.cpp: In member function 'error_e Statistics::ResetStatistics()':
[   78s] /usr/include/dlog/dlog-internal.h:72:31: error: too many arguments for format [-Werror=format-extra-args]
[   78s]    72 |   __dlog_print(id, prio, tag, "%s: %s(%d) > " fmt, __MODULE__, __func__, __LINE__, ##__VA_ARGS__); \
[   78s] /usr/include/dlog/dlog-internal.h:166:27: note: in expansion of macro 'LOG_'
[   78s]   166 | #define LOGD(format, ...) LOG_(LOG_ID_MAIN, DLOG_DEBUG, LOG_TAG, format, ##__VA_ARGS__)
[   78s]       |                           ^~~~
[   78s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/stcmgr.h:30:32: note: in expansion of macro 'LOGD'
[   78s]    30 | #define GLOGD(format, args...) LOGD(format, ##args)
[   78s]       |                                ^~~~
[   78s] /home/abuild/rpmbuild/BUILD/stc-manager-0.1.2/unittest/statistics.cpp:292:2: note: in expansion of macro 'GLOGD'
[   78s]   292 |  GLOGD("Succeeded to reset statistics", result);
[   78s]       |  ^~~~~

Change-Id: I5a23d18e3e8b3d510cacac834506ec22fa2bd193
Signed-off-by: Nishant Chaprana <n.chaprana@samsung.com>
packaging/stc-manager.spec
unittest/firewall.cpp
unittest/statistics.cpp

index 2f2b56c80ee11d1a63b5f17b8fe68b55b00c389a..cff6b7816299b59b2a6b46568f2b479d0e96262d 100644 (file)
@@ -1,6 +1,6 @@
 Name:       stc-manager
 Summary:    STC(Smart Traffic Control) manager
-Version:    0.1.2
+Version:    0.1.3
 Release:    0
 Group:      Network & Connectivity/Other
 License:    Apache-2.0
index 44bcfe50a4c06b6bac88805413347412f42d2961..0cf9521c7e17cff52baf28dee9d28d3e584c6805 100644 (file)
@@ -480,8 +480,8 @@ error_e Firewall::GetLock(int *state)
                return error;
        }
 
-       g_variant_get(message, "(i)", &state);
-       GLOGD("Succeeded to get lock state[%d]", state);
+       g_variant_get(message, "(i)", state);
+       GLOGD("Succeeded to get lock state[%d]", *state);
        g_variant_unref(message);
 
        return ERROR_NONE;
index 7c816cc56ba1ec6fd729359107085be309378c3d..6c80db1149232269583357c22e6241d955728e87 100644 (file)
@@ -289,7 +289,7 @@ error_e Statistics::ResetStatistics(void)
        }
 
        g_variant_get(message, "(i)", &result);
-       GLOGD("Succeeded to reset statistics", result);
+       GLOGD("Succeeded to reset statistics [%d]", result);
        g_variant_unref(message);
 
        return ERROR_NONE;