diff options
Diffstat (limited to 'src/tests')
-rw-r--r-- | src/tests/test-modem-helpers.c | 26 | ||||
-rw-r--r-- | src/tests/test-qcdm-serial-port.c | 11 |
2 files changed, 31 insertions, 6 deletions
diff --git a/src/tests/test-modem-helpers.c b/src/tests/test-modem-helpers.c index f0cbe61c..946916ff 100644 --- a/src/tests/test-modem-helpers.c +++ b/src/tests/test-modem-helpers.c @@ -17,6 +17,7 @@ #include <string.h> #include "mm-modem-helpers.h" +#include "mm-log.h" typedef struct { GPtrArray *solicited_creg; @@ -722,6 +723,16 @@ test_cgreg2_x220_unsolicited (void *f, gpointer d) } static void +test_creg2_s8500_wave_unsolicited (void *f, gpointer d) +{ + TestData *data = (TestData *) d; + const char *reply = "\r\n+CREG: 2,1,000B,2816, B, C2816\r\n"; + const CregResult result = { 1, 0x000B, 0x2816, 0, 7, FALSE}; + + test_creg_match ("Samsung Wave S8500 CREG=2", FALSE, reply, data, &result); +} + +static void test_cscs_icon225_support_response (void *f, gpointer d) { const char *reply = "\r\n+CSCS: (\"IRA\",\"GSM\",\"UCS2\")\r\n"; @@ -1069,8 +1080,7 @@ test_devid_item (void *f, gpointer d) item->gsn, item->revision, item->model, - item->manf, - FALSE); + item->manf); g_assert (devid); if (strcmp (devid, item->devid)) g_message ("%s", devid); @@ -1107,7 +1117,7 @@ test_cind_results (const char *desc, compare = g_hash_table_lookup (results, expected->desc); g_assert (compare); - g_assert_cmpint (i, ==, cind_response_get_index (compare)); + g_assert_cmpint (i + 1, ==, cind_response_get_index (compare)); g_assert_cmpint (expected->min, ==, cind_response_get_min (compare)); g_assert_cmpint (expected->max, ==, cind_response_get_max (compare)); } @@ -1168,6 +1178,15 @@ test_data_free (TestData *data) g_free (data); } +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) +{ + /* Dummy log function */ +} #if GLIB_CHECK_VERSION(2,25,12) typedef GTestFixtureFunc TCFunc; @@ -1231,6 +1250,7 @@ int main (int argc, char **argv) g_test_suite_add (suite, TESTCASE (test_creg2_tm506_solicited, data)); g_test_suite_add (suite, TESTCASE (test_creg2_xu870_unsolicited_unregistered, data)); g_test_suite_add (suite, TESTCASE (test_creg2_md400_unsolicited, data)); + g_test_suite_add (suite, TESTCASE (test_creg2_s8500_wave_unsolicited, data)); g_test_suite_add (suite, TESTCASE (test_cgreg1_solicited, data)); g_test_suite_add (suite, TESTCASE (test_cgreg1_unsolicited, data)); diff --git a/src/tests/test-qcdm-serial-port.c b/src/tests/test-qcdm-serial-port.c index ab737c5e..3aeed6ab 100644 --- a/src/tests/test-qcdm-serial-port.c +++ b/src/tests/test-qcdm-serial-port.c @@ -31,6 +31,7 @@ #include "libqcdm/src/commands.h" #include "libqcdm/src/utils.h" #include "libqcdm/src/com.h" +#include "mm-log.h" typedef struct { int master; @@ -449,10 +450,14 @@ typedef void (*TCFunc)(void); #define TESTCASE(t, d) g_test_create_case (#t, 0, d, NULL, (TCFunc) t, NULL) #define TESTCASE_PTY(t, d) g_test_create_case (#t, sizeof (*d), d, (TCFunc) test_pty_create, (TCFunc) t, (TCFunc) test_pty_cleanup) -gboolean mm_options_debug (void); -gboolean mm_options_debug (void) +void +_mm_log (const char *loc, + const char *func, + guint32 level, + const char *fmt, + ...) { - return g_test_verbose (); + /* Dummy log function */ } int main (int argc, char **argv) |