Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Add missing <cassert> includes

Until recently we were probably getting it from some transitive
include, but it broke. Because all files should include what
they use anyway, adding `#include <cassert>` to all files that
use `assert()` without including it is the best solution.

Fixes #1249
Commit
3255ee6312030db754707ca9ccc44f3d563583c8
Author
Martin Hořeňovský ·
Parents
74effafca7f4

Files · Download .tar.gz

Changes

 include/internal/catch_result_builder.hpp     | 2 ++
 include/internal/catch_run_context.hpp        | 2 +-
 include/reporters/catch_reporter_console.hpp  | 1 +
 include/reporters/catch_reporter_teamcity.hpp | 1 +
 4 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/internal/catch_result_builder.hpp b/include/internal/catch_result_builder.hpp
index e7a5bdd2..843562ac 100644
--- a/include/internal/catch_result_builder.hpp
+++ b/include/internal/catch_result_builder.hpp
@@ -16,6 +16,8 @@
 #include "catch_interfaces_registry_hub.h"
 #include "catch_wildcard_pattern.hpp"
 
+#include <cassert>
+
 namespace Catch {
 
     ResultBuilder::ResultBuilder(   char const* macroName,
diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp
index be9b5521..67ff68b6 100644
--- a/include/internal/catch_run_context.hpp
+++ b/include/internal/catch_run_context.hpp
@@ -22,7 +22,7 @@
 #include "catch_result_builder.h"
 #include "catch_fatal_condition.hpp"
 
-
+#include <cassert>
 #include <set>
 #include <string>
 
diff --git a/include/reporters/catch_reporter_console.hpp b/include/reporters/catch_reporter_console.hpp
index 5f181241..a4bac1de 100644
--- a/include/reporters/catch_reporter_console.hpp
+++ b/include/reporters/catch_reporter_console.hpp
@@ -13,6 +13,7 @@
 #include "../internal/catch_reporter_registrars.hpp"
 #include "../internal/catch_console_colour.hpp"
 
+#include <cassert>
 #include <cfloat>
 #include <cstdio>
 
diff --git a/include/reporters/catch_reporter_teamcity.hpp b/include/reporters/catch_reporter_teamcity.hpp
index af3505bd..3640ab89 100644
--- a/include/reporters/catch_reporter_teamcity.hpp
+++ b/include/reporters/catch_reporter_teamcity.hpp
@@ -14,6 +14,7 @@
 // file can be distributed as a single header that works with the main
 // Catch single header.
 
+#include <cassert>
 #include <cstring>
 
 #ifdef __clang__