forked from bblanchon/ArduinoJson
Replace ARDUINOJSON_NAMESPACE
with an inline namespace (#1820)
This commit is contained in:
@ -7,7 +7,7 @@
|
||||
#include <catch.hpp>
|
||||
|
||||
namespace my {
|
||||
using ARDUINOJSON_NAMESPACE::isinf;
|
||||
using ArduinoJson::detail::isinf;
|
||||
} // namespace my
|
||||
|
||||
enum MY_ENUM { ONE = 1, TWO = 2 };
|
||||
|
@ -88,7 +88,7 @@ class Complex {
|
||||
double _real, _imag;
|
||||
};
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
namespace ArduinoJson {
|
||||
template <>
|
||||
struct Converter<Complex> {
|
||||
static void toJson(const Complex& src, JsonVariant dst) {
|
||||
@ -104,7 +104,7 @@ struct Converter<Complex> {
|
||||
return src["real"].is<double>() && src["imag"].is<double>();
|
||||
}
|
||||
};
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
} // namespace ArduinoJson
|
||||
|
||||
TEST_CASE("Custom converter with specialization") {
|
||||
DynamicJsonDocument doc(4096);
|
||||
@ -142,7 +142,7 @@ TEST_CASE("Custom converter with specialization") {
|
||||
}
|
||||
|
||||
TEST_CASE("ConverterNeedsWriteableRef") {
|
||||
using namespace ARDUINOJSON_NAMESPACE;
|
||||
using namespace ArduinoJson::detail;
|
||||
CHECK(ConverterNeedsWriteableRef<int>::value == false);
|
||||
CHECK(ConverterNeedsWriteableRef<float>::value == false);
|
||||
CHECK(ConverterNeedsWriteableRef<JsonVariant>::value == true);
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
namespace ARDUINOJSON_NAMESPACE {
|
||||
namespace ArduinoJson {
|
||||
template <typename T>
|
||||
struct Converter<std::vector<T> > {
|
||||
static void toJson(const std::vector<T>& src, JsonVariant dst) {
|
||||
@ -63,7 +63,7 @@ struct Converter<std::array<T, N> > {
|
||||
return result && size == N;
|
||||
}
|
||||
};
|
||||
} // namespace ARDUINOJSON_NAMESPACE
|
||||
} // namespace ArduinoJson
|
||||
|
||||
TEST_CASE("vector<int>") {
|
||||
SECTION("toJson") {
|
||||
|
Reference in New Issue
Block a user