Skip to content

Commit cfe4ae6

Browse files
committed
*** What to do ***
1 parent 86e5c17 commit cfe4ae6

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

utbot-framework-test-java11/src/test/kotlin/org/utbot/examples/java11/collections/ToArrayWithGeneratorTest.kt

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ class ToArrayWithGeneratorTest : UtValueTestCaseChecker(
3131
}
3232

3333
@Test
34+
@Disabled("TODO: we can't yet model throwing ArrayStoreException")
3435
fun testCheckSetSizeArrayStoreException() {
3536
checkWithException(
3637
ToArrayWithGenerator<Int>::checkSetSizeArrayStoreException,
@@ -72,6 +73,7 @@ class ToArrayWithGeneratorTest : UtValueTestCaseChecker(
7273
}
7374

7475
@Test
76+
@Disabled("TODO: we can't yet model throwing ArrayStoreException")
7577
fun testGetMapEntrySetArrayStoreException() {
7678
checkWithException(
7779
ToArrayWithGenerator<Int>::getMapEntrySetArrayStoreException,

utbot-framework/src/main/kotlin/org/utbot/engine/Resolver.kt

+7
Original file line numberDiff line numberDiff line change
@@ -800,6 +800,13 @@ class Resolver(
800800
}
801801

802802
val evaluatedType = workaround(HACK) { memory.findTypeForArrayOrNull(instance.addr) ?: instance.type }
803+
804+
// Instead of previous line, we can try to get element type from the solver, but something will break
805+
// val evaluatedType = holder.constructTypeOrNull(instance.addr, instance.type) as? ArrayType ?: instance.type
806+
807+
// GENERAL IDEA: check for ArrayStoreException when processing array store, not `toArray` or like.
808+
// See as ClassCastException is implemented (and NPE as well)
809+
803810
val evaluatedBaseType = evaluatedType.baseType
804811

805812
val chunkId = typeRegistry.arrayChunkId(evaluatedType)

0 commit comments

Comments
 (0)