< prev index next >

src/jdk.internal.vm.compiler/share/classes/org.graalvm.compiler.replacements.test/src/org/graalvm/compiler/replacements/test/StringIndexOfCharTest.java

Print this page
rev 56282 : [mq]: graal

*** 1,7 **** /* ! * Copyright (c) 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) 2018, 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.
*** 30,44 **** import org.graalvm.compiler.core.test.GraalCompilerTest; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; ! @RunWith(value = Parameterized.class) public class StringIndexOfCharTest extends GraalCompilerTest { - @Parameterized.Parameter(value = 0) public String sourceString; - @Parameterized.Parameter(value = 1) public int constantChar; - @Parameterized.Parameter(value = 2) public int fromIndex; @Parameterized.Parameters(name = "{0},{1},{2}") public static Collection<Object[]> data() { ArrayList<Object[]> tests = new ArrayList<>(); String longString = "ab"; --- 30,41 ---- import org.graalvm.compiler.core.test.GraalCompilerTest; import org.junit.Test; import org.junit.runner.RunWith; import org.junit.runners.Parameterized; ! @RunWith(Parameterized.class) public class StringIndexOfCharTest extends GraalCompilerTest { @Parameterized.Parameters(name = "{0},{1},{2}") public static Collection<Object[]> data() { ArrayList<Object[]> tests = new ArrayList<>(); String longString = "ab";
*** 66,75 **** --- 63,82 ---- } return tests; } + private final String sourceString; + private final int constantChar; + private final int fromIndex; + + public StringIndexOfCharTest(String sourceString, int constantChar, int fromIndex) { + this.sourceString = sourceString; + this.constantChar = constantChar; + this.fromIndex = fromIndex; + } + public int testStringIndexOf(String a, int b) { return a.indexOf(b); } public int testStringIndexOfOffset(String a, int b, int offset) {
< prev index next >