log: common logging method definition for all testers and helpers

This commit is contained in:
Aleksander Morgado
2020-04-08 17:53:42 +02:00
parent f1e930d574
commit e956bac47b
29 changed files with 80 additions and 558 deletions
@@ -21,7 +21,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-cinterion.h"
@@ -858,27 +858,6 @@ test_ctzu_urc_full (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -22,6 +22,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log-test.h"
#include "mm-log-object.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-huawei.h"
@@ -1248,27 +1249,6 @@ test_hcsq (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
+1 -22
View File
@@ -24,7 +24,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-icera.h"
@@ -175,27 +175,6 @@ test_ipdpaddr (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -21,7 +21,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-linktop.h"
@@ -59,27 +59,6 @@ test_cfun_query_current_modes (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
+1 -22
View File
@@ -24,7 +24,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-mbm.h"
@@ -253,27 +253,6 @@ test_cfun_query_current_modes (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -22,7 +22,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-sierra.h"
@@ -115,27 +115,6 @@ test_scact_read_response_multiple (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -21,7 +21,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-simtech.h"
@@ -317,27 +317,6 @@ test_rxdtmf_urc_one_cr (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -23,7 +23,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-telit.h"
@@ -572,27 +572,6 @@ test_telit_parse_qss_query (void)
/******************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
+1 -22
View File
@@ -23,7 +23,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
/************************************************************/
@@ -64,27 +64,6 @@ test_foxconn_t77w968 (void)
/************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
+1 -22
View File
@@ -25,7 +25,7 @@
#include <libmm-glib.h>
#include "mm-kernel-device-generic-rules.h"
#include "mm-log.h"
#include "mm-log-test.h"
/************************************************************/
@@ -162,27 +162,6 @@ test_fibocom (void)
/************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
@@ -24,7 +24,7 @@
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-thuraya.h"
#include "mm-log.h"
#include "mm-log-test.h"
/*****************************************************************************/
/* Test CPMS response */
@@ -87,27 +87,6 @@ test_cpms_response_thuraya (void *f, gpointer d)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
#define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (GTestFixtureFunc) t, NULL)
int main (int argc, char **argv)
+1 -22
View File
@@ -22,7 +22,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-ublox.h"
@@ -979,27 +979,6 @@ test_ugcntrd_response (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");
+1 -22
View File
@@ -22,7 +22,7 @@
#define _LIBMM_INSIDE_MM
#include <libmm-glib.h>
#include "mm-log.h"
#include "mm-log-test.h"
#include "mm-modem-helpers.h"
#include "mm-modem-helpers-xmm.h"
@@ -754,27 +754,6 @@ test_xlcsslp_queries (void)
/*****************************************************************************/
void
_mm_log (gpointer obj,
const char *loc,
const char *func,
guint32 level,
const char *fmt,
...)
{
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);
}
int main (int argc, char **argv)
{
setlocale (LC_ALL, "");