Closed
Description
Description
We don't generate tests for autogenerated Kotlin getters/setters in plugin, we shouldn't do this in cli/contest estimator as well.
To Reproduce
Launch UtBot from cli for the following class:
class CheckedAddition(var x: Int) {
fun addWithCheck(y: Int): Int? {
val res = x.toLong() + y.toLong()
if (res >= Int.MIN_VALUE && res <= Int.MAX_VALUE) {
this.x = res.toInt()
return res.toInt()
}
return null
}
}
Expected behavior
Correct tests are generated
Actual behavior
UtBot tries to generate tests for setX()
and getX()
and produce incorrect tests:
Visual proofs (screenshots, logs, images)
@Test
fun testGetX1() {
val checkedAddition = CheckedAddition(1409199696)
val actual = checkedAddition.getX()
assertEquals(1409199696, actual)
}
Additional context
I think this should be changed in a way similar to #1192
Metadata
Metadata
Assignees
Type
Projects
Status
Done