Print this page
rev 4502 : 7115383: TEST_BUG: some jtreg tests fail because they explicitly specify -server option
Summary: Small changes to hotspot tests to remove "-server" and replace with ${TESTVMOPTS}
Reviewed-by: kvn
Split |
Split |
Close |
Expand all |
Collapse all |
--- old/test/compiler/6946040/TestCharShortByteSwap.java
+++ new/test/compiler/6946040/TestCharShortByteSwap.java
1 1 /*
2 2 * Copyright 2010 Google, Inc. All Rights Reserved.
3 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 4 *
5 5 * This code is free software; you can redistribute it and/or modify it
6 6 * under the terms of the GNU General Public License version 2 only, as
7 7 * published by the Free Software Foundation.
8 8 *
9 9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 12 * version 2 for more details (a copy is included in the LICENSE file that
13 13 * accompanied this code).
14 14 *
15 15 * You should have received a copy of the GNU General Public License version
16 16 * 2 along with this work; if not, write to the Free Software Foundation,
17 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 18 *
↓ open down ↓ |
18 lines elided |
↑ open up ↑ |
19 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 20 * or visit www.oracle.com if you need additional information or have any
21 21 * questions.
22 22 *
23 23 */
24 24
25 25 /*
26 26 * @test
27 27 * @bug 6946040
28 28 * @summary Tests Character/Short.reverseBytes and their intrinsics implementation in the server compiler
29 - * @run main/othervm -Xbatch -server -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap
29 + * @run main/othervm -Xbatch -XX:CompileOnly=.testChar,.testShort TestCharShortByteSwap
30 30 */
31 31
32 32 // This test must run without any command line arguments.
33 33
34 34 public class TestCharShortByteSwap {
35 35
36 36 private static short initShort(String[] args, short v) {
37 37 if (args.length > 0) {
38 38 try {
39 39 return (short) Integer.valueOf(args[0]).intValue();
40 40 } catch (NumberFormatException e) { }
41 41 }
42 42 return v;
43 43 }
44 44
45 45 private static char initChar(String[] args, char v) {
46 46 if (args.length > 0) {
47 47 try {
48 48 return (char) Integer.valueOf(args[0]).intValue();
49 49 } catch (NumberFormatException e) { }
50 50 }
51 51 return v;
52 52 }
53 53
54 54 private static void testChar(char a, char b) {
55 55 if (a != Character.reverseBytes(b)) {
56 56 throw new RuntimeException("FAIL: " + (int)a + " != Character.reverseBytes(" + (int)b + ")");
57 57 }
58 58 if (b != Character.reverseBytes(a)) {
59 59 throw new RuntimeException("FAIL: " + (int)b + " != Character.reverseBytes(" + (int)a + ")");
60 60 }
61 61 }
62 62
63 63 private static void testShort(short a, short b) {
64 64 if (a != Short.reverseBytes(b)) {
65 65 throw new RuntimeException("FAIL: " + (int)a + " != Short.reverseBytes(" + (int)b + ")");
66 66 }
67 67 if (b != Short.reverseBytes(a)) {
68 68 throw new RuntimeException("FAIL: " + (int)b + " != Short.reverseBytes(" + (int)a + ")");
69 69 }
70 70 }
71 71
72 72 public static void main(String[] args) {
73 73 for (int i = 0; i < 100000; ++i) { // Trigger compilation
74 74 char c1 = initChar(args, (char) 0x0123);
75 75 char c2 = initChar(args, (char) 0x2301);
76 76 char c3 = initChar(args, (char) 0xaabb);
77 77 char c4 = initChar(args, (char) 0xbbaa);
78 78 short s1 = initShort(args, (short) 0x0123);
79 79 short s2 = initShort(args, (short) 0x2301);
80 80 short s3 = initShort(args, (short) 0xaabb);
81 81 short s4 = initShort(args, (short) 0xbbaa);
82 82 testChar(c1, c2);
83 83 testChar(c3, c4);
84 84 testShort(s1, s2);
85 85 testShort(s3, s4);
86 86 }
87 87 }
88 88 }
↓ open down ↓ |
49 lines elided |
↑ open up ↑ |
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX