MCPcopy Create free account
hub / github.com/LFYSec/MScan / testSubtypeArray3

Method testSubtypeArray3

src/test/java/pascal/taie/language/TypeTest.java:102–114  ·  view source on GitHub ↗

Test arrays of different classes with subtyping relation.

()

Source from the content-addressed store, hash-verified

100 * Test arrays of different classes with subtyping relation.
101 */
102 @Test
103 void testSubtypeArray3() {
104 Type object = typeSystem.getClassType(ClassNames.OBJECT);
105 Type objectArray = typeSystem.getArrayType(object, 1);
106 Type a = typeSystem.getClassType("A");
107 Type aArray = typeSystem.getArrayType(a, 1);
108 assertTrue(typeSystem.isSubtype(objectArray, aArray));
109
110 Type b = typeSystem.getClassType("B");
111 Type bArray = typeSystem.getArrayType(b, 1);
112 assertTrue(typeSystem.isSubtype(aArray, bArray));
113 assertFalse(typeSystem.isSubtype(bArray, aArray));
114 }
115
116 @Test
117 void testGetType1() {

Callers

nothing calls this directly

Calls 3

getClassTypeMethod · 0.65
getArrayTypeMethod · 0.65
isSubtypeMethod · 0.65

Tested by

no test coverage detected