From d42c9b450a1f1dfe1e26b0ca8ff177e4696302bb Mon Sep 17 00:00:00 2001 From: Daniel Arndt Date: Mon, 17 Feb 2020 23:26:23 -0500 Subject: [PATCH] Add comments describing the redefinition --- .clang-format | 2 ++ tests/tests.h | 4 ++++ 2 files changed, 6 insertions(+) diff --git a/.clang-format b/.clang-format index 3d294fafa2..8704ab69cd 100644 --- a/.clang-format +++ b/.clang-format @@ -127,6 +127,8 @@ IncludeCategories: # should not be caught here - Regex: "<[a-z_]+>" Priority: 100000 +# make sure that "../tests.h" appears before all other local include files +# such that replacing Assert in tests also applies to the testing header files. - Regex: "\\.\\./tests\\.h" Priority: 200000 diff --git a/tests/tests.h b/tests/tests.h index 5de7e366e8..749f462425 100644 --- a/tests/tests.h +++ b/tests/tests.h @@ -64,6 +64,10 @@ struct DisableWindowsDebugRuntimeDialog } deal_II_windows_crt_dialog; #endif +// Redefine Assert as AssertThrow to make sure that the code is tested similarly +// in Release mode and in Debug mode. clang-format makes sure that this file is +// included after all regular header files but before all the other local header +// files. #undef Assert #define Assert AssertThrow -- 2.39.5