diff options
author | Tammo Spalink <tammo@google.com> | 2009-09-23 14:26:19 +0800 |
---|---|---|
committer | Tammo Spalink <tammo@google.com> | 2009-09-24 12:29:16 +0800 |
commit | af8e23fe9ebc160ad370d3cb4d960d154316930e (patch) | |
tree | 083196466036551741899983f27691c8245dd6a2 /tests | |
parent | c413d54cd9283778e6d73965a1d1d5f63ba62ec3 (diff) | |
download | frameworks_base-af8e23fe9ebc160ad370d3cb4d960d154316930e.zip frameworks_base-af8e23fe9ebc160ad370d3cb4d960d154316930e.tar.gz frameworks_base-af8e23fe9ebc160ad370d3cb4d960d154316930e.tar.bz2 |
Conditionalized CDMA-specific test.
Addresses issue:
http://b/issue?id=2122045
Change-Id: Ia43e254f0808e1d96cbd240101eee621979e9100
Diffstat (limited to 'tests')
-rw-r--r-- | tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java b/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java index 98d4c25..4a77e19 100644 --- a/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java +++ b/tests/AndroidTests/src/com/android/unit_tests/CdmaSmsTest.java @@ -16,6 +16,8 @@ package com.android.unit_tests; +import android.telephony.TelephonyManager; + import com.android.internal.telephony.GsmAlphabet; import com.android.internal.telephony.SmsHeader; import com.android.internal.telephony.cdma.SmsMessage; @@ -820,6 +822,8 @@ public class CdmaSmsTest extends AndroidTestCase { @SmallTest public void testFragmentText() throws Exception { + boolean isCdmaPhone = (TelephonyManager.getDefault().getPhoneType() == + TelephonyManager.PHONE_TYPE_CDMA); // Valid 160 character ASCII text. String text1 = "123456789012345678901234567890123456789012345678901234567890" + "1234567890123456789012345678901234567890123456789012345678901234567890" + @@ -828,8 +832,10 @@ public class CdmaSmsTest extends AndroidTestCase { assertEquals(ted.msgCount, 1); assertEquals(ted.codeUnitCount, 160); assertEquals(ted.codeUnitSize, 1); - ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text1); - assertEquals(fragments.size(), 1); + if (isCdmaPhone) { + ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text1); + assertEquals(fragments.size(), 1); + } // 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. @@ -840,7 +846,9 @@ public class CdmaSmsTest extends AndroidTestCase { assertEquals(ted.msgCount, 1); assertEquals(ted.codeUnitCount, 160); assertEquals(ted.codeUnitSize, 1); - fragments = android.telephony.SmsMessage.fragmentText(text2); - assertEquals(fragments.size(), 1); + if (isCdmaPhone) { + ArrayList<String> fragments = android.telephony.SmsMessage.fragmentText(text2); + assertEquals(fragments.size(), 1); + } } } |