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 /*
25 * @test
26 * @bug 4655503
27 * @summary Test for array cloning and slicing methods.
28 * @author John Rose
29 */
30
31 import java.util.*;
32 import java.lang.reflect.*;
33
34 public class CopyMethods {
35 static int muzzle; // if !=0, suppresses ("muzzles") messages
36
37 static int maxLen = 40; // maximum length of test arrays
38 static int shortStepsNear = 4; // interesting span near critical values
39 static int downShift = 3;
40
41 static int testCasesRun = 0;
42 static long consing = 0;
43
44 // very simple tests, mainly to test the framework itself
45 static void simpleTests() {
46 int[] a = (int[]) makeArray(3, int.class);
47 if (muzzle == 0)
48 System.out.println("int[] a = "+Arrays.toString(a));
|
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 /*
25 * @test
26 * @bug 4655503
27 * @summary Test for array cloning and slicing methods.
28 * @author John Rose
29 * @key randomness
30 */
31
32 import java.util.*;
33 import java.lang.reflect.*;
34
35 public class CopyMethods {
36 static int muzzle; // if !=0, suppresses ("muzzles") messages
37
38 static int maxLen = 40; // maximum length of test arrays
39 static int shortStepsNear = 4; // interesting span near critical values
40 static int downShift = 3;
41
42 static int testCasesRun = 0;
43 static long consing = 0;
44
45 // very simple tests, mainly to test the framework itself
46 static void simpleTests() {
47 int[] a = (int[]) makeArray(3, int.class);
48 if (muzzle == 0)
49 System.out.println("int[] a = "+Arrays.toString(a));
|