diff options
author | jsh <jsh@google.com> | 2009-11-06 11:37:47 -0800 |
---|---|---|
committer | jsh <jsh@google.com> | 2009-11-06 11:55:19 -0800 |
commit | 1e1c24bed274471e40b5bc2af00a56c56b9e8635 (patch) | |
tree | f44e6def7d057257eec51094e132323aefc7ec88 /tests | |
parent | 9eaff61adf15b4e6cced7da3d7c239e2fc41f8ed (diff) | |
download | frameworks_base-1e1c24bed274471e40b5bc2af00a56c56b9e8635.zip frameworks_base-1e1c24bed274471e40b5bc2af00a56c56b9e8635.tar.gz frameworks_base-1e1c24bed274471e40b5bc2af00a56c56b9e8635.tar.bz2 |
Update CdmaSmsTest unit test.
Forgot to do this with previous check in. Now that calculateLength() has
been fixed to match the actual encoding (ie, doesn't support single-segment
EMS), test case needs to be updated.
Fixes b/2244483
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java b/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java index 85840a8..db47693 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java +++ b/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java @@ -846,6 +846,12 @@ public class CdmaSmsTest extends AndroidTestCase { ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text1); assertEquals(fragments.size(), 1); } + + /* + This is not a valid test: we will never encode a single-segment + EMS message. Leaving this here, since we may try to support + this in the future. + // Valid 160 character GSM text -- the last character is // non-ASCII, and so this will currently generate a singleton // EMS message, which is not necessarily supported by Verizon. @@ -860,5 +866,22 @@ public class CdmaSmsTest extends AndroidTestCase { ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2); assertEquals(fragments.size(), 1); } + */ + + // *IF* we supported single-segment EMS, this text would result in a + // single fragment with 7-bit encoding. But we don't, so this text + // results in three fragments of 16-bit encoding. + String text2 = "123456789012345678901234567890123456789012345678901234567890" + + "1234567890123456789012345678901234567890123456789012345678901234567890" + + "12345678901234567890123456789\u00a3"; // Trailing pound-currency sign. + ted = SmsMessage.calculateLength(text2, false); + assertEquals(3, ted.msgCount); + assertEquals(160, ted.codeUnitCount); + assertEquals(3, ted.codeUnitSize); + if (isCdmaPhone) { + ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2); + assertEquals(3, fragments.size()); + } + } } |