Mercurial > hg > graal-compiler
annotate graal/com.oracle.graal.options.test/src/com/oracle/graal/options/test/NestedBooleanOptionValueTest.java @ 23209:f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
author | Doug Simon <doug.simon@oracle.com> |
---|---|
date | Mon, 21 Dec 2015 16:19:35 +0100 |
parents | |
children |
rev | line source |
---|---|
23209
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
1 /* |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
2 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
4 * |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
5 * This code is free software; you can redistribute it and/or modify it |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
6 * under the terms of the GNU General Public License version 2 only, as |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
7 * published by the Free Software Foundation. |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
8 * |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
9 * This code is distributed in the hope that it will be useful, but WITHOUT |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
12 * version 2 for more details (a copy is included in the LICENSE file that |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
13 * accompanied this code). |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
14 * |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
15 * You should have received a copy of the GNU General Public License version |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
16 * 2 along with this work; if not, write to the Free Software Foundation, |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
18 * |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
20 * or visit www.oracle.com if you need additional information or have any |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
21 * questions. |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
22 */ |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
23 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
24 /** |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
25 * @test |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
26 * @run junit jdk.vm.ci.options.test.NestedBooleanOptionValueTest |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
27 */ |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
28 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
29 package com.oracle.graal.options.test; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
30 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
31 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.Master0; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
32 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.Master1; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
33 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.Master2; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
34 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.NestedOption0; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
35 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.NestedOption1; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
36 import static com.oracle.graal.options.test.NestedBooleanOptionValueTest.Options.NestedOption2; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
37 import static org.junit.Assert.assertFalse; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
38 import static org.junit.Assert.assertTrue; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
39 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
40 import org.junit.Test; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
41 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
42 import com.oracle.graal.options.NestedBooleanOptionValue; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
43 import com.oracle.graal.options.OptionDescriptor; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
44 import com.oracle.graal.options.OptionValue; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
45 import com.oracle.graal.options.OptionValue.OverrideScope; |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
46 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
47 public class NestedBooleanOptionValueTest { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
48 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
49 public static class Options { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
50 public static final OptionValue<Boolean> Master0 = new OptionValue<>(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
51 public static final OptionValue<Boolean> NestedOption0 = new NestedBooleanOptionValue(Master0, true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
52 public static final OptionValue<Boolean> Master1 = new OptionValue<>(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
53 public static final OptionValue<Boolean> NestedOption1 = new NestedBooleanOptionValue(Master1, true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
54 public static final OptionValue<Boolean> Master2 = new OptionValue<>(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
55 public static final OptionValue<Boolean> NestedOption2 = new NestedBooleanOptionValue(Master2, false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
56 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
57 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
58 static final OptionDescriptor master0 = OptionDescriptor.create("Master0", Boolean.class, "", Options.class, "Master0", Master0); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
59 static final OptionDescriptor nestedOption0 = OptionDescriptor.create("NestedOption0", Boolean.class, "", Options.class, "NestedOption0", NestedOption0); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
60 static final OptionDescriptor master1 = OptionDescriptor.create("Master1", Boolean.class, "", Options.class, "Master1", Master1); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
61 static final OptionDescriptor nestedOption1 = OptionDescriptor.create("NestedOption1", Boolean.class, "", Options.class, "NestedOption1", NestedOption1); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
62 static final OptionDescriptor master2 = OptionDescriptor.create("Master2", Boolean.class, "", Options.class, "Master2", Master2); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
63 static final OptionDescriptor nestedOption2 = OptionDescriptor.create("NestedOption2", Boolean.class, "", Options.class, "NestedOption2", NestedOption2); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
64 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
65 @SuppressWarnings("try") |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
66 @Test |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
67 public void runOverrides() { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
68 assertTrue(Master0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
69 assertTrue(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
70 try (OverrideScope s1 = OptionValue.override(Master0, false)) { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
71 assertFalse(Master0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
72 assertFalse(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
73 try (OverrideScope s2 = OptionValue.override(NestedOption0, false)) { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
74 assertFalse(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
75 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
76 try (OverrideScope s2 = OptionValue.override(NestedOption0, true)) { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
77 assertTrue(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
78 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
79 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
80 assertTrue(Master0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
81 try (OverrideScope s1 = OptionValue.override(NestedOption0, false)) { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
82 assertFalse(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
83 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
84 try (OverrideScope s1 = OptionValue.override(NestedOption0, true)) { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
85 assertTrue(NestedOption0.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
86 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
87 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
88 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
89 @Test |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
90 public void runDefaultTrue() { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
91 Master1.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
92 assertTrue(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
93 assertTrue(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
94 // nested value unset |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
95 Master1.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
96 assertFalse(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
97 assertFalse(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
98 // set false |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
99 Master1.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
100 NestedOption1.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
101 assertFalse(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
102 assertFalse(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
103 Master1.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
104 assertTrue(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
105 assertFalse(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
106 // set true |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
107 Master1.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
108 NestedOption1.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
109 assertFalse(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
110 assertTrue(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
111 Master1.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
112 assertTrue(Master1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
113 assertTrue(NestedOption1.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
114 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
115 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
116 @Test |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
117 public void runDefaultFalse() { |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
118 Master2.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
119 assertTrue(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
120 assertFalse(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
121 // nested value unset |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
122 Master2.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
123 assertFalse(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
124 assertFalse(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
125 // set false |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
126 Master2.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
127 NestedOption2.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
128 assertFalse(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
129 assertFalse(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
130 Master2.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
131 assertTrue(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
132 assertFalse(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
133 // set true |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
134 Master2.setValue(false); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
135 NestedOption2.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
136 assertFalse(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
137 assertTrue(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
138 Master2.setValue(true); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
139 assertTrue(Master2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
140 assertTrue(NestedOption2.getValue()); |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
141 } |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
142 |
f35e653aa876
moved @Option mechanism from JVMCI to Graal (GRAAL-1371)
Doug Simon <doug.simon@oracle.com>
parents:
diff
changeset
|
143 } |