test/jdk/java/io/Serializable/oldTests/ArraysOfArrays.java
author rriggs
Fri, 11 Oct 2019 13:11:56 -0400
changeset 58565 baa5969ecf34
parent 47216 71c04702a3d5
permissions -rw-r--r--
8231427: Warning cleanup in tests of java.io.Serializable Reviewed-by: darcy, lancea
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     1
/*
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
     2
 * Copyright (c) 2005, 2019, Oracle and/or its affiliates. All rights reserved.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     4
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
90ce3da70b43 Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
90ce3da70b43 Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
90ce3da70b43 Initial load
duke
parents:
diff changeset
     8
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
90ce3da70b43 Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
90ce3da70b43 Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
90ce3da70b43 Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
90ce3da70b43 Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
90ce3da70b43 Initial load
duke
parents:
diff changeset
    14
 *
90ce3da70b43 Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
90ce3da70b43 Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
90ce3da70b43 Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
90ce3da70b43 Initial load
duke
parents:
diff changeset
    18
 *
5506
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
202f599c92aa 6943119: Rebrand source copyright notices
ohair
parents: 2
diff changeset
    21
 * questions.
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    22
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    23
90ce3da70b43 Initial load
duke
parents:
diff changeset
    24
/* @test
90ce3da70b43 Initial load
duke
parents:
diff changeset
    25
 * @summary it is new version of old test which was under
90ce3da70b43 Initial load
duke
parents:
diff changeset
    26
 *          /src/share/test/serialization/piotest.java
90ce3da70b43 Initial load
duke
parents:
diff changeset
    27
 *          Test of serialization/deserialization of
90ce3da70b43 Initial load
duke
parents:
diff changeset
    28
 *          objects as arrays of arrays
90ce3da70b43 Initial load
duke
parents:
diff changeset
    29
 */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    30
90ce3da70b43 Initial load
duke
parents:
diff changeset
    31
import java.io.*;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    32
90ce3da70b43 Initial load
duke
parents:
diff changeset
    33
