Skip to content

STDIN redirect disappeared from the tests #554

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
tyuldashev opened this issue Nov 29, 2022 · 1 comment · Fixed by #563
Closed

STDIN redirect disappeared from the tests #554

tyuldashev opened this issue Nov 29, 2022 · 1 comment · Fixed by #563
Assignees
Labels
bug Something isn't working regression Regression verified Bug fix is verified wrong generation Inadequate or empty test suite generated

Comments

@tyuldashev
Copy link
Collaborator

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);
}
@tyuldashev tyuldashev added bug Something isn't working wrong generation Inadequate or empty test suite generated labels Nov 29, 2022
@tyuldashev tyuldashev moved this to Todo in UTBot C/C++ Nov 29, 2022
@tyuldashev
Copy link
Collaborator Author

BTW any chance we could write unit tests to detect such problems in future? That redirection part is inserted [and actually works].

@tyuldashev tyuldashev added the regression Regression label Nov 30, 2022
Repository owner moved this from Todo to Done in UTBot C/C++ Dec 21, 2022
@tyuldashev tyuldashev added the verified Bug fix is verified label Dec 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working regression Regression verified Bug fix is verified wrong generation Inadequate or empty test suite generated
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants