tests: print MM logs only on verbose test mode

Therefore, avoid needing ENABLE_TEST_MESSAGE_TRACES build symbol.
This commit is contained in:
Aleksander Morgado
2019-10-14 15:09:28 +02:00
parent 03223fe786
commit d5d0ed0b24
20 changed files with 60 additions and 76 deletions

View File

@@ -865,17 +865,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -391,7 +391,6 @@ test_prefmode (void)
g_assert (combinations != NULL);
g_assert_cmpuint (combinations->len, ==, n_expected_combinations);
#if defined ENABLE_TEST_MESSAGE_TRACES
for (j = 0; j < combinations->len; j++) {
MMHuaweiPrefmodeCombination *single;
gchar *allowed_str;
@@ -409,7 +408,6 @@ test_prefmode (void)
g_free (allowed_str);
g_free (preferred_str);
}
#endif
for (j = 0; j < combinations->len; j++) {
MMHuaweiPrefmodeCombination *single;
@@ -629,7 +627,6 @@ test_syscfg (void)
g_assert (combinations != NULL);
g_assert_cmpuint (combinations->len, ==, n_expected_combinations);
#if defined ENABLE_TEST_MESSAGE_TRACES
for (j = 0; j < combinations->len; j++) {
MMHuaweiSyscfgCombination *single;
gchar *allowed_str;
@@ -648,7 +645,6 @@ test_syscfg (void)
g_free (allowed_str);
g_free (preferred_str);
}
#endif
for (j = 0; j < combinations->len; j++) {
MMHuaweiSyscfgCombination *single;
@@ -898,7 +894,6 @@ test_syscfgex (void)
g_assert (combinations != NULL);
g_assert_cmpuint (combinations->len, ==, n_expected_combinations);
#if defined ENABLE_TEST_MESSAGE_TRACES
for (j = 0; j < combinations->len; j++) {
MMHuaweiSyscfgexCombination *single;
gchar *allowed_str;
@@ -916,7 +911,6 @@ test_syscfgex (void)
g_free (allowed_str);
g_free (preferred_str);
}
#endif
for (j = 0; j < combinations->len; j++) {
MMHuaweiSyscfgexCombination *single;
@@ -1280,17 +1274,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -182,17 +182,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -25,8 +25,6 @@
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-linktop.h"
/* #define ENABLE_TEST_MESSAGE_TRACES */
/*****************************************************************************/
typedef struct {
@@ -68,17 +66,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -28,8 +28,6 @@
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-mbm.h"
#define ENABLE_TEST_MESSAGE_TRACES
/*****************************************************************************/
/* Test *E2IPCFG responses */
@@ -262,17 +260,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -122,17 +122,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -553,17 +553,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -57,17 +57,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -22,9 +22,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
/* Define symbol to enable test message traces */
#undef ENABLE_TEST_MESSAGE_TRACES
#include "mm-kernel-device-generic-rules.h"
#include "mm-log.h"
@@ -133,17 +130,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -92,17 +92,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL)

View File

@@ -986,17 +986,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -760,17 +760,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -71,17 +71,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -411,17 +411,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -316,17 +316,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -4425,17 +4425,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL)

View File

@@ -444,17 +444,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
typedef void (*TCFunc) (TestData *, gconstpointer);

View File

@@ -847,17 +847,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -511,17 +511,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)

View File

@@ -22,9 +22,6 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
/* Define symbol to enable test message traces */
#undef ENABLE_TEST_MESSAGE_TRACES
#include "mm-kernel-device-generic-rules.h"
#include "mm-log.h"
@@ -53,17 +50,17 @@ _mm_log (const char *loc,
const char *fmt,
...)
{
#if defined ENABLE_TEST_MESSAGE_TRACES
/* Dummy log function */
va_list args;
gchar *msg;
if (!g_test_verbose ())
return;
va_start (args, fmt);
msg = g_strdup_vprintf (fmt, args);
va_end (args);
g_print ("%s\n", msg);
g_free (msg);
#endif
}
int main (int argc, char **argv)