diff options
author | Wink Saville <wink@google.com> | 2012-08-31 09:12:13 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2012-08-31 09:12:13 -0700 |
commit | 50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5 (patch) | |
tree | 28fcc3e80870339b88c86d028e6b21dc529a3d48 /tests | |
parent | 15e83e031027a1b161c4ee4f046e3cc1bdf0f92b (diff) | |
parent | cc0e54506132e42f5e0ca2cfee0c399ba49ba149 (diff) | |
download | frameworks_opt_telephony-50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5.zip frameworks_opt_telephony-50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5.tar.gz frameworks_opt_telephony-50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5.tar.bz2 |
am cc0e5450: Merge "WspTypeDecoder: fixed decoding of content parameters"
* commit 'cc0e54506132e42f5e0ca2cfee0c399ba49ba149':
WspTypeDecoder: fixed decoding of content parameters
Diffstat (limited to 'tests')
-rw-r--r-- | tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java b/tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java index d31b294..9c2b7ef 100644 --- a/tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java +++ b/tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java @@ -623,6 +623,26 @@ public class Wap230WspContentTypeTest extends TestCase { } + public void testTypedParamWellKnownShortIntegerCompactIntegerValue_0() { + ByteArrayOutputStream out = new ByteArrayOutputStream(); + out.write(0x3); + out.write(SHORT_MIME_TYPE_ROLLOVER_CERTIFICATE | WSP_SHORT_INTEGER_MASK); + out.write(TYPED_PARAM_SEC | WSP_SHORT_INTEGER_MASK); + out.write(0x00 | WSP_SHORT_INTEGER_MASK); + + WspTypeDecoder unit = new WspTypeDecoder(out.toByteArray()); + assertTrue(unit.decodeContentType(0)); + + String mimeType = unit.getValueString(); + + assertEquals(STRING_MIME_TYPE_ROLLOVER_CERTIFICATE, mimeType); + assertEquals(0x3F, unit.getValue32()); + assertEquals(4, unit.getDecodedDataLength()); + + Map<String, String> params = unit.getContentParameters(); + assertEquals("0", params.get("SEC")); + } + public void testTypedParamWellKnownShortIntegerMultipleParameters() throws Exception { ByteArrayOutputStream out = new ByteArrayOutputStream(); @@ -850,4 +870,4 @@ public class Wap230WspContentTypeTest extends TestCase { WspTypeDecoder unit = new WspTypeDecoder(out.toByteArray()); assertFalse(unit.decodeContentType(0)); } -}
\ No newline at end of file +} |