summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-08-06 01:16:11 -0500
committerDan Williams <dcbw@redhat.com>2010-08-06 01:16:11 -0500
commita96e53368dfabf20f1bc3b8aecba2a64d60e198b (patch)
tree19d737917eb5eedcae73bc652692274a22c77be8
parentdbbac27f1ef518fca0b7aefe9c73cace82c3a5a4 (diff)
downloadModemManager-a96e53368dfabf20f1bc3b8aecba2a64d60e198b.tar.gz
tests: handle random failures of some tests more gracefully
Not all devices support everything; a Huawei EC168C fails to read the mode preference, and a Pantech PX-500 fails to read the roam preference NV item.
-rw-r--r--libqcdm/tests/test-qcdm-com.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/libqcdm/tests/test-qcdm-com.c b/libqcdm/tests/test-qcdm-com.c
index 98a5ec323..bba32ac47 100644
--- a/libqcdm/tests/test-qcdm-com.c
+++ b/libqcdm/tests/test-qcdm-com.c
@@ -442,6 +442,9 @@ test_com_read_roam_pref (void *f, void *data)
/* Parse the response into a result structure */
result = qcdm_cmd_nv_get_roam_pref_result (buf, reply_len, &error);
+ if (error && (error->code == QCDM_COMMAND_NVCMD_FAILED))
+ return;
+
g_assert (result);
g_print ("\n");
@@ -493,7 +496,9 @@ test_com_read_mode_pref (void *f, void *data)
/* Parse the response into a result structure */
result = qcdm_cmd_nv_get_mode_pref_result (buf, reply_len, &error);
if (!result) {
- g_assert_error (error, QCDM_COMMAND_ERROR, QCDM_COMMAND_NVCMD_FAILED);
+ g_assert (error);
+ g_assert (error->domain == QCDM_COMMAND_ERROR);
+ g_assert (error->code == QCDM_COMMAND_NVCMD_FAILED || error->code == QCDM_COMMAND_BAD_PARAMETER);
return;
}