Fixed clang pragma and replaced with DOCTEST version
This commit is contained in:
parent
ed104d547f
commit
1a23a9fd4a
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
namespace
|
||||
{
|
||||
// special test case to check if memory is leaked if constructor throws
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
TEST_CASE("const_iterator class")
|
||||
{
|
||||
SECTION("construction")
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
TEST_CASE("iterator class")
|
||||
{
|
||||
SECTION("construction")
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
namespace
|
||||
{
|
||||
// shortcut to scan a string literal
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <valarray>
|
||||
|
||||
namespace
|
||||
|
||||
@ -29,17 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <deque>
|
||||
#include <forward_list>
|
||||
#include <fstream>
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <sstream>
|
||||
|
||||
namespace
|
||||
|
||||
@ -29,16 +29,14 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <deque>
|
||||
#include <forward_list>
|
||||
#include <list>
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
TEST_CASE("iterators 1")
|
||||
{
|
||||
SECTION("basic behavior")
|
||||
|
||||
@ -29,16 +29,13 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
TEST_CASE("JSON pointers")
|
||||
{
|
||||
SECTION("errors")
|
||||
|
||||
@ -31,6 +31,8 @@ SOFTWARE.
|
||||
|
||||
#include <nlohmann/json.hpp>
|
||||
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wunneeded-internal-declaration")
|
||||
|
||||
using nlohmann::json;
|
||||
|
||||
namespace
|
||||
@ -42,17 +44,12 @@ enum test
|
||||
struct pod {};
|
||||
struct pod_bis {};
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wunneeded-internal-declaration"
|
||||
|
||||
void to_json(json&, pod) noexcept{}
|
||||
void to_json(json&, pod_bis){}
|
||||
void from_json(const json&, pod) noexcept{}
|
||||
void from_json(const json&, pod_bis){}
|
||||
static json j;
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
static_assert(noexcept(json{}), "");
|
||||
static_assert(noexcept(nlohmann::to_json(j, 2)), "");
|
||||
static_assert(noexcept(nlohmann::to_json(j, 2.5)), "");
|
||||
|
||||
@ -29,20 +29,16 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
DOCTEST_GCC_SUPPRESS_WARNING("-Wfloat-equal")
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
// for some reason including this after the json header leads to linker errors with VS 2017...
|
||||
#include <locale>
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <list>
|
||||
|
||||
@ -29,19 +29,16 @@ SOFTWARE.
|
||||
|
||||
#include "doctest_compatibility.h"
|
||||
|
||||
DOCTEST_CLANG_SUPPRESS_WARNING("-Wkeyword-macro")
|
||||
|
||||
// for some reason including this after the json header leads to linker errors with VS 2017...
|
||||
#include <locale>
|
||||
|
||||
#pragma clang diagnostic push
|
||||
#pragma clang diagnostic ignored "-Wkeyword-macro"
|
||||
|
||||
#define private public
|
||||
#include <nlohmann/json.hpp>
|
||||
using nlohmann::json;
|
||||
#undef private
|
||||
|
||||
#pragma clang diagnostic pop
|
||||
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
#include <iostream>
|
||||
|
||||
Loading…
Reference in New Issue
Block a user