UTBotCpp
UTBotCpp copied to clipboard
[BUG] Stubs definitions are not generated in tests
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:
- Open the c-example project in VSCode
- Select
srctarget - check that
Use stubsoption is enabled in settings - Go to
src/calc.cfile and generate tests for functionother_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
}