aboutsummaryrefslogtreecommitdiff
path: root/src/tests/test-sms-part-cdma.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tests/test-sms-part-cdma.c')
-rw-r--r--src/tests/test-sms-part-cdma.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/tests/test-sms-part-cdma.c b/src/tests/test-sms-part-cdma.c
index eb095f34..935a9c6b 100644
--- a/src/tests/test-sms-part-cdma.c
+++ b/src/tests/test-sms-part-cdma.c
@@ -348,6 +348,28 @@ test_unicode_encoding (void)
"中國哲學書電子化計劃");
}
+static void
+test_empty_unicode_user_data (void)
+{
+ static const guint8 pdu[] = {
+ 0x01, 0x08, 0x2f, 0x03, 0x01, 0x00, 0x00, 0x00,
+ 0xfd, 0x00, 0x01, 0x02, 0x08, 0x00, 0x01, 0x02,
+ 0x00, 0x00, 0x01, 0x02, 0x20, 0x01, 0x02, 0x00,
+ 0x00, 0x00, 0x47, 0x06, 0x01, 0x02, 0x00, 0x06,
+ 0x08, 0x08, 0x05, 0x01, 0x06, 0x01, 0x6d, 0x38,
+ 0x00, 0x03, 0x05, 0x01, 0x06, 0x01, 0x02, 0x00,
+ 0x06, 0x08, 0x08, 0x05, 0x01, 0x00, 0x00, 0x00,
+ 0x47, 0x06, 0x01, 0x02, 0x00, 0x06, 0x08, 0x08,
+ 0x05, 0x01, 0x06, 0x01, 0x6d, 0x38, 0x00, 0x03,
+ 0x05, 0x01, 0x06, 0x01, 0x02, 0x00, 0x06, 0x08,
+ 0x08, 0x05, 0x01, 0x06, 0x06, 0x00, 0x01, 0x00,
+ 0x34, 0x00, 0x03, 0x05, 0x29, 0x08, 0x08, 0x05,
+ 0x01, 0xb6, 0x01, 0x38, 0x00, 0x02, 0x02, 0x00 };
+
+ /* also invalid this one */
+ common_test_invalid_part_from_pdu (pdu, sizeof (pdu));
+}
+
/********************* PDU CREATOR TESTS *********************/
static void
@@ -553,6 +575,7 @@ int main (int argc, char **argv)
g_test_add_func ("/MM/SMS/CDMA/PDU-Parser/latin-encoding", test_latin_encoding);
g_test_add_func ("/MM/SMS/CDMA/PDU-Parser/latin-encoding-2", test_latin_encoding_2);
g_test_add_func ("/MM/SMS/CDMA/PDU-Parser/unicode-encoding", test_unicode_encoding);
+ g_test_add_func ("/MM/SMS/CDMA/PDU-Parser/empty-unicode-user-data", test_empty_unicode_user_data);
g_test_add_func ("/MM/SMS/CDMA/PDU-Creator/ascii-encoding", test_create_pdu_text_ascii_encoding);
g_test_add_func ("/MM/SMS/CDMA/PDU-Creator/latin-encoding", test_create_pdu_text_latin_encoding);