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

Method testSubtypeArray1

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

Test arrays and some special classes.

()

Source from the content-addressed store, hash-verified

67 * Test arrays and some special classes.
68 */
69 @Test
70 void testSubtypeArray1() {
71 Type intArray = typeSystem.getArrayType(INT, 1);
72 Type object = typeSystem.getClassType(ClassNames.OBJECT);
73 assertTrue(typeSystem.isSubtype(object, intArray));
74
75 Type serializable = typeSystem.getClassType(ClassNames.SERIALIZABLE);
76 assertTrue(typeSystem.isSubtype(serializable, intArray));
77
78 Type cloneable = typeSystem.getClassType(ClassNames.CLONEABLE);
79 assertTrue(typeSystem.isSubtype(cloneable, intArray));
80
81 Type a = typeSystem.getClassType("A");
82 assertFalse(typeSystem.isSubtype(a, intArray));
83 }
84
85 /**
86 * Test arrays with different dimensions.

Callers

nothing calls this directly

Calls 3

getArrayTypeMethod · 0.65
getClassTypeMethod · 0.65
isSubtypeMethod · 0.65

Tested by

no test coverage detected