6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.vm.ci.hotspot.test;
25
26 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
27 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
28 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
29 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
30 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
31
32 import java.util.LinkedList;
33 import java.util.stream.Stream;
34
35 import jdk.vm.ci.meta.JavaConstant;
36 import org.testng.annotations.DataProvider;
37
38 public class ReadArrayElementDataProvider {
39
40 @DataProvider(name = "readArrayElementDataProvider")
41 public static Object[][] readArrayElementDataProvider() {
42 LinkedList<Object[]> cfgSet = new LinkedList<>();
43 for (int i : new int[]{0, 1}) {
44 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.booleanArrayWithValues),
45 i, JavaConstant.forBoolean(DUMMY_CLASS_INSTANCE.booleanArrayWithValues[i])});
46 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.byteArrayWithValues),
47 i, JavaConstant.forByte(DUMMY_CLASS_INSTANCE.byteArrayWithValues[i])});
48 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.shortArrayWithValues),
49 i, JavaConstant.forShort(DUMMY_CLASS_INSTANCE.shortArrayWithValues[i])});
50 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.charArrayWithValues),
51 i, JavaConstant.forChar(DUMMY_CLASS_INSTANCE.charArrayWithValues[i])});
52 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.intArrayWithValues),
53 i, JavaConstant.forInt(DUMMY_CLASS_INSTANCE.intArrayWithValues[i])});
54 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.longArrayWithValues),
55 i, JavaConstant.forLong(DUMMY_CLASS_INSTANCE.longArrayWithValues[i])});
56 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.floatArrayWithValues),
57 i, JavaConstant.forFloat(DUMMY_CLASS_INSTANCE.floatArrayWithValues[i])});
|
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 package jdk.vm.ci.hotspot.test;
25
26 import jdk.vm.ci.meta.JavaConstant;
27 import org.testng.annotations.DataProvider;
28
29 import java.util.LinkedList;
30 import java.util.stream.Stream;
31
32 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAYS_MAP;
33 import static jdk.vm.ci.hotspot.test.TestHelper.ARRAY_ARRAYS_MAP;
34 import static jdk.vm.ci.hotspot.test.TestHelper.CONSTANT_REFLECTION_PROVIDER;
35 import static jdk.vm.ci.hotspot.test.TestHelper.DUMMY_CLASS_INSTANCE;
36 import static jdk.vm.ci.hotspot.test.TestHelper.INSTANCE_FIELDS_MAP;
37
38 public class ReadArrayElementDataProvider {
39
40 @DataProvider(name = "readArrayElementDataProvider")
41 public static Object[][] readArrayElementDataProvider() {
42 LinkedList<Object[]> cfgSet = new LinkedList<>();
43 for (int i : new int[]{0, 1}) {
44 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.booleanArrayWithValues),
45 i, JavaConstant.forBoolean(DUMMY_CLASS_INSTANCE.booleanArrayWithValues[i])});
46 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.byteArrayWithValues),
47 i, JavaConstant.forByte(DUMMY_CLASS_INSTANCE.byteArrayWithValues[i])});
48 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.shortArrayWithValues),
49 i, JavaConstant.forShort(DUMMY_CLASS_INSTANCE.shortArrayWithValues[i])});
50 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.charArrayWithValues),
51 i, JavaConstant.forChar(DUMMY_CLASS_INSTANCE.charArrayWithValues[i])});
52 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.intArrayWithValues),
53 i, JavaConstant.forInt(DUMMY_CLASS_INSTANCE.intArrayWithValues[i])});
54 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.longArrayWithValues),
55 i, JavaConstant.forLong(DUMMY_CLASS_INSTANCE.longArrayWithValues[i])});
56 cfgSet.add(new Object[]{CONSTANT_REFLECTION_PROVIDER.forObject(DUMMY_CLASS_INSTANCE.floatArrayWithValues),
57 i, JavaConstant.forFloat(DUMMY_CLASS_INSTANCE.floatArrayWithValues[i])});
|