diff options
author | Marco Poletti <poletti.marco@gmail.com> | 2017-12-27 09:23:44 +0000 |
---|---|---|
committer | Marco Poletti <poletti.marco@gmail.com> | 2017-12-27 09:23:44 +0000 |
commit | 1b959abb02fa151f472d9d3cbaefc96a292985fe (patch) | |
tree | de2eaef1e9d57d4ab172069accfc0215dd2b7073 /tests/test_macros.h | |
parent | dad7ba8e69a1041e8b8315d189ed278b45f6f621 (diff) | |
download | google-fruit-1b959abb02fa151f472d9d3cbaefc96a292985fe.tar.gz |
Add a .clang-format config file and reformat all C++ source code using that. Also added some documentation on the preferred style in CONTRIBUTING.md.
Diffstat (limited to 'tests/test_macros.h')
-rw-r--r-- | tests/test_macros.h | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/tests/test_macros.h b/tests/test_macros.h index f9bff4c..8d850e1 100644 --- a/tests/test_macros.h +++ b/tests/test_macros.h @@ -19,8 +19,18 @@ #include <iostream> -#define Assert(...) do { if (!(__VA_ARGS__)) { std::cerr << __FILE__ << ":" << __LINE__ << ": " << __func__ << ": Assertion \"" << #__VA_ARGS__ << "\" failed." << std::endl; abort(); } } while(false) +#define Assert(...) \ + do { \ + if (!(__VA_ARGS__)) { \ + std::cerr << __FILE__ << ":" << __LINE__ << ": " << __func__ << ": Assertion \"" << #__VA_ARGS__ << "\" failed." \ + << std::endl; \ + abort(); \ + } \ + } while (false) -#define InstantiateType(...) void f() { (void) sizeof(__VA_ARGS__); } +#define InstantiateType(...) \ + void f() { \ + (void)sizeof(__VA_ARGS__); \ + } #endif // FRUIT_TEST_MACROS |