< prev index next >
src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfTestBase.java
Print this page
rev 56282 : [mq]: graal
*** 1,7 ****
/*
! * Copyright (c) 2016, 2018, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
--- 1,7 ----
/*
! * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved.
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
*
* This code is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License version 2 only, as
* published by the Free Software Foundation.
*** 24,46 ****
package org.graalvm.compiler.replacements.test;
import static org.junit.Assume.assumeFalse;
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
- import java.util.ArrayList;
- import java.util.Collection;
import jdk.vm.ci.aarch64.AArch64;
@RunWith(value = Parameterized.class)
public abstract class StringIndexOfTestBase extends GraalCompilerTest {
- @Parameterized.Parameter(value = 0) public String sourceString;
- @Parameterized.Parameter(value = 1) public String constantString;
@Parameterized.Parameters(name = "{0},{1}")
public static Collection<Object[]> data() {
ArrayList<Object[]> tests = new ArrayList<>();
String[] targets = new String[]{"foobar", "foo", "bar"};
--- 24,45 ----
package org.graalvm.compiler.replacements.test;
import static org.junit.Assume.assumeFalse;
+ import java.util.ArrayList;
+ import java.util.Collection;
+
import org.graalvm.compiler.core.test.GraalCompilerTest;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import jdk.vm.ci.aarch64.AArch64;
@RunWith(value = Parameterized.class)
public abstract class StringIndexOfTestBase extends GraalCompilerTest {
@Parameterized.Parameters(name = "{0},{1}")
public static Collection<Object[]> data() {
ArrayList<Object[]> tests = new ArrayList<>();
String[] targets = new String[]{"foobar", "foo", "bar"};
*** 89,98 ****
--- 88,105 ----
tests.add(new Object[]{s.substring(0, s.length() - 1) + s, s});
}
}
}
+ protected final String sourceString;
+ protected final String constantString;
+
+ public StringIndexOfTestBase(String sourceString, String constantString) {
+ this.sourceString = sourceString;
+ this.constantString = constantString;
+ }
+
public int testStringIndexOf(String a, String b) {
return a.indexOf(b);
}
public int testStringIndexOfOffset(String a, String b, int fromIndex) {
< prev index next >