UTBotCpp icon indicating copy to clipboard operation
UTBotCpp copied to clipboard

[BUG] 'unsigned long' type instead of 'size_t' for 'actual' and 'expected' variables

Open tyuldashev opened this issue 3 years ago • 0 comments

To Reproduce Steps to reproduce the behavior:

  1. Enable Verbose Formatting for UTBot
  2. Generate tests for following code
size_t min_size_t(size_t a, size_t b) {
    if (a < b) {
        return a;
    }
    return b;
}

Actual behavior Generated test is:

TEST(regression, min_size_t_test_1)
{
    // Construct input
    size_t a = 0UL;
    size_t b = 1UL;



    // Expected output
    unsigned long expected = 0UL;

    // Trigger the function
    unsigned long actual = min_size_t(a, b);

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

Expected behavior Expected that both expected and actual variables would be of size_t type:

TEST(regression, min_size_t_test_1)
{
    // Construct input
    size_t a = 0UL;
    size_t b = 1UL;



    // Expected output
    size_t = 0UL;

    // Trigger the function
    size_t = min_size_t(a, b);

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

tyuldashev avatar Aug 29 '22 15:08 tyuldashev