From acdc1d80ba8ec7037a421d007c13b54ae4b36795 Mon Sep 17 00:00:00 2001 From: Martchus Date: Sun, 4 Feb 2024 20:58:45 +0100 Subject: [PATCH] Allow compilation of tests when doing unity builds Ensure all formatting overloads are always included before CppUnit's headers --- tests/entrytests.cpp | 3 --- tests/fieldtests.cpp | 3 --- tests/opensslrandomdevice.cpp | 2 +- tests/passwordfiletests.cpp | 2 +- tests/utils.h | 4 ++++ 5 files changed, 6 insertions(+), 8 deletions(-) diff --git a/tests/entrytests.cpp b/tests/entrytests.cpp index 0bc0520..413db27 100644 --- a/tests/entrytests.cpp +++ b/tests/entrytests.cpp @@ -2,9 +2,6 @@ #include "./utils.h" -#include -using namespace CppUtilities; - #include #include diff --git a/tests/fieldtests.cpp b/tests/fieldtests.cpp index f66861e..45e01d9 100644 --- a/tests/fieldtests.cpp +++ b/tests/fieldtests.cpp @@ -3,9 +3,6 @@ #include "./utils.h" -#include -using namespace CppUtilities; - #include #include diff --git a/tests/opensslrandomdevice.cpp b/tests/opensslrandomdevice.cpp index 5cdcdfd..b7b2cd7 100644 --- a/tests/opensslrandomdevice.cpp +++ b/tests/opensslrandomdevice.cpp @@ -1,6 +1,6 @@ #include "../util/opensslrandomdevice.h" -#include +#include "./utils.h" #include #include diff --git a/tests/passwordfiletests.cpp b/tests/passwordfiletests.cpp index 96b1a1c..9cb4049 100644 --- a/tests/passwordfiletests.cpp +++ b/tests/passwordfiletests.cpp @@ -2,7 +2,7 @@ #include "../io/entry.h" #include "../io/passwordfile.h" -#include +#include "./utils.h" #include #include diff --git a/tests/utils.h b/tests/utils.h index d8d5b34..8ae11f6 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -23,4 +23,8 @@ inline std::ostream &operator<<(std::ostream &out, const Io::Field *field) } // namespace CppUtilities +#include + +using namespace CppUtilities; + #endif // PASSWORDFILE_TESTS_UTILS_H