public class ArraysOfArrays {
5809
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
    34
    public static void main (String argv[]) throws IOException {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    35
        System.err.println("\nRegression test for testing of " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    36
            "serialization/deserialization of objects as " +
90ce3da70b43 Initial load
duke
parents:
diff changeset
    37
            "arrays of arrays \n");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    38
90ce3da70b43 Initial load
duke
parents:
diff changeset
    39
        FileInputStream istream = null;
5809
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
    40
        FileOutputStream ostream = null;
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    41
        try {
5809
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
    42
            ostream = new FileOutputStream("piotest5.tmp");
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    43
            ObjectOutputStream p = new ObjectOutputStream(ostream);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    44
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    45
            byte[][] b = {{ 0, 1}, {2,3}};
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    46
            p.writeObject(b);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    47
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    48
            short[][] s = {{ 0, 1, 2}, {3,4,5}};
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    49
            p.writeObject(s);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    50
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    51
            char[][] c = {{ 0, 1, 2, 3}, {4, 5, 6, 7}};
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    52
            p.writeObject(c);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    53
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    54
            int[][] i = {{ 0, 1, 2, 3, 4}, {5, 6, 7, 8, 9}};
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    55
            p.writeObject(i);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    56
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    57
            long[][] l = {{ 0, 1, 2, 3, 4, 5}, {6,7,8,9,10,11}};
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    58
            p.writeObject((Object)l);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    59
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    60
            boolean[][] z = new boolean[2][2];
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    61
90ce3da70b43 Initial load
duke
parents:
diff changeset
    62
            z[0][0] = true;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    63
            z[0][1] = false;
90ce3da70b43 Initial load
duke
parents:
diff changeset
    64
            z[1] = z[0];        // Use first row same as second
90ce3da70b43 Initial load
duke
parents:
diff changeset
    65
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    66
            p.writeObject(z);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    67
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    68
            float[][] f = {{ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    69
                { 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f}};
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    70
            p.writeObject(f);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    71
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    72
            double[][] d = {{ 1.0f, 2.0f, 3.0f, 4.0f, 5.0f, 6.0f, 7.0d},
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    73
                { 1.1f, 2.1f, 3.1f, 4.1f, 5.1f, 6.1f, 7.1d}};
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    74
            p.writeObject(d);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    75
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    76
            Integer Int[][] = {{ 3, 2},
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    77
                               { 1, 0}};
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    78
            p.writeObject(Int);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    79
90ce3da70b43 Initial load
duke
parents:
diff changeset
    80
            p.flush();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    81
90ce3da70b43 Initial load
duke
parents:
diff changeset
    82
            /* Now read them back and verify
90ce3da70b43 Initial load
duke
parents:
diff changeset
    83
             */
90ce3da70b43 Initial load
duke
parents:
diff changeset
    84
            istream = new FileInputStream("piotest5.tmp");
90ce3da70b43 Initial load
duke
parents:
diff changeset
    85
            ObjectInputStream q = new ObjectInputStream(istream);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    86
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    87
            byte[][] b_u = (byte [][]) (q.readObject());
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    88
            for (int ix = 0; ix < b_u.length; ix++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    89
                for(int iy = 0; iy < b_u[ix].length; iy++) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    90
                    if (b[ix][iy] != b_u[ix][iy]) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
    91
                        System.err.println("\nByte array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
    92
                            ix + "][" + iy + "] expected " + b[ix][iy] +
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
    93
                            " actual = " + b_u[ix][iy]);
90ce3da70b43 Initial load
duke
parents:
diff changeset
    94
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
    95
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    96
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    97
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
    98
90ce3da70b43 Initial load
duke
parents:
diff changeset
    99
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   100
            short[][] s_u = (short [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   101
            for (int ix = 0; ix < s_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   102
                for(int iy = 0; iy < s_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   103
                    if (s[ix][iy] != s_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   104
                        System.err.println("\nshort array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   105
                            ix + "][" + iy + "] expected " + s[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   106
                            " actual = " + s_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   107
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   108
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   109
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   110
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   111
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   112
            char[][] c_u = (char [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   113
            for (int ix = 0; ix < c_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   114
                for(int iy = 0; iy < c_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   115
                    if (c[ix][iy] != c_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   116
                        System.err.println("\nchar array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   117
                            ix + "][" + iy + "] expected " + c[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   118
                            " actual = " + c_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   119
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   120
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   121
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   122
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   123
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   124
            int[][] i_u = (int [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   125
            for (int ix = 0; ix < i_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   126
                for(int iy = 0; iy < i_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   127
                    if (i[ix][iy] != i_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   128
                        System.err.println("\nint array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   129
                            ix + "][" + iy + "] expected " + i[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   130
                            " actual = " + i_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   131
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   132
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   133
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   134
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   135
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   136
            long[][] l_u = (long [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   137
            for (int ix = 0; ix < l_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   138
                for(int iy = 0; iy < l_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   139
                    if (l[ix][iy] != l_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   140
                        System.err.println("\nlong array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   141
                            ix + "][" + iy + "] expected " + l[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   142
                            " actual = " + l_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   143
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   144
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   145
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   146
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   147
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   148
            boolean[][] z_u = (boolean [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   149
            for (int ix = 0; ix < z_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   150
                for(int iy = 0; iy < z_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   151
                    if (z[ix][iy] != z_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   152
                        System.err.println("\nboolean array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   153
                            ix + "][" + iy + "] expected " + z[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   154
                            " actual = " + z_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   155
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   156
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   157
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   158
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   159
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   160
            float[][] f_u = (float [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   161
            for (int ix = 0; ix < f_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   162
                for(int iy = 0; iy < f_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   163
                    if (f[ix][iy] != f_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   164
                        System.err.println("\nfloat array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   165
                            ix + "][" + iy + "] expected " + f[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   166
                            " actual = " + f_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   167
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   168
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   169
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   170
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   171
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   172
            double[][] d_u = (double [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   173
            for (int ix = 0; ix < d_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   174
                for(int iy = 0; iy < d_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   175
                    if (d[ix][iy] != d_u[ix][iy]) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   176
                        System.err.println("\ndouble array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   177
                            ix + "][" + iy + "] expected " + d[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   178
                            " actual = " + d_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   179
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   180
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   181
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   182
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   183
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   184
            Integer[][] Int_u = (Integer [][])(q.readObject());
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   185
            for (int ix = 0; ix < Int_u.length; ix++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   186
                for(int iy = 0; iy < Int_u[ix].length; iy++) {
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   187
                    if (!Int[ix][iy].equals(Int_u[ix][iy])) {
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   188
                        System.err.println("\nInteger array mismatch [" +
58565
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   189
                            ix + "][" + iy + "] expected " + Int[ix][iy] +
baa5969ecf34 8231427: Warning cleanup in tests of java.io.Serializable
rriggs
parents: 47216
diff changeset
   190
                            " actual = " + Int_u[ix][iy]);
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   191
                        throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   192
                    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   193
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   194
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   195
            System.err.println("\nTEST PASSED");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   196
        } catch (Exception e) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   197
            System.err.print("TEST FAILED: ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   198
            e.printStackTrace();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   199
90ce3da70b43 Initial load
duke
parents:
diff changeset
   200
            System.err.println("\nInput remaining");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   201
            int ch;
90ce3da70b43 Initial load
duke
parents:
diff changeset
   202
            try {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   203
                while ((ch = istream.read()) != -1) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   204
                    System.err.print("\n " +Integer.toString(ch, 16) + " ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   205
                }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   206
                System.err.println("\n ");
90ce3da70b43 Initial load
duke
parents:
diff changeset
   207
            } catch (Exception f) {
90ce3da70b43 Initial load
duke
parents:
diff changeset
   208
                throw new Error();
90ce3da70b43 Initial load
duke
parents:
diff changeset
   209
            }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   210
            throw new Error();
5809
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
   211
        } finally {
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
   212
            if (istream != null) istream.close();
6e38efd0293f 6962045: TEST_BUG: Tests in test/java/io/Serializable leave files open
alanb
parents: 5506
diff changeset
   213
            if (ostream != null) ostream.close();
2
90ce3da70b43 Initial load
duke
parents:
diff changeset
   214
        }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   215
    }
90ce3da70b43 Initial load
duke
parents:
diff changeset
   216
}