mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-23 11:43:29 +01:00
* Suppressed warning for comma-in-indexing-operator in tests that check that specific behaviour. * Made deprecated (and removed) allocator usings conditional on the tests being compiled with old version of MSVC that still requires them. Fixes #2272
This commit is contained in:
parent
3d01f3ae32
commit
dba29b60d6
@ -242,12 +242,14 @@ namespace { namespace MatchersTests {
|
|||||||
|
|
||||||
~CustomAllocator() = default;
|
~CustomAllocator() = default;
|
||||||
|
|
||||||
|
#if defined(_MSC_VER) && _MSVC_LANG < 201703L
|
||||||
using std::allocator<T>::address;
|
using std::allocator<T>::address;
|
||||||
using std::allocator<T>::allocate;
|
|
||||||
using std::allocator<T>::construct;
|
using std::allocator<T>::construct;
|
||||||
using std::allocator<T>::deallocate;
|
|
||||||
using std::allocator<T>::max_size;
|
using std::allocator<T>::max_size;
|
||||||
using std::allocator<T>::destroy;
|
using std::allocator<T>::destroy;
|
||||||
|
#endif
|
||||||
|
using std::allocator<T>::allocate;
|
||||||
|
using std::allocator<T>::deallocate;
|
||||||
};
|
};
|
||||||
|
|
||||||
TEST_CASE("Vector matchers", "[matchers][vector]") {
|
TEST_CASE("Vector matchers", "[matchers][vector]") {
|
||||||
|
@ -241,6 +241,17 @@ std::ostream& operator<<(std::ostream& out, helper_1436<T1, T2> const& helper) {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Clang and gcc have different names for this warning, and clang also
|
||||||
|
// warns about an unused value
|
||||||
|
#if defined(__GNUG__) && !defined(__clang__)
|
||||||
|
#pragma GCC diagnostic push
|
||||||
|
#pragma GCC diagnostic ignored "-Wcomma-subscript"
|
||||||
|
#elif defined(__clang__)
|
||||||
|
#pragma clang diagnostic push
|
||||||
|
#pragma clang diagnostic ignored "-Wdeprecated-comma-subscript"
|
||||||
|
#pragma clang diagnostic ignored "-Wunused-value"
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
|
TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messages][capture]") {
|
||||||
CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
|
CAPTURE(std::vector<int>{1, 2, 3}[0, 1, 2],
|
||||||
std::vector<int>{1, 2, 3}[(0, 1)],
|
std::vector<int>{1, 2, 3}[(0, 1)],
|
||||||
@ -251,6 +262,10 @@ TEST_CASE("CAPTURE can deal with complex expressions involving commas", "[messag
|
|||||||
SUCCEED();
|
SUCCEED();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifdef __GNUG__
|
||||||
|
#pragma GCC diagnostic pop
|
||||||
|
#endif
|
||||||
|
|
||||||
TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") {
|
TEST_CASE("CAPTURE parses string and character constants", "[messages][capture]") {
|
||||||
CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\");
|
CAPTURE(("comma, in string", "escaped, \", "), "single quote in string,',", "some escapes, \\,\\\\");
|
||||||
CAPTURE("some, ), unmatched, } prenheses {[<");
|
CAPTURE("some, ), unmatched, } prenheses {[<");
|
||||||
|
Loading…
Reference in New Issue
Block a user