Skip to content

Two identical tests with expected different results #547

Open
@tyuldashev

Description

@tyuldashev

Description
Sometimes when target is explicitly selected UTBot generates two test with identical steps, but with different expected results.

To Reproduce
Steps to reproduce the behavior:

  1. Open c-example project
  2. Enable Use Stubs option
  3. Select libsrc.a target
  4. Generate tests for src/calc.c#other_module_call function

Expected behavior
One regression test is generated, because libfunc just returns constant value 10. Also if user selected UTBot: Auto target, then only one test is generated as expected.

Actual behavior
Two tests are generated with the same parameter calls, but different expected results, like this:

TEST(regression, other_module_call_test_1)
{
    int actual = other_module_call(0);
    EXPECT_EQ(2, actual);
}

TEST(regression, other_module_call_test_2)
{
    int actual = other_module_call(0);
    EXPECT_EQ(1, actual);
}

Additional context
Also dependence on Target option value looks suspicion.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingwrong generationInadequate or empty test suite generated

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions