Re: Beware of ASSERT_* Placement

2015-07-28 Thread Bernd Mathiske
IMHO we would be better off with exception-based asserts, checks, and expects. Bernd On Jul 28, 2015, at 7:53 AM, Paul Brett pbr...@twitter.com.INVALID wrote: Michael I think Ben's suggestion of using Try is just what we want for common functions. In regards to ASSERTs, they can cause

Re: Beware of ASSERT_* Placement

2015-07-28 Thread Benjamin Mahler
Because? On Tue, Jul 28, 2015 at 12:54 AM, Bernd Mathiske be...@mesosphere.io wrote: IMHO we would be better off with exception-based asserts, checks, and expects. Bernd On Jul 28, 2015, at 7:53 AM, Paul Brett pbr...@twitter.com.INVALID wrote: Michael I think Ben's suggestion of

Beware of ASSERT_* Placement

2015-07-27 Thread Michael Park
I've had at least 3 individuals who ran into the issue of *ASSERT_** macro placement and since the generated error message is less than useless, I would like to share with you what the issue is. The source of the issue is that *ASSERT_** macros from *gtest* can only be placed in functions that

Re: Beware of ASSERT_* Placement

2015-07-27 Thread Paul Brett
Mike I would suggest that we want to avoid both ASSERT and CHECK macros in tests. With ASSERT, I completely agree with you about the perils of using ASSERT that you list above, but additionally we have cases where ASSERT exits a test fixture skipping later tests that might or might not have

Re: Beware of ASSERT_* Placement

2015-07-27 Thread Benjamin Mahler
Michael, note that we've avoided having ASSERT_ or EXPECT_ inside test helper methods because they print out the line number of the helper method, rather than the line number where the helper method was called from the test. This is why we've been pretty careful when adding helpers and have tried

Re: Beware of ASSERT_* Placement

2015-07-27 Thread Michael Park
Paul, With ASSERT, I completely agree with you about the perils of using ASSERT that you list above, but additionally we have cases where ASSERT exits a test fixture skipping later tests that might or might not have failed. We should only be using *ASSERT_** in cases where it doesn't make