diff options
author | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-12 09:14:38 +0100 |
---|---|---|
committer | Aleksander Morgado <aleksander@aleksander.es> | 2014-12-12 09:14:38 +0100 |
commit | 3853840a31906b50051f20146e669d85f3e46903 (patch) | |
tree | cde449056c73d12d008099e44e3ea4a98f467cce | |
parent | 739fc4f183c18d7d8b3158a0843046ad2d2edd4f (diff) |
libqmi,test: new test for QMI NAS Get Cell Info with GERAN
Which currently fails:
{*LOG(error):{Qmi-FATAL-CRITICAL: qmi_message_tlv_read_fixed_size_string: assertion 'out != NULL' failed}:LOG*}
(/home/aleksander/Development/foss/libqmi/src/libqmi-glib/test/.libs/test-generated:12179): Qmi-CRITICAL **: qmi_message_tlv_read_fixed_size_string: assertion 'out != NULL' failed
Program received signal SIGTRAP, Trace/breakpoint trap.
0x00007ffff717eae0 in g_logv () from /usr/lib/libglib-2.0.so.0
(gdb) bt
#0 0x00007ffff717eae0 in g_logv () from /usr/lib/libglib-2.0.so.0
#1 0x00007ffff717ed1f in g_log () from /usr/lib/libglib-2.0.so.0
#2 0x00007ffff7a5381e in qmi_message_tlv_read_fixed_size_string (self=0x7fffe8007d30, tlv_offset=20, offset=0x7fffffffdcc8, string_length=3, out=0x0, error=0x0) at qmi-message.c:1817
#3 0x00007ffff7acce60 in __qmi_message_nas_get_cell_location_info_response_parse (message=0x7fffe8007d30, error=0x7fffffffded8) at qmi-nas.c:26772
#4 0x00007ffff7af46fa in get_cell_location_info_ready (device=0x64e8b0, res=0x65d990, simple=0x65d920) at qmi-nas.c:47982
#5 0x00007ffff76ff6d7 in g_simple_async_result_complete () from /usr/lib/libgio-2.0.so.0
#6 0x00007ffff76ff739 in ?? () from /usr/lib/libgio-2.0.so.0
#7 0x00007ffff717791d in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#8 0x00007ffff7177cf8 in ?? () from /usr/lib/libglib-2.0.so.0
#9 0x00007ffff7178022 in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
#10 0x0000000000403e9b in test_fixture_loop_run (fixture=0x63c800) at test-fixture.c:321
#11 0x0000000000406da4 in test_generated_nas_get_cell_location_info (fixture=0x63c800) at test-generated.c:562
#12 0x00007ffff719d0f3 in ?? () from /usr/lib/libglib-2.0.so.0
#13 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0
#14 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0
#15 0x00007ffff719d2c2 in ?? () from /usr/lib/libglib-2.0.so.0
#16 0x00007ffff719d62b in g_test_run_suite () from /usr/lib/libglib-2.0.so.0
#17 0x00007ffff719d661 in g_test_run () from /usr/lib/libglib-2.0.so.0
#18 0x0000000000406ef0 in main (argc=1, argv=0x7fffffffe678) at test-generated.c:584
(gdb) fr 3
#3 0x00007ffff7acce60 in __qmi_message_nas_get_cell_location_info_response_parse (message=0x7fffe8007d30, error=0x7fffffffded8) at qmi-nas.c:26772
warning: Source file is more recent than executable.
26772 if (!qmi_message_tlv_read_fixed_size_string (message, init_offset, &offset, 3, &cell_aux.plmn[0], NULL))
(gdb) p cell_aux
$1 = {cell_id = 28541, plmn = 0x0, lac = 0, geran_absolute_rf_channel_number = 0, base_station_identity_code = 0 '\000', rx_level = 0}
-rw-r--r-- | src/libqmi-glib/test/test-generated.c | 68 |
1 files changed, 63 insertions, 5 deletions
diff --git a/src/libqmi-glib/test/test-generated.c b/src/libqmi-glib/test/test-generated.c index ec7a235..a8fe086 100644 --- a/src/libqmi-glib/test/test-generated.c +++ b/src/libqmi-glib/test/test-generated.c @@ -441,6 +441,28 @@ nas_network_scan_ready (QmiClientNas *client, } static void +nas_get_cell_location_info_ready (QmiClientNas *client, + GAsyncResult *res, + TestFixture *fixture) +{ + QmiMessageNasGetCellLocationInfoOutput *output; + GError *error = NULL; + gboolean st; + + output = qmi_client_nas_get_cell_location_info_finish (client, res, &error); + g_assert_no_error (error); + g_assert (output); + + st = qmi_message_nas_get_cell_location_info_output_get_result (output, &error); + g_assert_no_error (error); + g_assert (st); + + qmi_message_nas_get_cell_location_info_output_unref (output); + + test_fixture_loop_stop (fixture); +} + +static void test_generated_nas_network_scan (TestFixture *fixture) { guint8 expected[] = { @@ -505,6 +527,42 @@ test_generated_nas_network_scan (TestFixture *fixture) test_fixture_loop_run (fixture); } +static void +test_generated_nas_get_cell_location_info (TestFixture *fixture) +{ + guint8 expected[] = { + 0x01, + 0x0C, 0x00, 0x00, 0x03, 0x01, + 0x00, 0x01, 0x00, 0x43, 0x00, 0x00, 0x00 + }; + guint8 response[] = { + 0x01, + 0x53, 0x00, 0x80, 0x03, 0x01, + 0x02, 0x01, 0x00, 0x43, 0x00, 0x47, 0x00, 0x02, + 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x3D, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0xFF, 0xFF, 0xFF, + 0xFF, 0x28, 0x00, 0x03, 0x7D, 0x6F, 0x00, 0x00, + 0x32, 0xF4, 0x51, 0xB3, 0x00, 0x4D, 0x00, 0x11, + 0x2A, 0x00, 0x8A, 0x3C, 0x00, 0x00, 0x32, 0xF4, + 0x51, 0xB3, 0x00, 0x63, 0x00, 0x30, 0x14, 0x00, + 0x89, 0x3C, 0x00, 0x00, 0x32, 0xF4, 0x51, 0xB3, + 0x00, 0x59, 0x00, 0x11, 0x0D, 0x00 + }; + + test_port_context_set_command (fixture->ctx, + expected, G_N_ELEMENTS (expected), + response, G_N_ELEMENTS (response), + fixture->service_info[QMI_SERVICE_NAS].transaction_id++); + + qmi_client_nas_get_cell_location_info (QMI_CLIENT_NAS (fixture->service_info[QMI_SERVICE_NAS].client), NULL, 3, NULL, + (GAsyncReadyCallback) nas_get_cell_location_info_ready, + fixture); + + test_fixture_loop_run (fixture); +} + + /*****************************************************************************/ int main (int argc, char **argv) @@ -516,12 +574,12 @@ int main (int argc, char **argv) TEST_ADD ("/libqmi-glib/generated/core", test_generated_core); /* DMS */ - TEST_ADD ("/libqmi-glib/generated/dms/get-ids", test_generated_dms_get_ids); - TEST_ADD ("/libqmi-glib/generated/dms/uim-get-pin-status", test_generated_dms_uim_get_pin_status); - TEST_ADD ("/libqmi-glib/generated/dms/uim-verify-pin", test_generated_dms_uim_verify_pin); + TEST_ADD ("/libqmi-glib/generated/dms/get-ids", test_generated_dms_get_ids); + TEST_ADD ("/libqmi-glib/generated/dms/uim-get-pin-status", test_generated_dms_uim_get_pin_status); + TEST_ADD ("/libqmi-glib/generated/dms/uim-verify-pin", test_generated_dms_uim_verify_pin); /* NAS */ - TEST_ADD ("/libqmi-glib/generated/nas/network-scan", test_generated_nas_network_scan); - + TEST_ADD ("/libqmi-glib/generated/nas/network-scan", test_generated_nas_network_scan); + TEST_ADD ("/libqmi-glib/generated/nas/get-cell-location-info", test_generated_nas_get_cell_location_info); return g_test_run (); } |