Skip to content

Calls to Kotlin autogenerated setter isn't changed to direct property access for tests from fuzzer #1241

Closed

Description

@volivan239

Description

Fixes from #1002 seems not to work properly if the model is produced by fuzzer.

To Reproduce

Launch action on the following class (use only fuzzer):

class Example() {
    var x: Int = 3
    fun f(): Int {
        return x
    }
}

Expected behavior

Tests are generated properly.

Actual behavior

Incorrect tests with calls to .setX() are generated.

Visual proofs (screenshots, logs, images)

Example of generated test:

@Test
@DisplayName("f: arg_0 = Example() -> return 1409199696")
fun testF() {
    val example = Example()
    example.setX(1409199696)
    
    val actual = example.f()
    
    assertEquals(1409199696, actual)
}

Environment

Test generation method -- Fuzzing 100%

Activity

  1. added
    ctg-bug
    comp-codegen
    comp-fuzzing
    on Oct 26, 2022
  2. self-assigned this
    on Oct 26, 2022
  3. moved this to Todo in UTBot Javaon Oct 26, 2022
  4. added
    lang-kotlin
    on Oct 28, 2022
  5. Repository owner moved this from Todo to Done in UTBot Javaon Nov 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

comp-codegencomp-fuzzingctg-buglang-kotlin

Type

No type

Projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions