Bug 797277 - Part 5/5: test cases, r=marshall_law

This commit is contained in:
Vicamo Yang 2012-10-31 17:25:26 +08:00
parent 6693e14a21
commit 3cf2bd5b9e
9 changed files with 127 additions and 54 deletions

View File

@ -40,6 +40,7 @@ function simulateIncomingSms() {
is(incomingSms.read, false, "read");
is(incomingSms.receiver, null, "receiver");
is(incomingSms.sender, remoteNumber, "sender");
is(incomingSms.messageClass, "normal", "messageClass");
ok(incomingSms.timestamp instanceof Date, "timestamp is instanceof date");
inSmsTimeStamp = incomingSms.timestamp;
sendSms();
@ -66,6 +67,7 @@ function sendSms() {
is(sentSms.read, true, "read");
is(sentSms.receiver, remoteNumber, "receiver");
is(sentSms.sender, null, "sender");
is(sentSms.messageClass, "normal", "messageClass");
ok(sentSms.timestamp instanceof Date, "timestamp is instanceof date");
outSmsTimeStamp = sentSms.timestamp;
@ -114,6 +116,7 @@ function getReceivedSms() {
is(foundSms.read, false, "read");
is(foundSms.receiver, myNumber, "receiver");
is(foundSms.sender, remoteNumber, "sender");
is(foundSms.messageClass, "normal", "messageClass");
ok(foundSms.timestamp instanceof Date, "timestamp is instanceof date");
is(foundSms.timestamp.getTime(), inSmsTimeStamp.getTime(), "timestamp matches");
getSentSms();
@ -146,6 +149,7 @@ function getSentSms() {
is(foundSms.read, true, "read");
is(foundSms.receiver, remoteNumber, "receiver");
is(foundSms.sender, myNumber, "sender");
is(foundSms.messageClass, "normal", "messageClass");
ok(foundSms.timestamp instanceof Date, "timestamp is instanceof date");
is(foundSms.timestamp.getTime(), outSmsTimeStamp.getTime(), "timestamp matches");
deleteMsgs();

View File

@ -29,6 +29,7 @@ sms.onreceived = function onreceived(event) {
is(message.sender, sender);
is(message.receiver, null);
is(message.body, body);
is(message.messageClass, "normal");
ok(message.timestamp instanceof Date);
// SMSC timestamp is in seconds.
ok(Math.floor(message.timestamp.getTime() / 1000) >= Math.floor(now / 1000));

View File

@ -31,6 +31,7 @@ function simulateIncomingSms() {
is(incomingSms.read, false, "read");
is(incomingSms.receiver, null, "receiver");
is(incomingSms.sender, fromNumber, "sender");
is(incomingSms.messageClass, "normal", "messageClass");
ok(incomingSms.timestamp instanceof Date, "timestamp is istanceof date");
verifySmsExists(incomingSms);

View File

@ -31,7 +31,7 @@ function sendSmsPduToEmulator(pdu) {
}
const TIMESTAMP = Date.UTC(2000, 0, 1);
function checkMessage(message, id) {
function checkMessage(message, id, messageClass) {
ok(message instanceof MozSmsMessage,
"message is instanceof " + message.constructor);
if (id == null) {
@ -43,6 +43,7 @@ function checkMessage(message, id) {
is(message.deliveryStatus, "success", "message.deliveryStatus");
is(message.sender, "+1", "message.sender");
is(message.body, "A", "message.body");
is(message.messageClass, messageClass, "message.messageClass");
ok(message.timestamp instanceof Date,
"message.timestamp is instanceof " + message.timestamp.constructor);
is(message.timestamp.getTime(), TIMESTAMP, "message.timestamp");
@ -61,7 +62,7 @@ function test_message_class_0() {
sms.removeEventListener("received", onReceived);
let message = event.message;
checkMessage(message, -1);
checkMessage(message, -1, "class-0");
// Make sure the message is not stored.
let request = sms.getMessages(null, false);
@ -100,13 +101,13 @@ function test_message_class_0() {
do_test(0);
}
function doTestMessageClassGeneric(allDCSs, next) {
function doTestMessageClassGeneric(allDCSs, messageClass, next) {
function do_test(dcsIndex) {
sms.addEventListener("received", function onReceived(event) {
sms.removeEventListener("received", onReceived);
// Make sure we can correctly receive the message
checkMessage(event.message);
checkMessage(event.message, null, messageClass);
++dcsIndex;
if (dcsIndex >= allDCSs.length) {
@ -135,7 +136,7 @@ function test_message_class_1() {
];
log("Checking Message Class 1");
doTestMessageClassGeneric(allDCSs, test_message_class_2);
doTestMessageClassGeneric(allDCSs, "class-1", test_message_class_2);
}
function test_message_class_2() {
@ -156,7 +157,7 @@ function test_message_class_2() {
function onReceived(event) {
if (pidIndex == 0) {
// Make sure we can correctly receive the message
checkMessage(event.message);
checkMessage(event.message, null, "class-2");
next();
return;
@ -220,7 +221,7 @@ function test_message_class_3() {
];
log("Checking Message Class 3");
doTestMessageClassGeneric(allDCSs, cleanUp);
doTestMessageClassGeneric(allDCSs, "class-3", cleanUp);
}
function cleanUp() {

View File

@ -37,6 +37,7 @@ function checkSentMessage(message, body, sentDate) {
is(message.sender, null, "message.sender");
is(message.receiver, receiver, "message.receiver");
is(message.body, body, "message.body");
is(message.messageClass, "normal", "messageClass");
ok(message.timestamp instanceof Date,
"message.timestamp is instanceof " + message.timestamp.constructor);
// SMSC timestamp is in seconds.

View File

@ -36,6 +36,7 @@ function sendSms() {
is(sentSms.read, true, "read");
is(sentSms.receiver, destNumber, "receiver");
is(sentSms.sender, null, "sender");
is(sentSms.messageClass, "normal", "messageClass");
ok(sentSms.timestamp instanceof Date, "timestamp is istanceof date");
if (gotSmsOnsent && gotReqOnsuccess) { verifySmsExists(smsId); }

View File

@ -38,6 +38,7 @@ function simulateIncomingSms() {
is(incomingSms.read, false, "read");
is(incomingSms.receiver, null, "receiver");
is(incomingSms.sender, remoteNumber, "sender");
is(incomingSms.messageClass, "normal", "messageClass");
ok(incomingSms.timestamp instanceof Date, "timestamp is instanceof date");
// The max resolution of the SCTS (SMS Centre TimeStamp) is one second
// therefore we want to compare in seconds not milliseconds. No need to
@ -84,6 +85,7 @@ function sendSms() {
is(sentSms.read, true, "read");
is(sentSms.receiver, remoteNumber, "receiver");
is(sentSms.sender, null, "sender");
is(sentSms.messageClass, "normal", "messageClass");
ok(sentSms.timestamp instanceof Date, "timestamp is instanceof date");
// The max resolution of the SCTS (SMS Centre TimeStamp) is one second
// therefore we want to compare in seconds not milliseconds. Round the

View File

@ -32,8 +32,8 @@ function run_test() {
* Ensure an SmsMessage object created has sensible initial values.
*/
add_test(function test_interface() {
let sms = newMessage(null, "sent", "pending", null, null, null, new Date(),
true);
let sms = newMessage(null, "sent", "pending", null, null, null, "normal",
new Date(), true);
do_check_true(sms instanceof Ci.nsIDOMMozSmsMessage);
do_check_eq(sms.id, 0);
do_check_eq(sms.delivery, "sent");
@ -41,6 +41,7 @@ add_test(function test_interface() {
do_check_eq(sms.receiver, null);
do_check_eq(sms.sender, null);
do_check_eq(sms.body, null);
do_check_eq(sms.messageClass, "normal");
do_check_true(sms.timestamp instanceof Date);
do_check_true(sms.read);
run_next_test();
@ -51,7 +52,7 @@ add_test(function test_interface() {
*/
add_test(function test_readonly_attributes() {
let sms = newMessage(null, "received", "success", null, null, null,
new Date(), true);
"normal", new Date(), true);
sms.id = 1;
do_check_eq(sms.id, 0);
@ -71,6 +72,9 @@ add_test(function test_readonly_attributes() {
sms.body = "a body";
do_check_eq(sms.body, null);
sms.messageClass = "class-0";
do_check_eq(sms.messageClass, "normal");
let oldTimestamp = sms.timestamp.getTime();
sms.timestamp = new Date();
do_check_eq(sms.timestamp.getTime(), oldTimestamp);
@ -87,13 +91,14 @@ add_test(function test_readonly_attributes() {
add_test(function test_timestamp_number() {
let ts = Date.now();
let sms = newMessage(42, "sent", "pending", "the sender", "the receiver",
"the body", ts, true);
"the body", "normal", ts, true);
do_check_eq(sms.id, 42);
do_check_eq(sms.delivery, "sent");
do_check_eq(sms.deliveryStatus, "pending");
do_check_eq(sms.sender, "the sender");
do_check_eq(sms.receiver, "the receiver");
do_check_eq(sms.body, "the body");
do_check_eq(sms.messageClass, "normal");
do_check_true(sms.timestamp instanceof Date);
do_check_eq(sms.timestamp.getTime(), ts);
do_check_true(sms.read);
@ -106,13 +111,14 @@ add_test(function test_timestamp_number() {
add_test(function test_timestamp_date() {
let date = new Date();
let sms = newMessage(42, "sent", "pending", "the sender", "the receiver",
"the body", date, true);
"the body", "normal", date, true);
do_check_eq(sms.id, 42);
do_check_eq(sms.delivery, "sent");
do_check_eq(sms.deliveryStatus, "pending");
do_check_eq(sms.sender, "the sender");
do_check_eq(sms.receiver, "the receiver");
do_check_eq(sms.body, "the body");
do_check_eq(sms.messageClass, "normal");
do_check_true(sms.timestamp instanceof Date);
do_check_eq(sms.timestamp.getTime(), date.getTime());
do_check_true(sms.read);
@ -125,7 +131,7 @@ add_test(function test_timestamp_date() {
add_test(function test_invalid_timestamp_float() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver", "the body",
3.1415, true);
"normal", 3.1415, true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -136,7 +142,7 @@ add_test(function test_invalid_timestamp_float() {
add_test(function test_invalid_timestamp_null() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver", "the body",
null, true);
"normal", null, true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -147,7 +153,7 @@ add_test(function test_invalid_timestamp_null() {
add_test(function test_invalid_timestamp_undefined() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver", "the body",
undefined, true);
"normal", undefined, true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -158,7 +164,7 @@ add_test(function test_invalid_timestamp_undefined() {
add_test(function test_invalid_timestamp_object() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver", "the body",
{}, true);
"normal", {}, true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -169,7 +175,7 @@ add_test(function test_invalid_timestamp_object() {
add_test(function test_invalid_delivery_string() {
do_check_throws(function() {
newMessage(42, "this is invalid", "pending", "the sender", "the receiver",
"the body", new Date(), true);
"the body", "normal", new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -180,7 +186,7 @@ add_test(function test_invalid_delivery_string() {
add_test(function test_invalid_delivery_string() {
do_check_throws(function() {
newMessage(42, 1, "pending", "the sender", "the receiver", "the body",
new Date(), true);
"normal", new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -191,7 +197,7 @@ add_test(function test_invalid_delivery_string() {
add_test(function test_invalid_delivery_status_string() {
do_check_throws(function() {
newMessage(42, "sent", "this is invalid", "the sender", "the receiver",
"the body", new Date(), true);
"the body", "normal", new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
@ -202,7 +208,29 @@ add_test(function test_invalid_delivery_status_string() {
add_test(function test_invalid_delivery_status_string() {
do_check_throws(function() {
newMessage(42, "sent", 1, "the sender", "the receiver", "the body",
new Date(), true);
"normal", new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
/**
* Test that an invalid message class string is not accepted.
*/
add_test(function test_invalid_message_class_string() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver",
"the body", "this is invalid", new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});
/**
* Test that a number is not accepted for the 'messageClass' argument.
*/
add_test(function test_invalid_message_class_string() {
do_check_throws(function() {
newMessage(42, "sent", "pending", "the sender", "the receiver", "the body",
1, new Date(), true);
}, Cr.NS_ERROR_INVALID_ARG);
run_next_test();
});

View File

@ -106,72 +106,106 @@ add_test(function test_GsmPDUHelper_readDataCodingScheme() {
// Group 00xx
// Bit 3 and 2 indicate the character set being used.
test_dcs(0x00, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x04, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x08, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x0C, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x00, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x04, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x08, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x0C, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
// Bit 4, if set to 0, indicates that bits 1 to 0 are reserved and have no
// message class meaning.
test_dcs(0x01, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x02, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x03, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x01, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x02, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x03, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
// Bit 4, if set to 1, indicates that bits 1 to 0 have a message class meaning.
test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
test_dcs(0x11, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
test_dcs(0x12, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
test_dcs(0x13, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
test_dcs(0x10, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
test_dcs(0x11, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
test_dcs(0x12, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
test_dcs(0x13, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
// Group 01xx
test_dcs(0x50, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
test_dcs(0x50, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
// Group 1000..1011: reserved
test_dcs(0x8F, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x9F, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0xAF, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0xBF, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN);
test_dcs(0x8F, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0x9F, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0xAF, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
test_dcs(0xBF, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL]);
// Group 1100: Message Waiting Indication Group: Discard Message
// Bit 3 indicates Indication Sense:
test_dcs(0xC0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xC0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: false, discard: true, msgCount: 0});
test_dcs(0xC8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xC8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: true, msgCount: -1});
// Bit 2 is reserved, and set to 0:
test_dcs(0xCC, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xCC, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: true, msgCount: -1});
// Group 1101: Message Waiting Indication Group: Store Message
// Bit 3 indicates Indication Sense:
test_dcs(0xD0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xD0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: false, discard: false, msgCount: 0});
test_dcs(0xD8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xD8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: false, msgCount: -1});
// Bit 2 is reserved, and set to 0:
test_dcs(0xDC, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xDC, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: false, msgCount: -1});
// Group 1110: Message Waiting Indication Group: Store Message, UCS2
// Bit 3 indicates Indication Sense:
test_dcs(0xE0, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xE0, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: false, discard: false, msgCount: 0});
test_dcs(0xE8, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xE8, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: false, msgCount: -1});
// Bit 2 is reserved, and set to 0:
test_dcs(0xEC, PDU_DCS_MSG_CODING_16BITS_ALPHABET, PDU_DCS_MSG_CLASS_UNKNOWN,
test_dcs(0xEC, PDU_DCS_MSG_CODING_16BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_NORMAL],
{active: true, discard: false, msgCount: -1});
// Group 1111
test_dcs(0xF0, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
test_dcs(0xF1, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
test_dcs(0xF2, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
test_dcs(0xF3, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
test_dcs(0xF4, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
test_dcs(0xF5, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_ME_SPECIFIC);
test_dcs(0xF6, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_SIM_SPECIFIC);
test_dcs(0xF7, PDU_DCS_MSG_CODING_8BITS_ALPHABET, PDU_DCS_MSG_CLASS_TE_SPECIFIC);
test_dcs(0xF0, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
test_dcs(0xF1, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
test_dcs(0xF2, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
test_dcs(0xF3, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
test_dcs(0xF4, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
test_dcs(0xF5, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_1]);
test_dcs(0xF6, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_2]);
test_dcs(0xF7, PDU_DCS_MSG_CODING_8BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_3]);
// Bit 3 is reserved and should be set to 0, but if it doesn't we should
// ignore it.
test_dcs(0xF8, PDU_DCS_MSG_CODING_7BITS_ALPHABET, PDU_DCS_MSG_CLASS_0);
test_dcs(0xF8, PDU_DCS_MSG_CODING_7BITS_ALPHABET,
GECKO_SMS_MESSAGE_CLASSES[PDU_DCS_MSG_CLASS_0]);
run_next_test();
});