diff options
author | Denis Kenzior <denkenz@gmail.com> | 2012-11-22 09:42:28 -0600 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2012-11-22 10:26:34 -0600 |
commit | 196183a3e50bd0b86a7921a1ee7b241f0c9ad131 (patch) | |
tree | 69475ee8f781bd7a690725744e00eeebf15c5a57 /unit | |
parent | cc14e85fa64db137722ba66641accafd2bf93521 (diff) |
unit: Add 2G and 3G path lookup tests
Diffstat (limited to 'unit')
-rw-r--r-- | unit/test-simutil.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/unit/test-simutil.c b/unit/test-simutil.c index 62093eb9..cf76a37f 100644 --- a/unit/test-simutil.c +++ b/unit/test-simutil.c @@ -472,6 +472,28 @@ static void test_application_entry_decode(void) g_free(ef_dir); } +static void test_get_3g_path(void) +{ + unsigned char path[6]; + unsigned int len; + unsigned char path1[] = { 0x3F, 0x00, 0x7F, 0xFF }; + + len = sim_ef_db_get_path_3g(SIM_EFPNN_FILEID, path); + g_assert(len == 4); + g_assert(!memcmp(path, path1, len)); +} + +static void test_get_2g_path(void) +{ + unsigned char path[6]; + unsigned int len; + unsigned char path1[] = { 0x3F, 0x00, 0x7F, 0x20 }; + + len = sim_ef_db_get_path_2g(SIM_EFPNN_FILEID, path); + g_assert(len == 4); + g_assert(!memcmp(path, path1, len)); +} + int main(int argc, char **argv) { g_test_init(&argc, &argv, NULL); @@ -488,6 +510,8 @@ int main(int argc, char **argv) g_test_add_func("/testsimutil/3G Status response", test_3g_status_data); g_test_add_func("/testsimutil/Application entries decoding", test_application_entry_decode); + g_test_add_func("/testsimutil/3G path", test_get_3g_path); + g_test_add_func("/testsimutil/2G path", test_get_2g_path); return g_test_run(); } |