Skip to content

Commit ce95cf2

Browse files
standardising unit-test includes
so that external contributors (and importantly right now, example PRs) can contribute new, self-contained unit test code without needing to incorporate new headers
1 parent 1c051cf commit ce95cf2

File tree

4 files changed

+11
-2
lines changed

4 files changed

+11
-2
lines changed

tests/unit/calculations.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
#include <catch2/catch_test_macros.hpp>
1313
#include <catch2/generators/catch_generators_range.hpp>
14+
#include <catch2/matchers/catch_matchers_string.hpp>
1415
#include <catch2/matchers/catch_matchers_floating_point.hpp>
1516

1617
#include "tests/utils/qvector.hpp"
@@ -29,8 +30,8 @@
2930
#include <algorithm>
3031
#include <type_traits>
3132

33+
using Catch::Matchers::ContainsSubstring;
3234
using std::vector;
33-
using namespace Catch::Matchers;
3435

3536

3637

tests/unit/decoherence.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "quest/include/quest.h"
1111

1212
#include <catch2/catch_test_macros.hpp>
13+
#include <catch2/matchers/catch_matchers_string.hpp>
1314
#include <catch2/generators/catch_generators_range.hpp>
1415

1516
#include "tests/utils/qvector.hpp"
@@ -26,6 +27,7 @@
2627
#include <vector>
2728
#include <algorithm>
2829

30+
using Catch::Matchers::ContainsSubstring;
2931
using std::vector;
3032

3133

tests/unit/initialisations.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "quest/include/quest.h"
1111

1212
#include <catch2/catch_test_macros.hpp>
13+
#include <catch2/matchers/catch_matchers_string.hpp>
1314
#include <catch2/generators/catch_generators_range.hpp>
1415

1516
#include "tests/utils/qvector.hpp"
@@ -24,6 +25,8 @@
2425
#include "tests/utils/measure.hpp"
2526
#include "tests/utils/random.hpp"
2627

28+
using Catch::Matchers::ContainsSubstring;
29+
2730

2831

2932
/*

tests/unit/types.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
#include "quest/include/quest.h"
1111

1212
#include <catch2/catch_test_macros.hpp>
13+
#include <catch2/matchers/catch_matchers_string.hpp>
1314

1415
#include "tests/utils/qvector.hpp"
1516
#include "tests/utils/qmatrix.hpp"
@@ -21,6 +22,8 @@
2122
#include "tests/utils/macros.hpp"
2223
#include "tests/utils/random.hpp"
2324

25+
using Catch::Matchers::ContainsSubstring;
26+
2427

2528

2629
/*
@@ -98,4 +101,4 @@ void reportStr(std::string str);
98101
void reportScalar(const char* label, qcomp num);
99102
void reportScalar(const char* label, qreal num);
100103
void reportScalar(std::string label, qcomp num);
101-
void reportScalar(std::string label, qreal num);
104+
void reportScalar(std::string label, qreal num);

0 commit comments

Comments
 (0)