summaryrefslogtreecommitdiffstats
path: root/jack-tests/tests/com/android/jack/field/instance004/dx/Tests.java
blob: 5637968fa7d35728f24620b8b823bf4198e54a36 (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
/*
 * 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.field.instance004.dx;

import com.android.jack.field.instance004.jack.Data;
import com.android.jack.field.instance004.jack.Data10;
import com.android.jack.field.instance004.jack.Data11;
import com.android.jack.field.instance004.jack.Data2;
import com.android.jack.field.instance004.jack.Data3;
import com.android.jack.field.instance004.jack.Data4;
import com.android.jack.field.instance004.jack.Data5;
import com.android.jack.field.instance004.jack.Data6;
import com.android.jack.field.instance004.jack.Data7;
import com.android.jack.field.instance004.jack.Data8;
import com.android.jack.field.instance004.jack.Data9;

import junit.framework.Assert;

import org.junit.Test;

public class Tests {

  @Test
  public void test1() {
    Data d = new Data();
    Assert.assertEquals(1, d.j);
  }

  @Test
  public void test2() {
    Data2 d = new Data2();
    Assert.assertEquals(1, d.j);
  }

  @Test
  public void test3() {
    Data3 d = new Data3();
    Assert.assertEquals(0, d.j);
  }

  @Test
  public void test4() {
    Data4 d = new Data4();
    Assert.assertEquals(1, d.j);
  }

  @Test
  public void test5() {
    Data5 d = new Data5();
    Assert.assertEquals(1, d.j);
  }

  @Test
  public void test6() {
    Data6 d = new Data6();
    Assert.assertEquals(1, d.j);
  }

  @Test
  public void test7() {
    Data7.Data7Bis d = new Data7.Data7Bis();
    Assert.assertEquals(1, d.k);
  }

  @SuppressWarnings("static-access")
  @Test
  public void test8() {
    try {
      new Data8().m();
      Assert.fail();
    } catch(NullPointerException npe) {
      // Ok
    }
  }

  @Test
  public void test9() {
    try {
      Data9.m();
      Assert.fail();
    } catch(NullPointerException npe) {
      // Ok
    }
  }

  @Test
  public void test10() {
    try {
      new Data10().m();
      Assert.fail();
    } catch(NullPointerException e) {
      // Ok
    }
  }

  @Test
  public void test11() {
    Assert.assertEquals(1, new Data11().m());
  }
}