author | goetz |
Mon, 25 Jun 2018 23:04:21 +0200 | |
changeset 50791 | b1e90a8a876c |
parent 50107 | 300e4a88c400 |
child 51287 | 7b1ddbafa134 |
permissions | -rw-r--r-- |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
1 |
/* |
50107
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
2 |
* Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved. |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
4 |
* |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
8 |
* |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
13 |
* accompanied this code). |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
14 |
* |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
18 |
* |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
21 |
* questions. |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
22 |
*/ |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
23 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
24 |
import java.util.HashMap; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
25 |
import java.util.List; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
26 |
import java.util.Map; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
27 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
28 |
import jdk.test.lib.apps.LingeredApp; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
29 |
import jdk.test.lib.Platform; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
30 |
|
50791
b1e90a8a876c
8205419: [testbug] TestJmapCore failing without SA: introduce @requires vm.hasSAandCanAttach
goetz
parents:
50107
diff
changeset
|
31 |
/** |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
32 |
* @test |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
33 |
* @bug 8190198 |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
34 |
* @summary Test clhsdb longConstant command |
50791
b1e90a8a876c
8205419: [testbug] TestJmapCore failing without SA: introduce @requires vm.hasSAandCanAttach
goetz
parents:
50107
diff
changeset
|
35 |
* @requires vm.hasSA |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
36 |
* @library /test/lib |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
37 |
* @run main/othervm ClhsdbLongConstant |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
38 |
*/ |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
39 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
40 |
public class ClhsdbLongConstant { |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
41 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
42 |
public static void main(String[] args) throws Exception { |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
43 |
System.out.println("Starting ClhsdbLongConstant test"); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
44 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
45 |
LingeredApp theApp = null; |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
46 |
try { |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
47 |
ClhsdbLauncher test = new ClhsdbLauncher(); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
48 |
theApp = LingeredApp.startApp(); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
49 |
System.out.println("Started LingeredApp with pid " + theApp.getPid()); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
50 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
51 |
List<String> cmds = List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
52 |
"longConstant", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
53 |
"longConstant markOopDesc::locked_value", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
54 |
"longConstant markOopDesc::lock_bits", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
55 |
"longConstant jtreg::test 6", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
56 |
"longConstant jtreg::test"); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
57 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
58 |
Map<String, List<String>> expStrMap = new HashMap<>(); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
59 |
expStrMap.put("longConstant", List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
60 |
"longConstant markOopDesc::locked_value", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
61 |
"longConstant markOopDesc::lock_bits", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
62 |
"InvocationCounter::count_increment", |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
63 |
"markOopDesc::epoch_mask_in_place")); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
64 |
expStrMap.put("longConstant markOopDesc::locked_value", List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
65 |
"longConstant markOopDesc::locked_value")); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
66 |
expStrMap.put("longConstant markOopDesc::lock_bits", List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
67 |
"longConstant markOopDesc::lock_bits")); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
68 |
expStrMap.put("longConstant jtreg::test", List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
69 |
"longConstant jtreg::test 6")); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
70 |
|
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
71 |
Map<String, List<String>> unExpStrMap = new HashMap<>(); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
72 |
unExpStrMap.put("longConstant jtreg::test", List.of( |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
73 |
"Error: java.lang.RuntimeException: No long constant named")); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
74 |
|
50107
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
75 |
String longConstantOutput = test.run(theApp.getPid(), cmds, expStrMap, unExpStrMap); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
76 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
77 |
if (longConstantOutput == null) { |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
78 |
// Output could be null due to attach permission issues |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
79 |
// and if we are skipping this. |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
80 |
return; |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
81 |
} |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
82 |
checkForTruncation(longConstantOutput); |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
83 |
} catch (Exception ex) { |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
84 |
throw new RuntimeException("Test ERROR " + ex, ex); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
85 |
} finally { |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
86 |
LingeredApp.stopApp(theApp); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
87 |
} |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
88 |
System.out.println("Test PASSED"); |
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
89 |
} |
50107
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
90 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
91 |
private static void checkForTruncation(String longConstantOutput) throws Exception { |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
92 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
93 |
// Expected values obtained from the hash_mask_in_place definition in markOop.hpp |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
94 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
95 |
// Expected output snippet is of the form (on x64-64): |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
96 |
// ... |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
97 |
// longConstant VM_Version::CPU_SHA 17179869184 |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
98 |
// longConstant markOopDesc::biased_lock_bits 1 |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
99 |
// longConstant markOopDesc::age_shift 3 |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
100 |
// longConstant markOopDesc::hash_mask_in_place 549755813632 |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
101 |
// ... |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
102 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
103 |
checkLongValue("markOopDesc::hash_mask_in_place", |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
104 |
longConstantOutput, |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
105 |
Platform.is64bit() ? 549755813632L: 4294967168L); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
106 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
107 |
String arch = System.getProperty("os.arch"); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
108 |
if (arch.equals("amd64") || arch.equals("i386") || arch.equals("x86")) { |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
109 |
// Expected value obtained from the CPU_SHA definition in vm_version_x86.hpp |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
110 |
checkLongValue("VM_Version::CPU_SHA", |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
111 |
longConstantOutput, |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
112 |
17179869184L); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
113 |
} |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
114 |
} |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
115 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
116 |
private static void checkLongValue(String constName, String longConstantOutput, |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
117 |
long checkValue) throws Exception { |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
118 |
|
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
119 |
String[] snippets = longConstantOutput.split(constName); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
120 |
String[] words = snippets[1].split("\\R"); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
121 |
long readValue = Long.parseLong(words[0].trim()); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
122 |
if (readValue != checkValue) { |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
123 |
throw new Exception ("Reading " + constName + ". Expected " + checkValue + |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
124 |
". Obtained " + readValue + " instead."); |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
125 |
} |
300e4a88c400
8195613: [SA] HotSpotTypeDataBase.readVMLongConstants truncates values to int
jgeorge
parents:
47899
diff
changeset
|
126 |
} |
47899
f113d1ef7bed
8190198: SA: Framework for writing 'jhsdb clhsdb' commands tests and testcases for some of the commands
sballal
parents:
diff
changeset
|
127 |
} |