UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

Two identical tests with expected different results

Open tyuldashev opened this issue 3 years ago • 0 comments

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.

tyuldashev avatar Nov 21 '22 13:11 tyuldashev