Skip to content

STDIN redirect disappeared from the tests #554

@tyuldashev

Description

@tyuldashev

Description
During test generation UTBot used to substitute stdin with own construction, now it does not anymore, so tests with user input fail.

To Reproduce
Steps to reproduce the behavior:

  1. Open c-examples from UTBotCPP project
  2. Generate tests for int simple_getc() function in file input_output.c

Expected behavior
Previously tests looked like this:

TEST(regression, simple_getc_test_1)
{
    char stdin_buf[] = "\"""";
    int utbot_redirect_stdin_status = 0;
    utbot_redirect_stdin(stdin_buf, utbot_redirect_stdin_status);
    if (utbot_redirect_stdin_status != 0) {
        FAIL() << "Unable to redirect stdin.";
    }
    int actual = simple_getc();
    EXPECT_EQ(-1, actual);
}

Actual behavior
Now utbot_redirect_stdin initialization part disappeared and test looks like this:

TEST(regression, simple_getc_test_1)
{
    int actual = simple_getc();
    EXPECT_EQ(9, actual);
}

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingregressionRegressionverifiedBug fix is verifiedwrong generationInadequate or empty test suite generated

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions