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

CATCH_CONFIG_CONSOLE_WIDTH ignored for reconstructing expressions #1775

Open
stinos opened this issue Oct 16, 2019 · 0 comments
Open

CATCH_CONFIG_CONSOLE_WIDTH ignored for reconstructing expressions #1775

stinos opened this issue Oct 16, 2019 · 0 comments

Comments

@stinos
Copy link

stinos commented Oct 16, 2019

Describe the bug
When the length of stringified lhs and rhs of an expression is more than 40 characters it gets split due to

if( lhs.size() + rhs.size() < 40 &&
This makes the output harder to parse automatically, leading to JohnnyHendriks/TestAdapter_Catch2#32.

Expected behavior
Split according to CATCH_CONFIG_CONSOLE_WIDTH instead of 40.

Reproduction steps
Code:

TEST_CASE( "BreakingLine" )
{
  CHECK( 100000000000 == 9999999 );
}

Produces:

xxx.cpp(yy): FAILED:
  CHECK( 100000000000 == 9999999 )
with expansion:
  100000000000 (0x174876e800)
  ==
  9999999 (0x98967f)

But with CATCH_CONFIG_CONSOLE_WIDTH set to 200 the expected output would be:

xxx.cpp(yy): FAILED:
  CHECK( 100000000000 == 9999999 )
with expansion:
  100000000000 (0x174876e800) == 9999999 (0x98967f)

Platform information:

  • Catch version: v2.1.0

Additional context
Replacing 40 with e.g. (CATCH_CONFIG_CONSOLE_WIDTH - 2 - <current_indent>) is a potential fix.

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

1 participant