summaryrefslogtreecommitdiffstats
path: root/unit
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2012-08-16 00:49:45 -0500
committerDenis Kenzior <denkenz@gmail.com>2012-08-16 00:49:45 -0500
commit111c1a28730504121b97aaf2973e3270defb5c76 (patch)
treeabed25ae97b282870d6680493c761b49f96cd174 /unit
parent54de04a828d945e8f081c7cd99161881736666b8 (diff)
downloadofono-111c1a28730504121b97aaf2973e3270defb5c76.tar.bz2
unit: Add a unit test for empty sim strings
Diffstat (limited to 'unit')
-rw-r--r--unit/test-util.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/unit/test-util.c b/unit/test-util.c
index 6658f46f..f4e6bdd1 100644
--- a/unit/test-util.c
+++ b/unit/test-util.c
@@ -894,6 +894,7 @@ static unsigned char sim_82_1[] = { 0x82, 0x05, 0x04, 0x00, 0x2D, 0xB3, 0xB4,
0x2D, 0x31 };
static unsigned char sim_82_2[] = { 0x82, 0x05, 0xD8, 0x00, 0x2D, 0xB3, 0xB4,
0x2D, 0x31 };
+static unsigned char sim_7bit_empty[] = { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF };
static void test_sim(void)
{
@@ -943,6 +944,11 @@ static void test_sim(void)
utf8 = sim_string_to_utf8(sim_82_2, sizeof(sim_82_2));
g_assert(utf8 == NULL);
+
+ utf8 = sim_string_to_utf8(sim_7bit_empty, sizeof(sim_7bit_empty));
+ g_assert(utf8);
+ g_assert(strcmp(utf8, "") == 0);
+ g_free(utf8);
}
static void test_unicode_to_gsm(void)