summaryrefslogtreecommitdiffstats
path: root/tests/telephonytests
diff options
context:
space:
mode:
authorWink Saville <wink@google.com>2012-08-31 09:16:31 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-31 09:16:31 -0700
commit7f7d82aac56022880f613772ed4a90738075c843 (patch)
tree31d75f1bedfdadb38e5625fa1911f590e7334f2b /tests/telephonytests
parentcbbf6deee30d702e398939f4bb464f5e821f5e6c (diff)
parent50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5 (diff)
downloadframeworks_opt_telephony-7f7d82aac56022880f613772ed4a90738075c843.zip
frameworks_opt_telephony-7f7d82aac56022880f613772ed4a90738075c843.tar.gz
frameworks_opt_telephony-7f7d82aac56022880f613772ed4a90738075c843.tar.bz2
am 50b1206d: am cc0e5450: Merge "WspTypeDecoder: fixed decoding of content parameters"
* commit '50b1206d5ab38003c0d63b7e6a3589bf00c6ceb5': WspTypeDecoder: fixed decoding of content parameters
Diffstat (limited to 'tests/telephonytests')
-rw-r--r--tests/telephonytests/src/com/android/internal/telephony/Wap230WspContentTypeTest.java22
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
+}