Skip to content

[BUG] Unnecessary "utbot_abs_error" constant added to the test #405

Closed
@tyuldashev

Description

@tyuldashev

Version
2022.8.233
Description
UTBot adds unused constant to the test
static const float utbot_abs_error = 1e-6;

Generate code for following function

char a_or_b(char a, char b) {
  if (a == 'a')
    return a;
  else 
    return b;
}

Result is

#include "snippet_dot_c_test.h"

#include "gtest/gtest.h"
namespace UTBot {
static const float utbot_abs_error = 1e-6;


#pragma region regression
TEST(regression, a_or_b_test_1)
{
    char actual = a_or_b('h', 'c');
    EXPECT_EQ('c', actual);
}

TEST(regression, a_or_b_test_2)
{
    char actual = a_or_b('a', 'c');
    EXPECT_EQ('a', actual);
}

#pragma endregion
}

generated constant utbot_abs_error is unused and seems unecessary.

Metadata

Metadata

Assignees

Labels

questionFurther information is requestedverifiedBug fix is verified

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions