Skip to content

[BUG] Depending on verbose setting 'FAIL()' is added to the error test or not #472

@tyuldashev

Description

@tyuldashev

To Reproduce
Generate test for following code

int div(int a, int b) {
  return a / b;
}

Actual behavior
When Verbose setting is enabled following error test is generated

TEST(error, div_test_2)
{
    // Construct input
    int a = 0;
    int b = 0;

    // Trigger the function
    div(a, b);

    FAIL() << "Unreachable point. Function was supposed to fail, but actually completed successfully.";
}

When Verbose is disabled then:

TEST(error, div_test_2)
{
    div(0, 0);
}

As result depending on verbose setting test behaves completely differently.

Expected

UTBot either adds FAIL() at the end of the test in both situations or doesn't add it not matter what state of Verbose setting is.

Metadata

Metadata

Labels

bugSomething isn't workinggood first issueGood for newcomersverifiedBug fix is verifiedwrong generationInadequate or empty test suite generated

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions