jdk/test/java/nio/Buffer/BasicFloat.java
changeset 1634 3871c2046043
parent 2 90ce3da70b43
child 1639 a97859015238
--- a/jdk/test/java/nio/Buffer/BasicFloat.java	Tue Nov 25 10:09:26 2008 -0800
+++ b/jdk/test/java/nio/Buffer/BasicFloat.java	Tue Nov 25 19:26:54 2008 +0000
@@ -31,6 +31,7 @@
 // -- This file was mechanically generated: Do not edit! -- //
 
 import java.nio.*;
+import java.lang.reflect.Method;
 
 
 public class BasicFloat
@@ -283,13 +284,41 @@
 
 
 
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
     private static void tryCatch(Buffer b, Class ex, Runnable thunk) {
         boolean caught = false;
         try {
             thunk.run();
         } catch (Throwable x) {
-            if (ex.isAssignableFrom(x.getClass()))
+            if (ex.isAssignableFrom(x.getClass())) {
                 caught = true;
+            } else {
+                fail(x.getMessage() + " not expected");
+            }
         }
         if (!caught)
             fail(ex.getName() + " not thrown", b);
@@ -356,7 +385,6 @@
 
         // Exceptions
 
-        boolean caught = false;
         relPut(b);
         b.limit(b.capacity() / 2);
         b.position(b.limit());
@@ -386,6 +414,14 @@
                     b.put(b.limit(), (float)42);
                 }});
 
+        tryCatch(b, InvalidMarkException.class, new Runnable() {
+                public void run() {
+                    b.position(0);
+                    b.mark();
+                    b.compact();
+                    b.reset();
+                }});
+
         // Values
 
         b.clear();