Skip to content
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

Writing output after asserting redirected output causes a crash. #508

Open
oliversheridanmethven opened this issue Jul 29, 2023 · 1 comment

Comments

@oliversheridanmethven
Copy link

When I try and have a test which looks to print output after having made assertions on redirected output, then the test crashes:

Works

Test(capturing_output, std_output, .init = redirect_all_stdout)
{
    fprintf(stderr, "something");
    cr_assert_stderr_eq_str("something");
}

Crashes

Test(capturing_output, std_output, .init = redirect_all_stdout)
{
    fprintf(stderr, "something");
    cr_assert_stderr_eq_str("something");
    fprintf(stderr, " else");
}
[----] /Users/oliver/ClionProjects/testing/src/testing/tests/example.c:28: Unexpected signal caught below this line!
[FAIL] capturing_output::std_output: CRASH!
[====] Synthesis: Tested: 4 | Passing: 3 | Failing: 1 | Crashing: 1 
@MrAnno
Copy link
Collaborator

MrAnno commented Aug 11, 2023

Thank you for reporting this issue.

This is the consequence of #451 (comment), it will be fixed together with #451.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants