diff options
author | Mike Kruskal <mkruskal@google.com> | 2022-12-13 15:11:53 -0800 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-12-13 15:12:32 -0800 |
commit | a13ef44bf3f2ef5399c6fc587a18f3b203b4d37a (patch) | |
tree | 1258c8f13a9791708c62cc70c787e69db4a51775 /absl/log/check_test.cc | |
parent | 4cb6c3893638348ef261716ac47ede4f5f88b8e9 (diff) |
Prevent all CHECK functions from expanding macros for the error string.
This was likely an unintentional behavior change made a while ago while trying to reduce duplication. The new behavior will always include the unexpanded macro in the error string. For example, `CHECK_EQ(MACRO(x), MACRO(y))` will now output "MACRO(x) == MACRO(y)" if it fails. Before this change, CHECK and QCHECK were the only macros that had this behavior.
Not using function-like macro aliases is a possible alternative here, but unfortunately that would flood the macro namespace downstream with CHECK* and break existing code.
PiperOrigin-RevId: 495138582
Change-Id: I6a1afd89a6b9334003362e5d3e55da68f86eec98
Diffstat (limited to 'absl/log/check_test.cc')
-rw-r--r-- | absl/log/check_test.cc | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/absl/log/check_test.cc b/absl/log/check_test.cc index a03183a5..f44a686e 100644 --- a/absl/log/check_test.cc +++ b/absl/log/check_test.cc @@ -16,6 +16,7 @@ #include "absl/log/check.h" #define ABSL_TEST_CHECK CHECK +#define ABSL_TEST_CHECK_OK CHECK_OK #define ABSL_TEST_CHECK_EQ CHECK_EQ #define ABSL_TEST_CHECK_NE CHECK_NE #define ABSL_TEST_CHECK_GE CHECK_GE @@ -28,6 +29,7 @@ #define ABSL_TEST_CHECK_STRCASENE CHECK_STRCASENE #define ABSL_TEST_DCHECK DCHECK +#define ABSL_TEST_DCHECK_OK DCHECK_OK #define ABSL_TEST_DCHECK_EQ DCHECK_EQ #define ABSL_TEST_DCHECK_NE DCHECK_NE #define ABSL_TEST_DCHECK_GE DCHECK_GE @@ -40,6 +42,7 @@ #define ABSL_TEST_DCHECK_STRCASENE DCHECK_STRCASENE #define ABSL_TEST_QCHECK QCHECK +#define ABSL_TEST_QCHECK_OK QCHECK_OK #define ABSL_TEST_QCHECK_EQ QCHECK_EQ #define ABSL_TEST_QCHECK_NE QCHECK_NE #define ABSL_TEST_QCHECK_GE QCHECK_GE |