UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

[BUG] Stubs definitions are not generated in tests

Open vol0n opened this issue 3 years ago • 0 comments

Description When you generate tests with stubs, stubs are generated but the initializations of stubs arrays are missing.

To Reproduce Steps to reproduce the behavior:

  1. Open the c-example project in VSCode
  2. Select src target
  3. check that Use stubs option is enabled in settings
  4. Go to src/calc.c file and generate tests for function other_module_call

Expected behavior Generated tests should contain stubs initializations as in wiki/stubs

Actual behavior Tests are generated without stubs initializations

Visual proofs (screenshots, logs) Generated test:

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


#pragma region regression
TEST(regression, other_module_call_test_1)
{
    // Construct input
    int a = 0;



    // Expected output
    int expected = 1;

    // Trigger the function
    int actual = other_module_call(a);

    // Check results
    EXPECT_EQ(expected, actual);
}

TEST(regression, other_module_call_test_2)
{
    // Construct input
    int a = 0;



    // Expected output
    int expected = 2;

    // Trigger the function
    int actual = other_module_call(a);

    // Check results
    EXPECT_EQ(expected, actual);
}

#pragma endregion
}

vol0n avatar Aug 30 '22 08:08 vol0n