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

Method testSubtypeArray2

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

Test arrays with different dimensions.

()

Source from the content-addressed store, hash-verified

86 * Test arrays with different dimensions.
87 */
88 @Test
89 void testSubtypeArray2() {
90 Type intArray2 = typeSystem.getArrayType(INT, 2);
91 Type object = typeSystem.getClassType(ClassNames.OBJECT);
92 Type objectArray = typeSystem.getArrayType(object, 1);
93 assertTrue(typeSystem.isSubtype(objectArray, intArray2));
94
95 Type intArray3 = typeSystem.getArrayType(INT, 3);
96 assertTrue(typeSystem.isSubtype(objectArray, intArray3));
97 }
98
99 /**
100 * Test arrays of different classes with subtyping relation.

Callers

nothing calls this directly

Calls 3

getArrayTypeMethod · 0.65
getClassTypeMethod · 0.65
isSubtypeMethod · 0.65

Tested by

no test coverage detected