diff options
Diffstat (limited to 'jack-tests/tests/com/android/jack/constant/clazz')
-rw-r--r-- | jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java | 80 | ||||
-rw-r--r-- | jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java | 60 |
2 files changed, 140 insertions, 0 deletions
diff --git a/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java b/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java new file mode 100644 index 0000000..583b5de --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/clazz/dx/Tests.java @@ -0,0 +1,80 @@ +/* + * 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.constant.clazz.dx; + +import com.android.jack.constant.clazz.jack.Data; + +import junit.framework.Assert; + +import org.junit.Test; + +/** + * Tests class. + */ +public class Tests { + + @Test + public void getPrimitiveVoidClass() { + Assert.assertTrue(Data.getPrimitiveVoidClass().getName().equals("void")); + } + + @Test + public void getPrimitiveByteClass() { + Assert.assertTrue(Data.getPrimitiveByteClass().getName().equals("byte")); + } + + @Test + public void getPrimitiveBooleanClass() { + Assert.assertTrue(Data.getPrimitiveBooleanClass().getName().equals("boolean")); + } + + @Test + public void getPrimitiveCharClass() { + Assert.assertTrue(Data.getPrimitiveCharClass().getName().equals("char")); + } + + @Test + public void getPrimitiveShortClass() { + Assert.assertTrue(Data.getPrimitiveShortClass().getName().equals("short")); + } + + @Test + public void getPrimitiveIntClass() { + Assert.assertTrue(Data.getPrimitiveIntClass().getName().equals("int")); + } + + @Test + public void getPrimitiveFloatClass() { + Assert.assertTrue(Data.getPrimitiveFloatClass().getName().equals("float")); + } + + @Test + public void getPrimitiveLongClass() { + Assert.assertTrue(Data.getPrimitiveLongClass().getName().equals("long")); + } + + @Test + public void getPrimitiveDoubleClass() { + Assert.assertTrue(Data.getPrimitiveDoubleClass().getName().equals("double")); + } + + @Test + public void getObjectVoidClass() { + System.out.println(Data.getObjectVoidClass().getName()); + Assert.assertTrue(Data.getObjectVoidClass().getName().equals("java.lang.Void")); + } +} diff --git a/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java b/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java new file mode 100644 index 0000000..a108f22 --- /dev/null +++ b/jack-tests/tests/com/android/jack/constant/clazz/jack/Data.java @@ -0,0 +1,60 @@ +/* + * 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.constant.clazz.jack; + +public class Data { + + public static Class<?> getPrimitiveVoidClass() { + return void.class; + } + + public static Class<?> getPrimitiveIntClass() { + return int.class; + } + + public static Class<?> getPrimitiveBooleanClass() { + return boolean.class; + } + + public static Class<?> getPrimitiveByteClass() { + return byte.class; + } + + public static Class<?> getPrimitiveCharClass() { + return char.class; + } + + public static Class<?> getPrimitiveShortClass() { + return short.class; + } + + public static Class<?> getPrimitiveFloatClass() { + return float.class; + } + + public static Class<?> getPrimitiveDoubleClass() { + return double.class; + } + + public static Class<?> getPrimitiveLongClass() { + return long.class; + } + + public static Class<?> getObjectVoidClass() { + return Void.class; + } +} |