UTBotCpp
UTBotCpp copied to clipboard
Two identical tests with expected different results
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:
- Open
c-exampleproject - Enable
Use Stubsoption - Select
libsrc.atarget - Generate tests for
src/calc.c#other_module_callfunction
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.