harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r996799 [2/2] - in /harmony/enhanced/java/branches/mrh: ./ classlib/ classlib/modules/archive/src/main/java/java/util/zip/ classlib/modules/archive/src/test/java/org/apache/harmony/archive/tests/java/util/zip/ classlib/modules/awt/make/ cla...
Date Tue, 14 Sep 2010 08:56:47 GMT
Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/CodecTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/CodecTest.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/CodecTest.java
(original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/CodecTest.java
Tue Sep 14 08:56:45 2010
@@ -165,23 +165,6 @@ public class CodecTest extends TestCase 
         assertFalse(byte2s.encodes(256));
     }
 
-    public void testRunCodec() throws Exception {
-        RunCodec runCodec = new RunCodec(1, Codec.UNSIGNED5, Codec.BYTE1);
-        ByteArrayInputStream bais = new ByteArrayInputStream(new byte[] {
-                (byte) 192, 0, (byte) 192, 0 });
-        assertEquals(192, runCodec.decode(bais));
-        assertEquals(192, runCodec.decode(bais));
-        assertEquals(0, runCodec.decode(bais));
-        assertEquals(0, bais.available());
-        runCodec = new RunCodec(1, Codec.BYTE1, Codec.UNSIGNED5);
-        bais = new ByteArrayInputStream(new byte[] { (byte) 192, 0, (byte) 192,
-                0 });
-        assertEquals(192, runCodec.decode(bais));
-        assertEquals(0, runCodec.decode(bais));
-        assertEquals(192, runCodec.decode(bais));
-        assertEquals(0, bais.available());
-    }
-
     public void testUnsigned5() throws Exception {
         decode(Codec.UNSIGNED5, new byte[] { 1 }, 1, 0);
         decode(Codec.UNSIGNED5, new byte[] { (byte) 191 }, 191, 0);

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java
(original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/pack200/tests/PopulationCodecTest.java
Tue Sep 14 08:56:45 2010
@@ -22,6 +22,7 @@ import java.io.InputStream;
 
 import junit.framework.TestCase;
 
+import org.apache.harmony.pack200.BHSDCodec;
 import org.apache.harmony.pack200.Codec;
 import org.apache.harmony.pack200.Pack200Exception;
 import org.apache.harmony.pack200.PopulationCodec;
@@ -63,5 +64,20 @@ public class PopulationCodecTest extends
         }
         assertEquals(0, in.available());
     }
+    
+    public void testEncodeSingleValue() {
+        try {
+            new PopulationCodec(BHSDCodec.SIGNED5, BHSDCodec.SIGNED5, BHSDCodec.UDELTA5).encode(5);
+            fail("Should not allow a single value to be encoded as we don't know which codec
to use");
+        } catch (Pack200Exception e) {
+            // pass
+        }
+        try {
+            new PopulationCodec(BHSDCodec.SIGNED5, BHSDCodec.SIGNED5, BHSDCodec.UDELTA5).encode(5,
8);
+            fail("Should not allow a single value to be encoded as we don't know which codec
to use");
+        } catch (Pack200Exception e) {
+            // pass
+        }
+    }
 
 }

Modified: harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutMapTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutMapTest.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutMapTest.java
(original)
+++ harmony/enhanced/java/branches/mrh/classlib/modules/pack200/src/test/java/org/apache/harmony/unpack200/tests/AttributeLayoutMapTest.java
Tue Sep 14 08:56:45 2010
@@ -31,14 +31,15 @@ public class AttributeLayoutMapTest exte
                 AttributeLayout.CONTEXT_CLASS);
         assertNotNull(layout);
         assertEquals("RUNH", layout.getLayout());
+        assertEquals(17, layout.getIndex());
         // and that we can change it
         a.add(new AttributeLayout("SourceFile", AttributeLayout.CONTEXT_CLASS,
-                "FROG", 15));
+                "FROG", 17));
         layout = a.getAttributeLayout("SourceFile",
                 AttributeLayout.CONTEXT_CLASS);
         assertNotNull(layout);
         assertEquals("FROG", layout.getLayout());
-        assertTrue(layout.matches(1 << 15));
+        assertTrue(layout.matches(1 << 17));
         assertFalse(layout.matches(1 << 16));
         assertTrue(layout.matches(-1));
         assertFalse(layout.matches(0));

Modified: harmony/enhanced/java/branches/mrh/classlib/support/src/test/java/tests/support/Support_NetworkInterface.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/classlib/support/src/test/java/tests/support/Support_NetworkInterface.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/classlib/support/src/test/java/tests/support/Support_NetworkInterface.java
(original)
+++ harmony/enhanced/java/branches/mrh/classlib/support/src/test/java/tests/support/Support_NetworkInterface.java
Tue Sep 14 08:56:45 2010
@@ -38,10 +38,18 @@ public class Support_NetworkInterface {
 					|| (theInterface.getDisplayName()
 							.equals("Automatic Tunneling Pseudo-Interface"))
 					|| (theInterface.getDisplayName()
-							.equals("Loopback Pseudo-Interface"))) {
+							.equals("Loopback Pseudo-Interface"))
+					|| (theInterface.getDisplayName().equals("MS TCP Loopback interface"))) {
 				result = false;
 			}
 		}
-		return result;
+
+        if (platform.startsWith("Linux")) {
+            if ((theInterface.getDisplayName().equals("lo"))
+                    || (theInterface.getDisplayName().equals("teredo"))) {
+                result = false;
+            }
+        }
+        return result;
 	}
 }

Propchange: harmony/enhanced/java/branches/mrh/common_resources/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 14 08:56:45 2010
@@ -1,4 +1,4 @@
 /harmony/enhanced/java/branches/mrh/common_resources:935751
-/harmony/enhanced/java/trunk/common_resources:935751-986356
+/harmony/enhanced/java/trunk/common_resources:935751-996687
 /harmony/enhanced/trunk/common_resources:476395-921782
 /incubator/harmony/enhanced/trunk/common_resources:292550-476394

Modified: harmony/enhanced/java/branches/mrh/common_resources/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/common_resources/make/depends.properties?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/common_resources/make/depends.properties (original)
+++ harmony/enhanced/java/branches/mrh/common_resources/make/depends.properties Tue Sep 14
08:56:45 2010
@@ -37,7 +37,7 @@ ecj.jar.md5=3ad7eff5648879a38729d6790229
 cpptasks=${depends.jars}/cpptasks-1.0b4/cpptasks.zip
 cpptasks.jar=${depends.jars}/cpptasks-1.0b4/cpptasks.jar
 cpptasks.unzip.path=cpptasks-1.0b4/cpptasks.jar
-cpptasks.url=http://internap.dl.sourceforge.net/sourceforge/ant-contrib/cpptasks-1.0b4.zip
+cpptasks.url=http://dfn.dl.sourceforge.net/sourceforge/ant-contrib/cpptasks-1.0b4.zip
 cpptasks.md5=118e601b58a48519208efa9893c7c5c0
 
 icuhdr=${depends.oss}/icu4c/icu4c-3.4-harmony-includes.zip
@@ -69,7 +69,7 @@ icudll.md5@freebsd.x86_64.8x@=3d76c796e7
 ############################## TO SORT OUT ##############################
 
 
-sf.base=http://internap.dl.sourceforge.net/sourceforge
+sf.base=http://dfn.dl.sourceforge.net/sourceforge
 
 xalan.dir=${depends.jars}/xalan-j_2.7.0
 xalan.jar=${xalan.dir}/xalan.jar

Modified: harmony/enhanced/java/branches/mrh/debian/changelog
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/debian/changelog?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/debian/changelog (original)
+++ harmony/enhanced/java/branches/mrh/debian/changelog Tue Sep 14 08:56:45 2010
@@ -1,3 +1,9 @@
+harmony-5.0 (0.0r991518-1) unstable; urgency=low
+
+  * Milestone 15 release.
+
+ -- Mark Hindess <mark.hindess@googlemail.com>  Tue,  6 Sep 2010 18:17:03 +0100
+
 harmony-5.0 (0.0r946978-1) unstable; urgency=low
 
   * Milestone 14 release.

Propchange: harmony/enhanced/java/branches/mrh/drlvm/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Tue Sep 14 08:56:45 2010
@@ -1,5 +1,5 @@
 /harmony/enhanced/java/branches/mrh/drlvm:935751
