summaryrefslogtreecommitdiffstats
path: root/jack-tests/tests/com/android/jack/box/test001/dx/Tests.java
blob: 73edcd2dbb7fd754caa8d1e8f371b909aaaf95ce (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/*
 * Copyright (C) 2012 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.android.jack.box.test001.dx;

import com.android.jack.box.test001.jack.Box001;

import org.junit.Assert;
import org.junit.Test;

public class Tests {

  @Test
  public void test1() {
    Assert.assertEquals(Long.valueOf(15), Box001.get1(Long.valueOf(11), 4));
  }

  @Test
  public void test2() {
    Assert.assertEquals(Long.valueOf(15), Box001.get2(Long.valueOf(11), 4));
  }

  @Test
  public void test3() {
    Assert.assertTrue(Box001.get3(new Boolean(true), new Boolean(true)).booleanValue());
    Assert.assertFalse(Box001.get3(new Boolean(true), new Boolean(false)).booleanValue());
  }

  @Test
  public void test4() {
    Assert.assertTrue(Box001.get4(new Boolean(true), new Boolean(true)).booleanValue());
    Assert.assertFalse(Box001.get4(new Boolean(true), new Boolean(false)).booleanValue());
  }

  @Test
  public void test5() {
    Assert.assertTrue(Box001.get5(new Boolean(true)));
    Assert.assertFalse(Box001.get5(new Boolean(false)));
  }

  @Test
  public void test6() {
    Assert.assertEquals(2L << 2, Box001.get6(new Long(2), 2).longValue());
  }

  @Test
  public void test7() {
    Assert.assertTrue(Box001.get7(new Boolean(true), new Boolean(true)).booleanValue());
    Assert.assertFalse(Box001.get7(new Boolean(true), new Boolean(false)).booleanValue());
  }

  @Test
  public void test8() {
    Assert.assertTrue(Box001.get8());
  }

  @Test
  public void test9() {
    Assert.assertTrue(Box001.get9().booleanValue());
  }

  @Test
  public void test10() {
    Assert.assertTrue(Box001.get10());
  }

  @Test
  public void test11() {
    int[] a = new int[]{1,2,3};
    Assert.assertEquals(1, Box001.get11(a).intValue());
  }

  @Test
  public void test12() {
    Integer[] a = new Integer[] {new Integer(1), new Integer(2), new Integer(3)};
    Assert.assertEquals(1, Box001.get12(a));
  }

  @Test
  public void test13() {
    int[] a = new int[]{1,2,3};
    Assert.assertEquals(3, Box001.get13(a, new Integer(2)));
  }

  @Test
  public void test14() {
    Assert.assertEquals(1, Box001.get14(new Integer(1), new Integer(2)).length);
    Assert.assertEquals(2, Box001.get14(new Integer(1), new Integer(2))[0].length);
  }

  @Test
  public void test15() {
    Assert.assertEquals(3, Box001.get15(1,2.0f));
  }

  @Test
  public void test16() {
    Assert.assertEquals(3, Box001.get16(new Integer(1), new Float(2.0f)));
  }

  @Test
  public void test17() {
    Assert.assertEquals(-1, Box001.get17(new Integer(1)));
  }

  @Test
  public void test18() {
    Assert.assertEquals(1, Box001.get18(new Integer(2)));
  }

  @Test
  public void test19() {
    Assert.assertFalse(Box001.get19(new Boolean(true)));
  }

  @Test
  public void test20() {
    Assert.assertEquals(2, Box001.get20(new Integer(2)));
  }

  @Test
  public void test21() {
    short val = 2;
    Assert.assertEquals(2, Box001.get21(new Short(val)));
  }

  @Test
  public void test22() {
    Assert.assertEquals(~16, Box001.get22(new Integer(16)));
  }

  @Test
  public void test23() {
    Assert.assertTrue(Box001.get23(new Integer(16)));
  }

  @Test
  public void test24() {
    Assert.assertTrue(Box001.get24(new Boolean(true)));
    Assert.assertFalse(Box001.get24(new Boolean(false)));
  }

  @Test
  public void test25() {
    Assert.assertTrue(Box001.get25(new Boolean(true)));
    Assert.assertFalse(Box001.get25(new Boolean(false)));
  }

  @Test
  public void test26() {
    Assert.assertEquals(16, ((Integer)Box001.get26(16l)).intValue());
  }

  @Test
  public void test27() {
    Assert.assertEquals(16, Box001.get27(new Integer(16)));
  }

  @Test
  public void test28() {
    Assert.assertEquals("2", Box001.get28(new short[]{1,2,3}, true));
  }

  @Test
  public void test29() {
    Assert.assertEquals("1,true", Box001.get29(1,true));
  }

  @Test
  public void test30() {
    Assert.assertEquals(1, Box001.get30()[0].intValue());
    Assert.assertEquals(2, Box001.get30()[1].intValue());
  }

  @Test
  public void test31() {
    Assert.assertEquals(1, Box001.get31()[0]);
    Assert.assertEquals(2, Box001.get31()[1]);
  }

  @Test
  public void test32() {
    Assert.assertEquals(1, Box001.get32(new Integer(1)));
    Assert.assertEquals(2, Box001.get32(new Integer(2)));
  }

  @Test
  public void test33() {
    Assert.assertEquals(1, Box001.get33(new Integer(1)));
    Assert.assertEquals(0, Box001.get33(new Integer(2)));
  }

  @Test
  public void test34() {
    Assert.assertEquals(1, Box001.get34(new Boolean(true)));
    Assert.assertEquals(0, Box001.get34(new Boolean(false)));
  }

  @Test
  public void test35() {
    Assert.assertEquals(1, Box001.get35(new Boolean(true)));
    Assert.assertEquals(0, Box001.get35(new Boolean(false)));
  }

  @Test
  public void test36() {
    Assert.assertEquals(1, Box001.get36(new Boolean(true)));
    Assert.assertEquals(0, Box001.get36(new Boolean(false)));
  }

  @Test
  public void test37() {
    Assert.assertEquals(2, Box001.get37(new Boolean(true)));
    Assert.assertEquals(1, Box001.get37(new Boolean(false)));
  }

  @Test
  public void test38() {
    Assert.assertEquals(2, Box001.get38(new Boolean(true)));
    Assert.assertEquals(0, Box001.get38(new Boolean(false)));
  }

  @Test
  public void test39() {
    Assert.assertFalse(Box001.get39("ab"));
  }

  @Test
  public void test41() {
    Assert.assertEquals(16 + 16, Box001.get41(new Integer(16), new Integer(16)));
  }

  @Test
  public void test42() {
    Assert.assertTrue(Box001.get42(new Double(0.5), new Double(0.5)) == (0.5 + 0.5));
  }

  @Test
  public void test43() {
    Assert.assertEquals(1, Box001.get43());
  }

  @Test
  public void test44() {
    Assert.assertEquals(10, Box001.get44());
  }

  @Test
  public void test45() {
    Assert.assertEquals(2 & 4, Box001.get45(new Integer(2), new Integer(4)).intValue());
  }

  @Test
  public void test46() {
    Assert.assertEquals(1, Box001.get46(true, new Boolean(true)));
    Assert.assertEquals(0, Box001.get46(false, new Boolean(true)));
  }

  @Test
  public void test47() {
    Assert.assertEquals(2, Box001.get47(1));
  }

  @Test
  public void test48() {
    try {
      Box001.get48();
      Assert.fail();
    } catch (NullPointerException e) {
      // expected
    }
  }
}