diff options
author | jgm <jgm@google.com> | 2012-03-09 17:12:39 (GMT) |
---|---|---|
committer | jgm <jgm@google.com> | 2012-03-09 17:12:39 (GMT) |
commit | f0b86fc3b0f625e1db84f3632cb37bd9eae6ae19 (patch) | |
tree | dea331f222e639cfc37f481766bbc88ce20dc7cb /include/gtest/internal/gtest-death-test-internal.h | |
parent | cfb40870bc74dc57616e286461a89c9f259b349d (diff) | |
download | googletest-f0b86fc3b0f625e1db84f3632cb37bd9eae6ae19.zip googletest-f0b86fc3b0f625e1db84f3632cb37bd9eae6ae19.tar.gz googletest-f0b86fc3b0f625e1db84f3632cb37bd9eae6ae19.tar.bz2 |
Misc small updates to some debug death code, and to messages streaming to macros
Diffstat (limited to 'include/gtest/internal/gtest-death-test-internal.h')
-rw-r--r-- | include/gtest/internal/gtest-death-test-internal.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/gtest/internal/gtest-death-test-internal.h b/include/gtest/internal/gtest-death-test-internal.h index 1d9f83b..22bb97f 100644 --- a/include/gtest/internal/gtest-death-test-internal.h +++ b/include/gtest/internal/gtest-death-test-internal.h @@ -217,6 +217,17 @@ GTEST_API_ bool ExitedUnsuccessfully(int exit_status); // The symbol "fail" here expands to something into which a message // can be streamed. +// This macro is for implementing ASSERT/EXPECT_DEBUG_DEATH when compiled in +// NDEBUG mode. In this case we need the statements to be executed, the regex is +// ignored, and the macro must accept a streamed message even though the message +// is never printed. +# define GTEST_EXECUTE_STATEMENT_(statement, regex) \ + GTEST_AMBIGUOUS_ELSE_BLOCKER_ \ + if (::testing::internal::AlwaysTrue()) { \ + GTEST_SUPPRESS_UNREACHABLE_CODE_WARNING_BELOW_(statement); \ + } else \ + ::testing::Message() + // A class representing the parsed contents of the // --gtest_internal_run_death_test flag, as it existed when // RUN_ALL_TESTS was called. |