12faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes/*
22faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Copyright (C) 2008 The Android Open Source Project
32faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
42faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Licensed under the Apache License, Version 2.0 (the "License");
52faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * you may not use this file except in compliance with the License.
62faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * You may obtain a copy of the License at
72faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
82faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *      http://www.apache.org/licenses/LICENSE-2.0
92faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes *
102faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * Unless required by applicable law or agreed to in writing, software
112faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * distributed under the License is distributed on an "AS IS" BASIS,
122faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
132faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * See the License for the specific language governing permissions and
142faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes * limitations under the License.
152faa5f1271587cda765f26bcf2951065300a01ffElliott Hughes */
165d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
175d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao/**
185d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao * Exercise arrays.
195d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao */
205d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhaopublic class Array {
215d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
225d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    /*
235d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     * Verify array contents.
245d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     */
255d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkBytes(byte[] bytes) {
26795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(bytes[0] == 0);
27795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(bytes[1] == -1);
28795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(bytes[2] == -2);
29795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(bytes[3] == -3);
30795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(bytes[4] == -4);
315d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
325d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkShorts(short[] shorts) {
33795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(shorts[0] == 20);
34795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(shorts[1] == 10);
35795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(shorts[2] == 0);
36795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(shorts[3] == -10);
37795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(shorts[4] == -20);
385d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
395d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkChars(char[] chars) {
40795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(chars[0] == 40000);
41795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(chars[1] == 40001);
42795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(chars[2] == 40002);
43795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(chars[3] == 40003);
44795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(chars[4] == 40004);
455d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
465d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkInts(int[] ints) {
47795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints[0] == 70000);
48795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints[1] == 70001);
49795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints[2] == 70002);
50795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints[3] == 70003);
51795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints[4] == 70004);
525d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
535d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkBooleans(boolean[] booleans) {
54795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(booleans[0]);
55795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(booleans[1]);
56795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(!booleans[2]);
57795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(booleans[3]);
58795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(!booleans[4]);
595d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
605d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkFloats(float[] floats) {
61795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(floats[0] == -1.5);
62795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(floats[1] == -0.5);
63795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(floats[2] == 0.0);
64795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(floats[3] == 0.5);
65795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(floats[4] == 1.5);
665d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
675d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkLongs(long[] longs) {
68795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs[0] == 0x1122334455667788L);
69795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs[1] == 0x8877665544332211L);
70795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs[2] == 0L);
71795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs[3] == 1L);
72795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs[4] == -1L);
735d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
745d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkStrings(String[] strings) {
75795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(strings[0].equals("zero"));
76795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(strings[1].equals("one"));
77795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(strings[2].equals("two"));
78795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(strings[3].equals("three"));
79795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(strings[4].equals("four"));
805d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
815d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
825d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    /*
835d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     * Try bad range values, 32 bit get/put.
845d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     */
85b25c3f6a86dc634ce44fb2849385b49465caa84dElliott Hughes    static void checkRange32(int[] ints, int[] empty, int negVal1, int negVal2) {
865d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        System.out.println("Array.checkRange32");
875d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        int i = 0;
885d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
89795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(ints.length == 5);
905d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
915d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
925d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            i = ints[5];            // exact bound
93795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
945d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
955d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
965d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
975d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
985d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            ints[5] = i;            // exact bound
99795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1005d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1015d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1025d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1035d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1045d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            i = ints[6];            // one past
105795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1065d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1075d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1085d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1095d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1105d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            i = ints[negVal1];      // -1
111795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1125d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1135d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1145d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1155d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1165d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            ints[negVal1] = i;      // -1
117795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1185d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1195d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1205d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1215d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1225d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            i = ints[negVal2];      // min int
123795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1245d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1255d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1265d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1275d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1285d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1295d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1305d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            i = empty[1];
131795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1325d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1335d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1345d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1355d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
1365d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1375d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    /*
1385d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     * Try bad range values, 64 bit get/put.
1395d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     */
1405d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkRange64(long[] longs, int negVal1, int negVal2) {
1415d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        System.out.println("Array.checkRange64");
1425d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        long l = 0L;
1435d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
144795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao        Main.assertTrue(longs.length == 5);
1455d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1465d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1475d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            l = longs[5];            // exact bound
148795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1495d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1505d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1515d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1525d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1535d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            longs[5] = l;            // exact bound
154795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1555d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1565d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1575d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1585d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1595d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            l = longs[6];            // one past
160795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1615d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1625d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1635d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1645d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1655d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            l = longs[negVal1];      // -1
166795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1675d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1685d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1695d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1705d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1715d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            longs[negVal1] = l;      // -1
172795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1735d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1745d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1755d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1765d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1775d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            l = longs[negVal2];      // min int
178795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1795d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (ArrayIndexOutOfBoundsException aioobe) {
1805d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1815d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1825d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
1835d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1845d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    /*
1855d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     * Test negative allocations of object and primitive arrays.
1865d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao     */
1875d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    static void checkNegAlloc(int count) {
1885d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        System.out.println("Array.checkNegAlloc");
1895d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        String[] strings;
1905d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        int[] ints;
1915d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1925d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
1935d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            ints = new int[count];
194795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
1955d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (NegativeArraySizeException nase) {
1965d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
1975d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
1985d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
1995d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        try {
2005d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            strings = new String[count];
201795d78f4d04c8d007bf2bdf2ed4131379bcf19c7jeffhao            Main.assertTrue(false);
2025d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        } catch (NegativeArraySizeException nase) {
2035d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            // good
2045d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        }
2055d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
2065d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2075d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    public static void run() {
2085d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        System.out.println("Array check...");
2095d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2105d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        byte[] xBytes = new byte[] { 0, -1, -2, -3, -4 };
2115d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        short[] xShorts = new short[] { 20, 10, 0, -10, -20 };
2125d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        char[] xChars = new char[] { 40000, 40001, 40002, 40003, 40004 };
2135d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        int[] xInts = new int[] { 70000, 70001, 70002, 70003, 70004 };
2145d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        boolean[] xBooleans = new boolean[] { true, true, false, true, false };
2155d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        float[] xFloats = new float[] { -1.5f, -0.5f, 0.0f, 0.5f, 1.5f };
2165d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        long[] xLongs = new long[] {
2175d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            0x1122334455667788L, 0x8877665544332211L, 0L, 1L, -1l };
2185d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        String[] xStrings = new String[] {
2195d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao            "zero", "one", "two", "three", "four" };
2205d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2215d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        int[] xEmpty = new int[0];
2225d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2235d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkBytes(xBytes);
2245d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkShorts(xShorts);
2255d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkChars(xChars);
2265d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkInts(xInts);
2275d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkBooleans(xBooleans);
2285d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkFloats(xFloats);
2295d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkLongs(xLongs);
2305d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkStrings(xStrings);
2315d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2325d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkRange32(xInts, xEmpty, -1, (int) 0x80000000);
2335d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkRange64(xLongs, -1, (int) 0x80000000);
2345d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao
2355d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao        checkNegAlloc(-1);
2365d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao    }
2375d1ac920fdaef5d4ec8f66bb734488cd9660b024jeffhao}
238