< prev index next >
test/compiler/stable/TestStableBoolean.java
Print this page
rev 11353 : 8149043: Fix code indentation in test/compiler/stable tests
Reviewed-by:
*** 93,109 ****
}
/* ==================================================== */
static class DefaultValue {
! public @Stable
! boolean v;
public static final DefaultValue c = new DefaultValue();
public static boolean get() { return c.v; }
public static void test() throws Exception {
! boolean val1 = get();
c.v = true; boolean val2 = get();
assertEquals(val1, false);
assertEquals(val2, true);
}
}
--- 93,108 ----
}
/* ==================================================== */
static class DefaultValue {
! public @Stable boolean v;
public static final DefaultValue c = new DefaultValue();
public static boolean get() { return c.v; }
public static void test() throws Exception {
! boolean val1 = get();
c.v = true; boolean val2 = get();
assertEquals(val1, false);
assertEquals(val2, true);
}
}
*** 129,139 ****
public static @Stable boolean v;
public static final DefaultStaticValue c = new DefaultStaticValue();
public static boolean get() { return c.v; }
public static void test() throws Exception {
! boolean val1 = get();
c.v = true; boolean val2 = get();
assertEquals(val1, false);
assertEquals(val2, true);
}
}
--- 128,138 ----
public static @Stable boolean v;
public static final DefaultStaticValue c = new DefaultStaticValue();
public static boolean get() { return c.v; }
public static void test() throws Exception {
! boolean val1 = get();
c.v = true; boolean val2 = get();
assertEquals(val1, false);
assertEquals(val2, true);
}
}
*** 179,196 ****
public static boolean get1() { return c.v[10]; }
public static boolean[] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1]; c.v[0] = true; boolean val1 = get();
! c.v[0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
}
{
c.v = new boolean[20]; c.v[10] = true; boolean val1 = get1();
! c.v[10] = false; boolean val2 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
}
{
--- 178,195 ----
public static boolean get1() { return c.v[10]; }
public static boolean[] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1]; c.v[0] = true; boolean val1 = get();
! c.v[0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
}
{
c.v = new boolean[20]; c.v[10] = true; boolean val1 = get1();
! c.v[10] = false; boolean val2 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
}
{
*** 211,221 ****
public static boolean[] get1() { return c.v[0]; }
public static boolean[][] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1]; c.v[0][0] = true; boolean val1 = get();
! c.v[0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1]; c.v[0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
--- 210,220 ----
public static boolean[] get1() { return c.v[0]; }
public static boolean[][] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1]; c.v[0][0] = true; boolean val1 = get();
! c.v[0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1]; c.v[0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
*** 249,259 ****
public static boolean[][] get2() { return c.v[0]; }
public static boolean[][][] get3() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1]; c.v[0][0][0] = true; boolean val1 = get();
! c.v[0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1][1]; c.v[0][0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
--- 248,258 ----
public static boolean[][] get2() { return c.v[0]; }
public static boolean[][][] get3() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1]; c.v[0][0][0] = true; boolean val1 = get();
! c.v[0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1][1]; c.v[0][0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
*** 297,307 ****
public static boolean[][][] get3() { return c.v[0]; }
public static boolean[][][][] get4() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1][1]; c.v[0][0][0][0] = true; boolean val1 = get();
! c.v[0][0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1][1][1]; c.v[0][0][0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
--- 296,306 ----
public static boolean[][][] get3() { return c.v[0]; }
public static boolean[][][][] get4() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1][1]; c.v[0][0][0][0] = true; boolean val1 = get();
! c.v[0][0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
c.v = new boolean[1][1][1][1]; c.v[0][0][0][0] = false; boolean val3 = get();
assertEquals(val3, (isStableEnabled ? true : false));
*** 355,365 ****
public static boolean[] get2() { return (boolean[])c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1]; ((boolean[])c.v)[0] = true; boolean val1 = get();
! ((boolean[])c.v)[0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
--- 354,364 ----
public static boolean[] get2() { return (boolean[])c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1]; ((boolean[])c.v)[0] = true; boolean val1 = get();
! ((boolean[])c.v)[0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
*** 382,400 ****
public static Object[] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1]; ((boolean[][])c.v)[0][0] = true; boolean val1 = get();
! ((boolean[][])c.v)[0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
{
c.v = new boolean[1][1]; c.v[0] = new boolean[0]; boolean[] val1 = get1();
! c.v[0] = new boolean[0]; boolean[] val2 = get1();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
--- 381,399 ----
public static Object[] get2() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1]; ((boolean[][])c.v)[0][0] = true; boolean val1 = get();
! ((boolean[][])c.v)[0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
{
c.v = new boolean[1][1]; c.v[0] = new boolean[0]; boolean[] val1 = get1();
! c.v[0] = new boolean[0]; boolean[] val2 = get1();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
*** 418,443 ****
public static Object[][] get3() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1]; ((boolean[][][])c.v)[0][0][0] = true; boolean val1 = get();
! ((boolean[][][])c.v)[0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
{
c.v = new boolean[1][1][1]; c.v[0][0] = new boolean[0]; boolean[] val1 = get1();
! c.v[0][0] = new boolean[0]; boolean[] val2 = get1();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
c.v = new boolean[1][1][1]; c.v[0] = new boolean[0][0]; boolean[][] val1 = get2();
! c.v[0] = new boolean[0][0]; boolean[][] val2 = get2();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
--- 417,442 ----
public static Object[][] get3() { return c.v; }
public static void test() throws Exception {
{
c.v = new boolean[1][1][1]; ((boolean[][][])c.v)[0][0][0] = true; boolean val1 = get();
! ((boolean[][][])c.v)[0][0][0] = false; boolean val2 = get();
assertEquals(val1, true);
assertEquals(val2, false);
}
{
c.v = new boolean[1][1][1]; c.v[0][0] = new boolean[0]; boolean[] val1 = get1();
! c.v[0][0] = new boolean[0]; boolean[] val2 = get1();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
c.v = new boolean[1][1][1]; c.v[0] = new boolean[0][0]; boolean[][] val1 = get2();
! c.v[0] = new boolean[0][0]; boolean[][] val2 = get2();
assertTrue((isStableEnabled ? (val1 == val2) : (val1 != val2)));
}
{
*** 463,481 ****
public static boolean get1() { return get().a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.a = true; A val1 = get();
! c.v.a = false; A val2 = get();
assertEquals(val1.a, false);
assertEquals(val2.a, false);
}
{
c.v = new A(); c.v.a = true; boolean val1 = get1();
! c.v.a = false; boolean val2 = get1();
c.v = new A(); c.v.a = false; boolean val3 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
assertEquals(val3, (isStableEnabled ? true : false));
--- 462,480 ----
public static boolean get1() { return get().a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.a = true; A val1 = get();
! c.v.a = false; A val2 = get();
assertEquals(val1.a, false);
assertEquals(val2.a, false);
}
{
c.v = new A(); c.v.a = true; boolean val1 = get1();
! c.v.a = false; boolean val2 = get1();
c.v = new A(); c.v.a = false; boolean val3 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
assertEquals(val3, (isStableEnabled ? true : false));
*** 497,519 ****
public static boolean get1() { return get().a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.next = new A(); c.v.next.next = c.v;
! c.v.a = true; c.v.next.a = true; A val1 = get();
! c.v.a = false; c.v.next.a = false; A val2 = get();
assertEquals(val1.a, false);
assertEquals(val2.a, false);
}
{
c.v = new A(); c.v.next = c.v;
! c.v.a = true; boolean val1 = get1();
! c.v.a = false; boolean val2 = get1();
c.v = new A(); c.v.next = c.v;
! c.v.a = false; boolean val3 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
assertEquals(val3, (isStableEnabled ? true : false));
}
--- 496,518 ----
public static boolean get1() { return get().a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.next = new A(); c.v.next.next = c.v;
! c.v.a = true; c.v.next.a = true; A val1 = get();
! c.v.a = false; c.v.next.a = false; A val2 = get();
assertEquals(val1.a, false);
assertEquals(val2.a, false);
}
{
c.v = new A(); c.v.next = c.v;
! c.v.a = true; boolean val1 = get1();
! c.v.a = false; boolean val2 = get1();
c.v = new A(); c.v.next = c.v;
! c.v.a = false; boolean val3 = get1();
assertEquals(val1, true);
assertEquals(val2, (isStableEnabled ? true : false));
assertEquals(val3, (isStableEnabled ? true : false));
}
*** 535,546 ****
public static boolean get1() { return c.v.left.left.right.left.a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.left = c.v.right = c.v;
! c.v.a = true; boolean val1 = get(); boolean val2 = get1();
! c.v.a = false; boolean val3 = get(); boolean val4 = get1();
assertEquals(val1, true);
assertEquals(val3, (isStableEnabled ? true : false));
assertEquals(val2, true);
--- 534,545 ----
public static boolean get1() { return c.v.left.left.right.left.a; }
public static void test() throws Exception {
{
c.v = new A(); c.v.left = c.v.right = c.v;
! c.v.a = true; boolean val1 = get(); boolean val2 = get1();
! c.v.a = false; boolean val3 = get(); boolean val4 = get1();
assertEquals(val1, true);
assertEquals(val3, (isStableEnabled ? true : false));
assertEquals(val2, true);
*** 566,577 ****
public static void test() throws Exception {
{
A elem = new A();
c.v = new A[] { elem, elem }; c.v[0].left = c.v[0].right = c.v;
! elem.a = true; boolean val1 = get(); boolean val2 = get1();
! elem.a = false; boolean val3 = get(); boolean val4 = get1();
assertEquals(val1, true);
assertEquals(val3, (isStableEnabled ? true : false));
assertEquals(val2, true);
--- 565,576 ----
public static void test() throws Exception {
{
A elem = new A();
c.v = new A[] { elem, elem }; c.v[0].left = c.v[0].right = c.v;
! elem.a = true; boolean val1 = get(); boolean val2 = get1();
! elem.a = false; boolean val3 = get(); boolean val4 = get1();
assertEquals(val1, true);
assertEquals(val3, (isStableEnabled ? true : false));
assertEquals(val2, true);
*** 604,610 ****
System.out.println("FAILED");
ex.printStackTrace(System.out);
}
}
}
-
}
--- 603,608 ----
< prev index next >