aboutsummaryrefslogtreecommitdiff
path: root/libqcdm/tests
diff options
context:
space:
mode:
authorDan Williams <dcbw@redhat.com>2010-09-01 10:51:22 -0500
committerDan Williams <dcbw@redhat.com>2010-09-01 10:51:22 -0500
commitf3024b46b495ea81563d712059ca6fc0c40ea7c8 (patch)
tree350dc19e1d612561106c2d38f1ba4478a2f72920 /libqcdm/tests
parent48aabcb60be8aed9822de373c14df01fead62ee3 (diff)
qcdm: add event reporting on/off command
Doesn't parse any events yet since we don't know what any events are. We also need to fix up ModemManager to handle unsolicited responses in the QcdmSerialPort class.
Diffstat (limited to 'libqcdm/tests')
-rw-r--r--libqcdm/tests/test-qcdm-com.c43
-rw-r--r--libqcdm/tests/test-qcdm-com.h2
-rw-r--r--libqcdm/tests/test-qcdm.c1
3 files changed, 46 insertions, 0 deletions
diff --git a/libqcdm/tests/test-qcdm-com.c b/libqcdm/tests/test-qcdm-com.c
index bf4a513e..8e6113bd 100644
--- a/libqcdm/tests/test-qcdm-com.c
+++ b/libqcdm/tests/test-qcdm-com.c
@@ -1254,6 +1254,49 @@ test_com_ext_logmask (void *f, void *data)
}
void
+test_com_event_report (void *f, void *data)
+{
+ TestComData *d = data;
+ gboolean success;
+ GError *error = NULL;
+ char buf[520];
+ gint len;
+ QCDMResult *result;
+ gsize reply_len;
+
+ /* Turn event reporting on */
+ len = qcdm_cmd_event_report_new (buf, sizeof (buf), TRUE, NULL);
+
+ /* Send the command */
+ success = send_command (d, buf, len);
+ g_assert (success);
+
+ /* Get a response */
+ reply_len = wait_reply (d, buf, sizeof (buf));
+
+ g_print ("\n");
+
+ /* Parse the response into a result structure */
+ result = qcdm_cmd_event_report_result (buf, reply_len, &error);
+ g_assert (result);
+
+ qcdm_result_unref (result);
+
+ /* Wait for an event */
+ reply_len = wait_reply (d, buf, sizeof (buf));
+
+ /* Turn event reporting off */
+ len = qcdm_cmd_event_report_new (buf, sizeof (buf), FALSE, NULL);
+
+ /* Send the command */
+ success = send_command (d, buf, len);
+ g_assert (success);
+
+ /* Get a response */
+ reply_len = wait_reply (d, buf, sizeof (buf));
+}
+
+void
test_com_zte_subsys_status (void *f, void *data)
{
TestComData *d = data;
diff --git a/libqcdm/tests/test-qcdm-com.h b/libqcdm/tests/test-qcdm-com.h
index c10d214b..6b1f4ba7 100644
--- a/libqcdm/tests/test-qcdm-com.h
+++ b/libqcdm/tests/test-qcdm-com.h
@@ -47,6 +47,8 @@ void test_com_hdr_subsys_state_info (void *f, void *data);
void test_com_ext_logmask (void *f, void *data);
+void test_com_event_report (void *f, void *data);
+
void test_com_zte_subsys_status (void *f, void *data);
void test_com_nw_subsys_modem_snapshot_cdma (void *f, void *data);
diff --git a/libqcdm/tests/test-qcdm.c b/libqcdm/tests/test-qcdm.c
index fd4d26d6..63421c70 100644
--- a/libqcdm/tests/test-qcdm.c
+++ b/libqcdm/tests/test-qcdm.c
@@ -108,6 +108,7 @@ int main (int argc, char **argv)
g_test_suite_add (suite, TESTCASE (test_com_cm_subsys_state_info, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_hdr_subsys_state_info, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_ext_logmask, data->com_data));
+ g_test_suite_add (suite, TESTCASE (test_com_event_report, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_zte_subsys_status, data->com_data));
g_test_suite_add (suite, TESTCASE (test_com_nw_subsys_modem_snapshot_cdma, data->com_data));
}