diff options
author | Tammo Spalink <tammo@google.com> | 2009-06-25 16:13:51 +0800 |
---|---|---|
committer | Tammo Spalink <tammo@google.com> | 2009-06-29 12:51:22 +0800 |
commit | 3a08cec99e104f74f28ba2463f00c8d4e6d1967e (patch) | |
tree | a326d7de10c17acce6d1a37f51913de491cff307 /tests/CoreTests | |
parent | 9171749700853305f3e6abbcdbd9e02f3a71d459 (diff) | |
download | frameworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.zip frameworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.tar.gz frameworks_base-3a08cec99e104f74f28ba2463f00c8d4e6d1967e.tar.bz2 |
fix potential string index problems in PhoneNumberUtils.numberToCalledPartyBCDHelper
addresses http://buganizer/issue?id=1489784
Diffstat (limited to 'tests/CoreTests')
-rw-r--r-- | tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java index e8bd239..577d384 100644 --- a/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java +++ b/tests/CoreTests/com/android/internal/telephony/PhoneNumberUtilsTest.java @@ -93,6 +93,13 @@ public class PhoneNumberUtilsTest extends TestCase { assertEquals(b[i], bRet[i]); } + bRet = PhoneNumberUtils.networkPortionToCalledPartyBCDWithLength("+17005550020"); + assertEquals(8, bRet.length); + assertEquals(bRet[0], 7); + for (int i = 1; i < 8; i++) { + assertEquals(b[i - 1], bRet[i]); + } + bRet = PhoneNumberUtils.networkPortionToCalledPartyBCD("7005550020"); assertEquals("7005550020", PhoneNumberUtils.calledPartyBCDToString(bRet, 0, bRet.length)); |