author | jlaskey |
Fri, 18 May 2018 08:43:49 -0300 | |
changeset 50175 | 589ed2770141 |
parent 49422 | b64cd942ac7a |
permissions | -rw-r--r-- |
35388 | 1 |
/* |
2 |
* Copyright (c) 2015, 2016, Oracle and/or its affiliates. All rights reserved. |
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
|
4 |
* |
|
5 |
* This code is free software; you can redistribute it and/or modify it |
|
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 |
/** |
|
25 |
* @test |
|
26 |
* @summary Test the boundary values for concatenation arguments. |
|
27 |
* |
|
28 |
* @compile ImplicitStringConcatBoundaries.java |
|
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
29 |
* @run main/othervm -Xverify:all ImplicitStringConcatBoundaries |
35388 | 30 |
* |
31 |
* @compile -XDstringConcat=inline ImplicitStringConcatBoundaries.java |
|
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
32 |
* @run main/othervm -Xverify:all ImplicitStringConcatBoundaries |
35388 | 33 |
* |
49422
b64cd942ac7a
8200241: [TESTBUG] java/lang/String/concat/ tests should not force source/target = 9 anymore
shade
parents:
47216
diff
changeset
|
34 |
* @compile -XDstringConcat=indy ImplicitStringConcatBoundaries.java |
35388 | 35 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
36 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
37 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
38 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
39 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
40 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
41 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries |
35388 | 42 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
43 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
44 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
45 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
46 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
47 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
48 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
35388 | 49 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
50 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
51 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
52 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
53 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
54 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
55 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
35388 | 56 |
|
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
57 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
58 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
59 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
60 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
61 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
62 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
35388 | 63 |
* |
49422
b64cd942ac7a
8200241: [TESTBUG] java/lang/String/concat/ tests should not force source/target = 9 anymore
shade
parents:
47216
diff
changeset
|
64 |
* @compile -XDstringConcat=indyWithConstants ImplicitStringConcatBoundaries.java |
35388 | 65 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
66 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
67 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
68 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
69 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
70 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
71 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT ImplicitStringConcatBoundaries |
35388 | 72 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
73 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
74 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
75 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
76 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
77 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
78 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true ImplicitStringConcatBoundaries |
35388 | 79 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
80 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
81 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
82 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
83 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
84 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
85 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
35388 | 86 |
* |
35639
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
87 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
88 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
89 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
90 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=BC_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
91 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_SB_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
f34e7e8b4eac
8148787: StringConcatFactory exactness check produces bad bytecode when a non-arg concat is requested
shade
parents:
35388
diff
changeset
|
92 |
* @run main/othervm -Xverify:all -Djava.lang.invoke.stringConcat=MH_INLINE_SIZED_EXACT -Djava.lang.invoke.stringConcat.debug=true -Djava.lang.invoke.stringConcat.cache=true ImplicitStringConcatBoundaries |
35388 | 93 |
|
94 |
*/ |
|
95 |
||
96 |
public class ImplicitStringConcatBoundaries { |
|
97 |
||
98 |
public static final boolean BOOL_TRUE_1 = true; |
|
99 |
public static boolean BOOL_TRUE_2 = true; |
|
100 |
public static final boolean BOOL_FALSE_1 = false; |
|
101 |
public static boolean BOOL_FALSE_2 = false; |
|
102 |
||
103 |
public static final byte BYTE_MIN_1 = Byte.MIN_VALUE; |
|
104 |
public static byte BYTE_MIN_2 = Byte.MIN_VALUE; |
|
105 |
public static final byte BYTE_MAX_1 = Byte.MAX_VALUE; |
|
106 |
public static byte BYTE_MAX_2 = Byte.MAX_VALUE; |
|
107 |
||
108 |
public static final short SHORT_MIN_1 = Short.MIN_VALUE; |
|
109 |
public static short SHORT_MIN_2 = Short.MIN_VALUE; |
|
110 |
public static final short SHORT_MAX_1 = Short.MAX_VALUE; |
|
111 |
public static short SHORT_MAX_2 = Short.MAX_VALUE; |
|
112 |
||
113 |
public static final char CHAR_MIN_1 = Character.MIN_VALUE; |
|
114 |
public static char CHAR_MIN_2 = Character.MIN_VALUE; |
|
115 |
public static final char CHAR_MAX_1 = Character.MAX_VALUE; |
|
116 |
public static char CHAR_MAX_2 = Character.MAX_VALUE; |
|
117 |
||
118 |
public static final int INT_MIN_1 = Integer.MIN_VALUE; |
|
119 |
public static int INT_MIN_2 = Integer.MIN_VALUE; |
|
120 |
public static final int INT_MAX_1 = Integer.MAX_VALUE; |
|
121 |
public static int INT_MAX_2 = Integer.MAX_VALUE; |
|
122 |
||
123 |
public static final float FLOAT_MIN_EXP_1 = Float.MIN_EXPONENT; |
|
124 |
public static float FLOAT_MIN_EXP_2 = Float.MIN_EXPONENT; |
|
125 |
public static final float FLOAT_MIN_NORM_1 = Float.MIN_NORMAL; |
|
126 |
public static float FLOAT_MIN_NORM_2 = Float.MIN_NORMAL; |
|
127 |
public static final float FLOAT_MIN_1 = Float.MIN_VALUE; |
|
128 |
public static float FLOAT_MIN_2 = Float.MIN_VALUE; |
|
129 |
public static final float FLOAT_MAX_1 = Float.MAX_VALUE; |
|
130 |
public static float FLOAT_MAX_2 = Float.MAX_VALUE; |
|
131 |
||
132 |
public static final long LONG_MIN_1 = Long.MIN_VALUE; |
|
133 |
public static long LONG_MIN_2 = Long.MIN_VALUE; |
|
134 |
public static final long LONG_MAX_1 = Long.MAX_VALUE; |
|
135 |
public static long LONG_MAX_2 = Long.MAX_VALUE; |
|
136 |
||
137 |
public static final double DOUBLE_MIN_EXP_1 = Double.MIN_EXPONENT; |
|
138 |
public static double DOUBLE_MIN_EXP_2 = Double.MIN_EXPONENT; |
|
139 |
public static final double DOUBLE_MIN_NORM_1 = Double.MIN_NORMAL; |
|
140 |
public static double DOUBLE_MIN_NORM_2 = Double.MIN_NORMAL; |
|
141 |
public static final double DOUBLE_MIN_1 = Double.MIN_VALUE; |
|
142 |
public static double DOUBLE_MIN_2 = Double.MIN_VALUE; |
|
143 |
public static final double DOUBLE_MAX_1 = Double.MAX_VALUE; |
|
144 |
public static double DOUBLE_MAX_2 = Double.MAX_VALUE; |
|
145 |
||
146 |
public static void main(String[] args) throws Exception { |
|
147 |
test("foofalse", "foo" + BOOL_FALSE_1); |
|
148 |
test("foofalse", "foo" + BOOL_FALSE_2); |
|
149 |
test("footrue", "foo" + BOOL_TRUE_1); |
|
150 |
test("footrue", "foo" + BOOL_TRUE_2); |
|
151 |
||
152 |
test("foo127", "foo" + BYTE_MAX_1); |
|
153 |
test("foo127", "foo" + BYTE_MAX_2); |
|
154 |
test("foo-128", "foo" + BYTE_MIN_1); |
|
155 |
test("foo-128", "foo" + BYTE_MIN_2); |
|
156 |
||
157 |
test("foo32767", "foo" + SHORT_MAX_1); |
|
158 |
test("foo32767", "foo" + SHORT_MAX_2); |
|
159 |
test("foo-32768", "foo" + SHORT_MIN_1); |
|
160 |
test("foo-32768", "foo" + SHORT_MIN_2); |
|
161 |
||
162 |
test("foo\u0000", "foo" + CHAR_MIN_1); |
|
163 |
test("foo\u0000", "foo" + CHAR_MIN_2); |
|
164 |
test("foo\uFFFF", "foo" + CHAR_MAX_1); |
|
165 |
test("foo\uFFFF", "foo" + CHAR_MAX_2); |
|
166 |
||
167 |
test("foo2147483647", "foo" + INT_MAX_1); |
|
168 |
test("foo2147483647", "foo" + INT_MAX_2); |
|
169 |
test("foo-2147483648", "foo" + INT_MIN_1); |
|
170 |
test("foo-2147483648", "foo" + INT_MIN_2); |
|
171 |
||
172 |
test("foo1.17549435E-38", "foo" + FLOAT_MIN_NORM_1); |
|
173 |
test("foo1.17549435E-38", "foo" + FLOAT_MIN_NORM_2); |
|
174 |
test("foo-126.0", "foo" + FLOAT_MIN_EXP_1); |
|
175 |
test("foo-126.0", "foo" + FLOAT_MIN_EXP_2); |
|
176 |
test("foo1.4E-45", "foo" + FLOAT_MIN_1); |
|
177 |
test("foo1.4E-45", "foo" + FLOAT_MIN_2); |
|
178 |
test("foo3.4028235E38", "foo" + FLOAT_MAX_1); |
|
179 |
test("foo3.4028235E38", "foo" + FLOAT_MAX_2); |
|
180 |
||
181 |
test("foo-9223372036854775808", "foo" + LONG_MIN_1); |
|
182 |
test("foo-9223372036854775808", "foo" + LONG_MIN_2); |
|
183 |
test("foo9223372036854775807", "foo" + LONG_MAX_1); |
|
184 |
test("foo9223372036854775807", "foo" + LONG_MAX_2); |
|
185 |
||
186 |
test("foo2.2250738585072014E-308", "foo" + DOUBLE_MIN_NORM_1); |
|
187 |
test("foo2.2250738585072014E-308", "foo" + DOUBLE_MIN_NORM_2); |
|
188 |
test("foo-1022.0", "foo" + DOUBLE_MIN_EXP_1); |
|
189 |
test("foo-1022.0", "foo" + DOUBLE_MIN_EXP_2); |
|
190 |
test("foo4.9E-324", "foo" + DOUBLE_MIN_1); |
|
191 |
test("foo4.9E-324", "foo" + DOUBLE_MIN_2); |
|
192 |
test("foo1.7976931348623157E308", "foo" + DOUBLE_MAX_1); |
|
193 |
test("foo1.7976931348623157E308", "foo" + DOUBLE_MAX_2); |
|
194 |
} |
|
195 |
||
196 |
public static void test(String expected, String actual) { |
|
197 |
if (!expected.equals(actual)) { |
|
198 |
StringBuilder sb = new StringBuilder(); |
|
199 |
sb.append("Expected = "); |
|
200 |
sb.append(expected); |
|
201 |
sb.append(", actual = "); |
|
202 |
sb.append(actual); |
|
203 |
throw new IllegalStateException(sb.toString()); |
|
204 |
} |
|
205 |
} |
|
206 |
} |