-/harmony/enhanced/java/trunk/drlvm:935751-986356
+/harmony/enhanced/java/trunk/drlvm:935751-996687
 /harmony/enhanced/trunk/drlvm:476395-926313
 /harmony/enhanced/trunk/working_vm:476396-920147
 /incubator/harmony/enhanced/trunk/working_vm:423974-476394

Modified: harmony/enhanced/java/branches/mrh/drlvm/make/depends.properties
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/drlvm/make/depends.properties?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/drlvm/make/depends.properties (original)
+++ harmony/enhanced/java/branches/mrh/drlvm/make/depends.properties Tue Sep 14 08:56:45 2010
@@ -42,5 +42,5 @@ ant-contrib.md5=c5a75fc28cbc52f09bd43b55
 jasmin=${depends.jars}/jasmin-1.1/jasmin-1.1.zip
 jasmin.jar=${depends.jars}/jasmin-1.1/jasmin.jar
 jasmin.unzip.path=jasmin-1.1/jasmin.jar
-jasmin.url=http://internap.dl.sourceforge.net/sourceforge/jasmin/jasmin-1.1.zip
+jasmin.url=http://dfn.dl.sourceforge.net/sourceforge/jasmin/jasmin-1.1.zip
 jasmin.md5=bb96616023ab4efdffa173601004fa17

Modified: harmony/enhanced/java/branches/mrh/drlvm/modules/vm/src/main/native/port/unix/thread/thread_os.c
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/drlvm/modules/vm/src/main/native/port/unix/thread/thread_os.c?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/drlvm/modules/vm/src/main/native/port/unix/thread/thread_os.c
(original)
+++ harmony/enhanced/java/branches/mrh/drlvm/modules/vm/src/main/native/port/unix/thread/thread_os.c
Tue Sep 14 08:56:45 2010
@@ -226,7 +226,10 @@ int set_alt_stack(port_tls_data_t* tlsda
 //#else
 //    sigalt.ss_flags = set ? SS_ONSTACK : SS_DISABLE;
 //#endif
-    return sigaltstack(&sigalt, NULL);
+    if (sigaltstack(&sigalt, NULL) != 0)
+        return errno;
+
+    return 0;
 }
 
 static int set_guard_page(port_tls_data_t* tlsdata, Boolean set)
@@ -257,7 +260,7 @@ static int set_guard_page(port_tls_data_
         res = set_alt_stack(tlsdata, TRUE);
 
         if (res != 0)
-            return errno;
+            return res;
     }
 
     tlsdata->guard_page_set = set;
@@ -317,17 +320,17 @@ static int setup_stack(port_tls_data_t* 
     int res;
     void* ptr;
     stack_t sigalt;
-    size_t current_page_addr, mapping_addr, mapping_size;
+    size_t /*current_page_addr,*/ mapping_addr, mapping_size;
 
     if (!port_shared_data)
         return -1;
 
-    current_page_addr = ((size_t)&res) & ~(PSD->guard_page_size - 1);
+//    current_page_addr = ((size_t)&res) & ~(PSD->guard_page_size - 1);
     // leave place for mmap work
-    mapping_addr = current_page_addr - PSD->guard_page_size;
+//    mapping_addr = current_page_addr - PSD->guard_page_size;
     // found size of the stack area which should be maped
-    mapping_size = tlsdata->stack_size
-            - ((size_t)tlsdata->stack_addr - mapping_addr);
+//    mapping_size = tlsdata->stack_size
+//            - ((size_t)tlsdata->stack_addr - mapping_addr);
 
     if ((size_t)(&res) - PSD->mem_protect_size
             < (size_t)tlsdata->guard_page_addr + tlsdata->guard_page_size)
@@ -347,7 +350,7 @@ static int setup_stack(port_tls_data_t* 
     res = set_guard_page(tlsdata, TRUE);
 
     if (res != 0)
-        return errno;
+        return res;
 
     return 0;
 }
@@ -493,6 +496,12 @@ int port_thread_detach()
     if (res != 0)
         return res;
 
+    size_t mapping_addr = (size_t)tlsdata->stack_addr - tlsdata->stack_size;
+    size_t mapping_size =
+        (tlsdata->guard_stack_size + tlsdata->mem_protect_size + 2*PSD->guard_page_size
- 1) &
+            ~(PSD->guard_page_size - 1);
+    munmap((void*)mapping_addr, mapping_size);
+
     if (tlsdata->foreign)
         STD_FREE(tlsdata);
 

Modified: harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
(original)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jdktools/src/main/java/org/apache/harmony/tools/keytool/ArgumentsParser.java
Tue Sep 14 08:56:45 2010
@@ -49,9 +49,10 @@ class ArgumentsParser {
     // maximum number of attempts to set the password
     static int maxNrOfAttempts = 3;
 
-    // length of the "\r\n" which is added to the end of the line,
-    // when ENTER is pressed.
-    private static int newLineLength = 2;
+    // length of the newline which is added to the end of the line
+    // when ENTER is pressed - on windows this is "\r\n", otherwise "\n"
+    private static int newLineLength = 
+        (File.separatorChar == '\\') ? 2 : 1;
 
     // options names to compare to //
     // commands
@@ -316,10 +317,18 @@ class ArgumentsParser {
                 }
                 if (args[i].compareToIgnoreCase(sStorepass) == 0) {
                     param.setStorePass(args[++i].toCharArray());
+                    if (param.getStorePass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sKeypass) == 0) {
                     param.setKeyPass(args[++i].toCharArray());
+                    if (param.getKeyPass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sIssuerPass) == 0) {

Modified: harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
(original)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/main/java/org/apache/harmony/jretools/keytool/ArgumentsParser.java
Tue Sep 14 08:56:45 2010
@@ -49,9 +49,10 @@ class ArgumentsParser {
     // maximum number of attempts to set the password
     static int maxNrOfAttempts = 3;
 
-    // length of the "\r\n" which is added to the end of the line,
-    // when ENTER is pressed.
-    private static int newLineLength = 2;
+    // length of the newline which is added to the end of the line
+    // when ENTER is pressed - on windows this is "\r\n", otherwise "\n"
+    private static int newLineLength = 
+        (File.separatorChar == '\\') ? 2 : 1;
 
     // options names to compare to //
     // commands
@@ -316,10 +317,18 @@ class ArgumentsParser {
                 }
                 if (args[i].compareToIgnoreCase(sStorepass) == 0) {
                     param.setStorePass(args[++i].toCharArray());
+                    if (param.getStorePass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sKeypass) == 0) {
                     param.setKeyPass(args[++i].toCharArray());
+                    if (param.getKeyPass().length < minPwdLength) {
+                        throw new KeytoolException("The password must be at least "
+                                + minPwdLength + " characters");
+                    }
                     continue;
                 }
                 if (args[i].compareToIgnoreCase(sIssuerPass) == 0) {

Modified: harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java?rev=996799&r1=996798&r2=996799&view=diff
==============================================================================
--- harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
(original)
+++ harmony/enhanced/java/branches/mrh/jdktools/modules/jretools/src/test/java/org/apache/harmony/jretools/tests/keytool/GenKeyTest.java
Tue Sep 14 08:56:45 2010
@@ -238,6 +238,32 @@ public class GenKeyTest extends TestCase
             }
             // set normal issuer alias back
             args[26] = issuerAlias;
+            
+            // bad store password length
+            args[4] = "12345";
+            try {
+                Main.run(args);
+                fail(excNotThrown);
+            } catch (KeytoolException ok) {
+                assertNotNull(ok.getMessage());
+                assertTrue("Expected password length error, got: " + 
+                        ok.getMessage(), 
+                        ok.getMessage().contains("The password must be at least"));
+            }
+            args[4] = TestUtils.ksPass;
+            
+            // bad key password length
+            args[10] = "12345";
+            try {
+                Main.run(args);
+                fail(excNotThrown);
+            } catch (KeytoolException ok) {
+                assertNotNull(ok.getMessage());
+                assertTrue("Expected password length error, got: " + 
+                        ok.getMessage(), 
+                        ok.getMessage().contains("The password must be at least"));
+            }
+            args[10] = TestUtils.keyPass;
         } finally {
             keyStoreFile.delete();
         }



Mime
View raw message