< prev index next >

test/jdk/jdk/incubator/vector/PreferredSpeciesTest.java

Print this page
rev 55594 : tests and benchmark changes

@@ -19,11 +19,11 @@
  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  * or visit www.oracle.com if you need additional information or have any
  * questions.
  */
 
-import jdk.incubator.vector.Vector;
+import jdk.incubator.vector.*;
 import jdk.internal.misc.Unsafe;
 import org.testng.Assert;
 import org.testng.annotations.DataProvider;
 import org.testng.annotations.Test;
 

@@ -48,11 +48,25 @@
         };
     }
 
     @Test(dataProvider = "classesProvider")
     void testVectorLength(Class<?> c) {
-        Vector.Species<?> species =
-                Vector.Species.ofPreferred(c);
+        Vector.Species<?> species = null;
+        if (c == byte.class) {
+            species = ByteVector.SPECIES_PREFERRED;
+        } else if (c == short.class) {
+            species = ShortVector.SPECIES_PREFERRED;
+        } else if (c == int.class) {
+            species = IntVector.SPECIES_PREFERRED;
+        } else if (c == long.class) {
+            species = LongVector.SPECIES_PREFERRED;
+        } else if (c == float.class) {
+            species = FloatVector.SPECIES_PREFERRED;
+        } else if (c == double.class) {
+            species = DoubleVector.SPECIES_PREFERRED;
+        } else {
+            throw new IllegalArgumentException("Bad vector element type: " + c.getName());
+        }
 
         Assert.assertEquals(species.length(), U.getMaxVectorSize(c));
     }
 }
< prev index next >