You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@harmony.apache.org by nd...@apache.org on 2006/09/15 04:40:36 UTC
svn commit: r446478 [11/11] - in
/incubator/harmony/enhanced/classlib/trunk/modules/archive: ./ .settings/
META-INF/ make/ src/main/java/java/util/jar/ src/main/java/java/util/zip/
src/main/java/org/apache/harmony/archive/internal/pack200/ src/main/nat...
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/shared/zipsup.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/windows/DoxygenSupport.txt
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/windows/DoxygenSupport.txt?view=diff&rev=446478&r1=446477&r2=446478
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/windows/DoxygenSupport.txt (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/windows/DoxygenSupport.txt Thu Sep 14 19:40:33 2006
@@ -1,26 +1,26 @@
-/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/*
- * This file provides the group definitions required to create the Doxygen generated
- * output for compounds. There is one group per directory (port, pool, thread, etc.).
- */
-
-/**
- * @defgroup ZipSupport Zip Support
- * @brief Zip file support for the Java VM.
- */
-
-
+/* Copyright 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/*
+ * This file provides the group definitions required to create the Doxygen generated
+ * output for compounds. There is one group per directory (port, pool, thread, etc.).
+ */
+
+/**
+ * @defgroup ZipSupport Zip Support
+ * @brief Zip file support for the Java VM.
+ */
+
+
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zip/windows/DoxygenSupport.txt
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zlib/shared/zlib_copyright.c
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zlib/shared/zlib_copyright.c?view=diff&rev=446478&r1=446477&r2=446478
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zlib/shared/zlib_copyright.c (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zlib/shared/zlib_copyright.c Thu Sep 14 19:40:33 2006
@@ -1,19 +1,19 @@
-/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-/* A copyright string included in each DLL and executable */
-
-const char hyCopyright[] =
- "zlib data compression library Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler";
+/* Copyright 1991, 2005 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+/* A copyright string included in each DLL and executable */
+
+const char hyCopyright[] =
+ "zlib data compression library Copyright (C) 1995-2004 Jean-loup Gailly and Mark Adler";
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/main/native/zlib/shared/zlib_copyright.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/AllTests.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/AllTests.java?view=diff&rev=446478&r1=446477&r2=446478
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/AllTests.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/AllTests.java Thu Sep 14 19:40:33 2006
@@ -1,42 +1,42 @@
-/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.harmony.archive.tests.internal.pack200;
-
-import junit.framework.Test;
-import junit.framework.TestSuite;
-
-/**
- * Test suite for org.apache.harmony.archive.internal.pack200 package.
- */
-public class AllTests {
-
- public static void main(String[] args) {
- junit.textui.TestRunner.run(suite());
- }
-
- public static Test suite() {
- TestSuite suite = new TestSuite(
- "Suite org.apache.harmony.archive.tests.internal.pack200");
- // $JUnit-BEGIN$
- suite.addTestSuite(CodecEncodingTest.class);
- suite.addTestSuite(CodecTest.class);
- suite.addTestSuite(PopulationCodecTest.class);
- suite.addTestSuite(SegmentOptionsTest.class);
- suite.addTestSuite(SegmentTest.class);
- // $JUnit-END$
- return suite;
- }
-}
+/* Copyright 2004 The Apache Software Foundation or its licensors, as applicable
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.harmony.archive.tests.internal.pack200;
+
+import junit.framework.Test;
+import junit.framework.TestSuite;
+
+/**
+ * Test suite for org.apache.harmony.archive.internal.pack200 package.
+ */
+public class AllTests {
+
+ public static void main(String[] args) {
+ junit.textui.TestRunner.run(suite());
+ }
+
+ public static Test suite() {
+ TestSuite suite = new TestSuite(
+ "Suite org.apache.harmony.archive.tests.internal.pack200");
+ // $JUnit-BEGIN$
+ suite.addTestSuite(CodecEncodingTest.class);
+ suite.addTestSuite(CodecTest.class);
+ suite.addTestSuite(PopulationCodecTest.class);
+ suite.addTestSuite(SegmentOptionsTest.class);
+ suite.addTestSuite(SegmentTest.class);
+ // $JUnit-END$
+ return suite;
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/AllTests.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/CodecEncodingTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/CodecEncodingTest.java?view=diff&rev=446478&r1=446477&r2=446478
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/CodecEncodingTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/CodecEncodingTest.java Thu Sep 14 19:40:33 2006
@@ -1,165 +1,165 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.harmony.archive.tests.internal.pack200;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.util.HashMap;
-import java.util.Map;
-
-import junit.framework.TestCase;
-
-import org.apache.harmony.archive.internal.pack200.BHSDCodec;
-import org.apache.harmony.archive.internal.pack200.Codec;
-import org.apache.harmony.archive.internal.pack200.CodecEncoding;
-import org.apache.harmony.archive.internal.pack200.Pack200Exception;
-
-/**
- * @author Alex Blewitt
- * @version $Revision: $
- */
-public class CodecEncodingTest extends TestCase {
- public void testCanonicalEncodings() throws IOException, Pack200Exception {
- Codec defaultCodec = new BHSDCodec(2,16,0,0);
- assertEquals(defaultCodec,CodecEncoding.getCodec(0,null, defaultCodec));
- Map map = new HashMap();
- // These are the canonical encodings specified by the Pack200 spec
- map.put(new Integer(1), "(1,256)");
- map.put(new Integer(2), "(1,256,1)");
- map.put(new Integer(3), "(1,256,0,1)");
- map.put(new Integer(4), "(1,256,1,1)");
- map.put(new Integer(5), "(2,256)");
- map.put(new Integer(6), "(2,256,1)");
- map.put(new Integer(7), "(2,256,0,1)");
- map.put(new Integer(8), "(2,256,1,1)");
- map.put(new Integer(9), "(3,256)");
- map.put(new Integer(10), "(3,256,1)");
- map.put(new Integer(11), "(3,256,0,1)");
- map.put(new Integer(12), "(3,256,1,1)");
- map.put(new Integer(13), "(4,256)");
- map.put(new Integer(14), "(4,256,1)");
- map.put(new Integer(15), "(4,256,0,1)");
- map.put(new Integer(16), "(4,256,1,1)");
- map.put(new Integer(17), "(5,4)");
- map.put(new Integer(18), "(5,4,1)");
- map.put(new Integer(19), "(5,4,2)");
- map.put(new Integer(20), "(5,16)");
- map.put(new Integer(21), "(5,16,1)");
- map.put(new Integer(22), "(5,16,2)");
- map.put(new Integer(23), "(5,32)");
- map.put(new Integer(24), "(5,32,1)");
- map.put(new Integer(25), "(5,32,2)");
- map.put(new Integer(26), "(5,64)");
- map.put(new Integer(27), "(5,64,1)");
- map.put(new Integer(28), "(5,64,2)");
- map.put(new Integer(29), "(5,128)");
- map.put(new Integer(30), "(5,128,1)");
- map.put(new Integer(31), "(5,128,2)");
- map.put(new Integer(32), "(5,4,0,1)");
- map.put(new Integer(33), "(5,4,1,1)");
- map.put(new Integer(34), "(5,4,2,1)");
- map.put(new Integer(35), "(5,16,0,1)");
- map.put(new Integer(36), "(5,16,1,1)");
- map.put(new Integer(37), "(5,16,2,1)");
- map.put(new Integer(38), "(5,32,0,1)");
- map.put(new Integer(39), "(5,32,1,1)");
- map.put(new Integer(40), "(5,32,2,1)");
- map.put(new Integer(41), "(5,64,0,1)");
- map.put(new Integer(42), "(5,64,1,1)");
- map.put(new Integer(43), "(5,64,2,1)");
- map.put(new Integer(44), "(5,128,0,1)");
- map.put(new Integer(45), "(5,128,1,1)");
- map.put(new Integer(46), "(5,128,2,1)");
- map.put(new Integer(47), "(2,192)");
- map.put(new Integer(48), "(2,224)");
- map.put(new Integer(49), "(2,240)");
- map.put(new Integer(50), "(2,248)");
- map.put(new Integer(51), "(2,252)");
- map.put(new Integer(52), "(2,8,0,1)");
- map.put(new Integer(53), "(2,8,1,1)");
- map.put(new Integer(54), "(2,16,0,1)");
- map.put(new Integer(55), "(2,16,1,1)");
- map.put(new Integer(56), "(2,32,0,1)");
- map.put(new Integer(57), "(2,32,1,1)");
- map.put(new Integer(58), "(2,64,0,1)");
- map.put(new Integer(59), "(2,64,1,1)");
- map.put(new Integer(60), "(2,128,0,1)");
- map.put(new Integer(61), "(2,128,1,1)");
- map.put(new Integer(62), "(2,192,0,1)");
- map.put(new Integer(63), "(2,192,1,1)");
- map.put(new Integer(64), "(2,224,0,1)");
- map.put(new Integer(65), "(2,224,1,1)");
- map.put(new Integer(66), "(2,240,0,1)");
- map.put(new Integer(67), "(2,240,1,1)");
- map.put(new Integer(68), "(2,248,0,1)");
- map.put(new Integer(69), "(2,248,1,1)");
- map.put(new Integer(70), "(3,192)");
- map.put(new Integer(71), "(3,224)");
- map.put(new Integer(72), "(3,240)");
- map.put(new Integer(73), "(3,248)");
- map.put(new Integer(74), "(3,252)");
- map.put(new Integer(75), "(3,8,0,1)");
- map.put(new Integer(76), "(3,8,1,1)");
- map.put(new Integer(77), "(3,16,0,1)");
- map.put(new Integer(78), "(3,16,1,1)");
- map.put(new Integer(79), "(3,32,0,1)");
- map.put(new Integer(80), "(3,32,1,1)");
- map.put(new Integer(81), "(3,64,0,1)");
- map.put(new Integer(82), "(3,64,1,1)");
- map.put(new Integer(83), "(3,128,0,1)");
- map.put(new Integer(84), "(3,128,1,1)");
- map.put(new Integer(85), "(3,192,0,1)");
- map.put(new Integer(86), "(3,192,1,1)");
- map.put(new Integer(87), "(3,224,0,1)");
- map.put(new Integer(88), "(3,224,1,1)");
- map.put(new Integer(89), "(3,240,0,1)");
- map.put(new Integer(90), "(3,240,1,1)");
- map.put(new Integer(91), "(3,248,0,1)");
- map.put(new Integer(92), "(3,248,1,1)");
- map.put(new Integer(93), "(4,192)");
- map.put(new Integer(94), "(4,224)");
- map.put(new Integer(95), "(4,240)");
- map.put(new Integer(96), "(4,248)");
- map.put(new Integer(97), "(4,252)");
- map.put(new Integer(98), "(4,8,0,1)");
- map.put(new Integer(99), "(4,8,1,1)");
- map.put(new Integer(100), "(4,16,0,1)");
- map.put(new Integer(101), "(4,16,1,1)");
- map.put(new Integer(102), "(4,32,0,1)");
- map.put(new Integer(103), "(4,32,1,1)");
- map.put(new Integer(104), "(4,64,0,1)");
- map.put(new Integer(105), "(4,64,1,1)");
- map.put(new Integer(106), "(4,128,0,1)");
- map.put(new Integer(107), "(4,128,1,1)");
- map.put(new Integer(108), "(4,192,0,1)");
- map.put(new Integer(109), "(4,192,1,1)");
- map.put(new Integer(110), "(4,224,0,1)");
- map.put(new Integer(111), "(4,224,1,1)");
- map.put(new Integer(112), "(4,240,0,1)");
- map.put(new Integer(113), "(4,240,1,1)");
- map.put(new Integer(114), "(4,248,0,1)");
- map.put(new Integer(115), "(4,248,1,1)");
- for(int i=1;i<=115;i++) {
- assertEquals(map.get(new Integer(i)),CodecEncoding.getCodec(i,null, null).toString());
- }
- }
- public void testArbitraryCodec() throws IOException, Pack200Exception {
- assertEquals("(1,256)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x00, (byte)0xFF}), null).toString());
- assertEquals("(5,128,2,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x25, (byte)0x7F}), null).toString());
- assertEquals("(2,128,1,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x0B, (byte)0x7F}), null).toString());
- }
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.harmony.archive.tests.internal.pack200;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.util.HashMap;
+import java.util.Map;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.archive.internal.pack200.BHSDCodec;
+import org.apache.harmony.archive.internal.pack200.Codec;
+import org.apache.harmony.archive.internal.pack200.CodecEncoding;
+import org.apache.harmony.archive.internal.pack200.Pack200Exception;
+
+/**
+ * @author Alex Blewitt
+ * @version $Revision: $
+ */
+public class CodecEncodingTest extends TestCase {
+ public void testCanonicalEncodings() throws IOException, Pack200Exception {
+ Codec defaultCodec = new BHSDCodec(2,16,0,0);
+ assertEquals(defaultCodec,CodecEncoding.getCodec(0,null, defaultCodec));
+ Map map = new HashMap();
+ // These are the canonical encodings specified by the Pack200 spec
+ map.put(new Integer(1), "(1,256)");
+ map.put(new Integer(2), "(1,256,1)");
+ map.put(new Integer(3), "(1,256,0,1)");
+ map.put(new Integer(4), "(1,256,1,1)");
+ map.put(new Integer(5), "(2,256)");
+ map.put(new Integer(6), "(2,256,1)");
+ map.put(new Integer(7), "(2,256,0,1)");
+ map.put(new Integer(8), "(2,256,1,1)");
+ map.put(new Integer(9), "(3,256)");
+ map.put(new Integer(10), "(3,256,1)");
+ map.put(new Integer(11), "(3,256,0,1)");
+ map.put(new Integer(12), "(3,256,1,1)");
+ map.put(new Integer(13), "(4,256)");
+ map.put(new Integer(14), "(4,256,1)");
+ map.put(new Integer(15), "(4,256,0,1)");
+ map.put(new Integer(16), "(4,256,1,1)");
+ map.put(new Integer(17), "(5,4)");
+ map.put(new Integer(18), "(5,4,1)");
+ map.put(new Integer(19), "(5,4,2)");
+ map.put(new Integer(20), "(5,16)");
+ map.put(new Integer(21), "(5,16,1)");
+ map.put(new Integer(22), "(5,16,2)");
+ map.put(new Integer(23), "(5,32)");
+ map.put(new Integer(24), "(5,32,1)");
+ map.put(new Integer(25), "(5,32,2)");
+ map.put(new Integer(26), "(5,64)");
+ map.put(new Integer(27), "(5,64,1)");
+ map.put(new Integer(28), "(5,64,2)");
+ map.put(new Integer(29), "(5,128)");
+ map.put(new Integer(30), "(5,128,1)");
+ map.put(new Integer(31), "(5,128,2)");
+ map.put(new Integer(32), "(5,4,0,1)");
+ map.put(new Integer(33), "(5,4,1,1)");
+ map.put(new Integer(34), "(5,4,2,1)");
+ map.put(new Integer(35), "(5,16,0,1)");
+ map.put(new Integer(36), "(5,16,1,1)");
+ map.put(new Integer(37), "(5,16,2,1)");
+ map.put(new Integer(38), "(5,32,0,1)");
+ map.put(new Integer(39), "(5,32,1,1)");
+ map.put(new Integer(40), "(5,32,2,1)");
+ map.put(new Integer(41), "(5,64,0,1)");
+ map.put(new Integer(42), "(5,64,1,1)");
+ map.put(new Integer(43), "(5,64,2,1)");
+ map.put(new Integer(44), "(5,128,0,1)");
+ map.put(new Integer(45), "(5,128,1,1)");
+ map.put(new Integer(46), "(5,128,2,1)");
+ map.put(new Integer(47), "(2,192)");
+ map.put(new Integer(48), "(2,224)");
+ map.put(new Integer(49), "(2,240)");
+ map.put(new Integer(50), "(2,248)");
+ map.put(new Integer(51), "(2,252)");
+ map.put(new Integer(52), "(2,8,0,1)");
+ map.put(new Integer(53), "(2,8,1,1)");
+ map.put(new Integer(54), "(2,16,0,1)");
+ map.put(new Integer(55), "(2,16,1,1)");
+ map.put(new Integer(56), "(2,32,0,1)");
+ map.put(new Integer(57), "(2,32,1,1)");
+ map.put(new Integer(58), "(2,64,0,1)");
+ map.put(new Integer(59), "(2,64,1,1)");
+ map.put(new Integer(60), "(2,128,0,1)");
+ map.put(new Integer(61), "(2,128,1,1)");
+ map.put(new Integer(62), "(2,192,0,1)");
+ map.put(new Integer(63), "(2,192,1,1)");
+ map.put(new Integer(64), "(2,224,0,1)");
+ map.put(new Integer(65), "(2,224,1,1)");
+ map.put(new Integer(66), "(2,240,0,1)");
+ map.put(new Integer(67), "(2,240,1,1)");
+ map.put(new Integer(68), "(2,248,0,1)");
+ map.put(new Integer(69), "(2,248,1,1)");
+ map.put(new Integer(70), "(3,192)");
+ map.put(new Integer(71), "(3,224)");
+ map.put(new Integer(72), "(3,240)");
+ map.put(new Integer(73), "(3,248)");
+ map.put(new Integer(74), "(3,252)");
+ map.put(new Integer(75), "(3,8,0,1)");
+ map.put(new Integer(76), "(3,8,1,1)");
+ map.put(new Integer(77), "(3,16,0,1)");
+ map.put(new Integer(78), "(3,16,1,1)");
+ map.put(new Integer(79), "(3,32,0,1)");
+ map.put(new Integer(80), "(3,32,1,1)");
+ map.put(new Integer(81), "(3,64,0,1)");
+ map.put(new Integer(82), "(3,64,1,1)");
+ map.put(new Integer(83), "(3,128,0,1)");
+ map.put(new Integer(84), "(3,128,1,1)");
+ map.put(new Integer(85), "(3,192,0,1)");
+ map.put(new Integer(86), "(3,192,1,1)");
+ map.put(new Integer(87), "(3,224,0,1)");
+ map.put(new Integer(88), "(3,224,1,1)");
+ map.put(new Integer(89), "(3,240,0,1)");
+ map.put(new Integer(90), "(3,240,1,1)");
+ map.put(new Integer(91), "(3,248,0,1)");
+ map.put(new Integer(92), "(3,248,1,1)");
+ map.put(new Integer(93), "(4,192)");
+ map.put(new Integer(94), "(4,224)");
+ map.put(new Integer(95), "(4,240)");
+ map.put(new Integer(96), "(4,248)");
+ map.put(new Integer(97), "(4,252)");
+ map.put(new Integer(98), "(4,8,0,1)");
+ map.put(new Integer(99), "(4,8,1,1)");
+ map.put(new Integer(100), "(4,16,0,1)");
+ map.put(new Integer(101), "(4,16,1,1)");
+ map.put(new Integer(102), "(4,32,0,1)");
+ map.put(new Integer(103), "(4,32,1,1)");
+ map.put(new Integer(104), "(4,64,0,1)");
+ map.put(new Integer(105), "(4,64,1,1)");
+ map.put(new Integer(106), "(4,128,0,1)");
+ map.put(new Integer(107), "(4,128,1,1)");
+ map.put(new Integer(108), "(4,192,0,1)");
+ map.put(new Integer(109), "(4,192,1,1)");
+ map.put(new Integer(110), "(4,224,0,1)");
+ map.put(new Integer(111), "(4,224,1,1)");
+ map.put(new Integer(112), "(4,240,0,1)");
+ map.put(new Integer(113), "(4,240,1,1)");
+ map.put(new Integer(114), "(4,248,0,1)");
+ map.put(new Integer(115), "(4,248,1,1)");
+ for(int i=1;i<=115;i++) {
+ assertEquals(map.get(new Integer(i)),CodecEncoding.getCodec(i,null, null).toString());
+ }
+ }
+ public void testArbitraryCodec() throws IOException, Pack200Exception {
+ assertEquals("(1,256)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x00, (byte)0xFF}), null).toString());
+ assertEquals("(5,128,2,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x25, (byte)0x7F}), null).toString());
+ assertEquals("(2,128,1,1)",CodecEncoding.getCodec(116,new ByteArrayInputStream(new byte[] { 0x0B, (byte)0x7F}), null).toString());
+ }
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/CodecEncodingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/PopulationCodecTest.java
URL: http://svn.apache.org/viewvc/incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/PopulationCodecTest.java?view=diff&rev=446478&r1=446477&r2=446478
==============================================================================
--- incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/PopulationCodecTest.java (original)
+++ incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/PopulationCodecTest.java Thu Sep 14 19:40:33 2006
@@ -1,56 +1,56 @@
-/*
- * Copyright 2006 The Apache Software Foundation or its licensors,
- * as applicable.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.harmony.archive.tests.internal.pack200;
-
-import java.io.ByteArrayInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-
-import junit.framework.TestCase;
-
-import org.apache.harmony.archive.internal.pack200.Codec;
-import org.apache.harmony.archive.internal.pack200.Pack200Exception;
-import org.apache.harmony.archive.internal.pack200.PopulationCodec;
-
-public class PopulationCodecTest extends TestCase {
- public void testPopulationCodec() throws IOException, Pack200Exception {
- checkDecode(new byte[] { 4,5,6,4,2,1,3,0,7 }, new long[]{ 5,4,6,7 }, Codec.BYTE1);
- // Codec.SIGNED5 can be trivial for small n, because the encoding is 2n if even, 2n-1 if odd
- // Therefore they're left here to explain what the values are :-)
- checkDecode(new byte[] { 4*2,4*2-1,6*2,4*2,2*2,1*2,3*2,0,7*2 }, new long[]{ -4,4,6,7 }, Codec.SIGNED5);
- checkDecode(new byte[] { 4*2-1,4*2,6*2,4*2,2*2,1*2,3*2,0,7*2 }, new long[]{ 4,-4,6,7 }, Codec.SIGNED5);
- checkDecode(new byte[] { 1,1,1 }, new long[]{ 1 }, Codec.BYTE1);
- checkDecode(new byte[] { 2,2,1 }, new long[]{ 2 }, Codec.BYTE1);
- checkDecode(new byte[] { 1,1,2 }, new long[]{ -1 }, Codec.SIGNED5);
- checkDecode(new byte[] { 2,2,0,1,3 }, new long[]{ 3,2 }, Codec.BYTE1);
- checkDecode(new byte[] { 1,2,3,4,4,2,3,4,0,1 }, new long[]{ 2,3,4,1 }, Codec.BYTE1);
- checkDecode(new byte[] { 3,2,1,4,4,2,3,4,0,1 }, new long[]{ 2,1,4,1 }, Codec.BYTE1);
- checkDecode(new byte[] { 3,2,1,4,1,2,3,4,0,1 }, new long[]{ 2,1,4,1 }, Codec.BYTE1);
- }
-
- private void checkDecode(byte[] data, long[] expectedResult, Codec codec) throws IOException, Pack200Exception {
- InputStream in = new ByteArrayInputStream(data );
-
- long[] result = new PopulationCodec(codec,codec,codec).decode(expectedResult.length,in);
- assertEquals(expectedResult.length,result.length);
- for(int i=0;i<expectedResult.length;i++) {
- assertEquals(expectedResult[i],result[i]);
- }
- assertEquals(0,in.available());
- }
-
-}
+/*
+ * Copyright 2006 The Apache Software Foundation or its licensors,
+ * as applicable.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.harmony.archive.tests.internal.pack200;
+
+import java.io.ByteArrayInputStream;
+import java.io.IOException;
+import java.io.InputStream;
+
+import junit.framework.TestCase;
+
+import org.apache.harmony.archive.internal.pack200.Codec;
+import org.apache.harmony.archive.internal.pack200.Pack200Exception;
+import org.apache.harmony.archive.internal.pack200.PopulationCodec;
+
+public class PopulationCodecTest extends TestCase {
+ public void testPopulationCodec() throws IOException, Pack200Exception {
+ checkDecode(new byte[] { 4,5,6,4,2,1,3,0,7 }, new long[]{ 5,4,6,7 }, Codec.BYTE1);
+ // Codec.SIGNED5 can be trivial for small n, because the encoding is 2n if even, 2n-1 if odd
+ // Therefore they're left here to explain what the values are :-)
+ checkDecode(new byte[] { 4*2,4*2-1,6*2,4*2,2*2,1*2,3*2,0,7*2 }, new long[]{ -4,4,6,7 }, Codec.SIGNED5);
+ checkDecode(new byte[] { 4*2-1,4*2,6*2,4*2,2*2,1*2,3*2,0,7*2 }, new long[]{ 4,-4,6,7 }, Codec.SIGNED5);
+ checkDecode(new byte[] { 1,1,1 }, new long[]{ 1 }, Codec.BYTE1);
+ checkDecode(new byte[] { 2,2,1 }, new long[]{ 2 }, Codec.BYTE1);
+ checkDecode(new byte[] { 1,1,2 }, new long[]{ -1 }, Codec.SIGNED5);
+ checkDecode(new byte[] { 2,2,0,1,3 }, new long[]{ 3,2 }, Codec.BYTE1);
+ checkDecode(new byte[] { 1,2,3,4,4,2,3,4,0,1 }, new long[]{ 2,3,4,1 }, Codec.BYTE1);
+ checkDecode(new byte[] { 3,2,1,4,4,2,3,4,0,1 }, new long[]{ 2,1,4,1 }, Codec.BYTE1);
+ checkDecode(new byte[] { 3,2,1,4,1,2,3,4,0,1 }, new long[]{ 2,1,4,1 }, Codec.BYTE1);
+ }
+
+ private void checkDecode(byte[] data, long[] expectedResult, Codec codec) throws IOException, Pack200Exception {
+ InputStream in = new ByteArrayInputStream(data );
+
+ long[] result = new PopulationCodec(codec,codec,codec).decode(expectedResult.length,in);
+ assertEquals(expectedResult.length,result.length);
+ for(int i=0;i<expectedResult.length;i++) {
+ assertEquals(expectedResult[i],result[i]);
+ }
+ assertEquals(0,in.available());
+ }
+
+}
Propchange: incubator/harmony/enhanced/classlib/trunk/modules/archive/src/test/java/org/apache/harmony/archive/tests/internal/pack200/PopulationCodecTest.java
------------------------------------------------------------------------------
svn:eol-style = native