UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

Generated two tests with the same input and different output [BUG]

Open operasfantom opened this issue 2 years ago • 0 comments

Description Suspicious tests are generated for simple C++ code.

To Reproduce Steps to reproduce the behavior:

  1. Open UTBot online
  2. Choose C++
  3. Paste code
#include <cmath>
#include <cstring>
#include <vector>

using namespace std;

int foo(std::vector<int> v) 
{
  // TODO: write your code here
  return 0;
}
  1. Generate and run tests

Expected behavior One regression test is supposed to be generated.

Actual behavior One regression and one error test are generated.

Visual proofs (screenshots, logs)

/*
 * This file is automatically generated by UnitTestBot. For further information seehttps://unittestbot.org
 */

#include "snippet_dot_cpp_test.h"

#include "gtest/gtest.h"

#include "access_private.hpp"


namespace UTBot {
static const float utbot_abs_error = 1e-6;


#pragma region regression
TEST(regression, foo_test_1)
{
    int actual = foo({
});
    EXPECT_EQ(0, actual);
}

#pragma endregion
#pragma region error
TEST(error, foo_test_2)
{
    foo({
});
}

#pragma endregion
}

Environment UTBot Online.

Additional context No context.

operasfantom avatar Jul 04 '22 15:07 operasfantom