tanghong123 / googletest

Automatically exported from code.google.com/p/googletest
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

EXPECT_(NON_)FATAL_FAILURE macros doesn't print actual text of the faulire #91

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When EXPECT_NON_FATAL_FAILURE intercepts a failure, and the failure message
doesn't match the expected one, the macro generates an error which text is
supposed to contain both expected and actual failure text.

What is the expected output? What do you see instead?
The macro prints an empty string instead of an actual error message.

Original issue reported on code.google.com by vladlosev on 20 Dec 2008 at 3:10

GoogleCodeExporter commented 9 years ago

Original comment by vladlosev on 9 Jan 2009 at 7:08

GoogleCodeExporter commented 9 years ago

Original comment by zhanyong...@gmail.com on 5 May 2009 at 8:50

GoogleCodeExporter commented 9 years ago
I seem to remember that at one point you said you could no longer repro this.  
Is
that so?

Original comment by w...@google.com on 10 Dec 2009 at 8:02

GoogleCodeExporter commented 9 years ago

Original comment by w...@google.com on 6 Mar 2010 at 6:07

GoogleCodeExporter commented 9 years ago
I've decided to take a quick look at this. The bug is not reproducible. It must 
have
been not there in the first place. What have confused me is that the error 
message
generator inserts a newline between "Actual:" and the error message:

third_party/gtest/src/gtest.cc:697: Failure
Expected: 1 non-fatal failure containing "other text"
  Actual:
third_party/gtest/test/gtest_main_unittest.cc:41: Non-fatal failure:
Value of: 2+2
  Actual: 4
Expected: 5
Stack trace:
0x004006be: (anonymous namespace)::GTestMainTest_ShouldSucceed_Test::TestBody()

It may be worth removing that newline.

Original comment by vl...@google.com on 9 Mar 2010 at 9:00