* Changed and added NegativeArraySizeException tests.
[cacao.git] / tests / regression / extest.java
index bb5802fdf6225af4087cf16681c336a47e2775fd..7efefb486b427d15d5e9460eabfe3d8b186b5ae4 100644 (file)
@@ -171,7 +171,7 @@ public class extest {
 
 
         try {
-            p("NegativeArraySizeException:");
+            p("NegativeArraySizeException (newarray):");
             int[] ia = new int[-1];
             failed();
         } catch (NegativeArraySizeException e) {
@@ -180,7 +180,7 @@ public class extest {
        }
 
         try {
-            p("NegativeArraySizeException:");
+            p("NegativeArraySizeException (newarray):");
             int[] ia = new int[-1];
             failed();
         } catch (NegativeArraySizeException e) {
@@ -188,6 +188,15 @@ public class extest {
            pstacktrace(e);
        }
 
+        try {
+            p("NegativeArraySizeException (multianewarray):");
+            int[][] ia = new int[1][-1];
+            failed();
+        } catch (NegativeArraySizeException e) {
+           ok();
+           pstacktrace(e);
+       }
+
         
         try {
             p("NullPointerException (only w/ -softnull):");
@@ -229,6 +238,16 @@ public class extest {
            pstacktrace(e);
        }
         
+        try {
+            p("OutOfMemoryError (multianewarray):");
+           /* 100 MB should be enough */
+           byte[][] ba = new byte[10 * 1024 * 1024][10 * 1024 * 1024];
+            failed();
+        } catch (OutOfMemoryError e) {
+           ok();
+           pstacktrace(e);
+       }
+        
        pln();