Replace ARDUINOJSON_NAMESPACE with an inline namespace (#1820)

This commit is contained in:
Benoit Blanchon
2023-02-14 10:04:48 +01:00
parent 34dd46110b
commit 1b66a217bf
171 changed files with 855 additions and 684 deletions

View File

@ -1,11 +1,11 @@
#define ARDUINOJSON_NAMESPACE ArduinoJson_NoAlignment
#define ARDUINOJSON_VERSION_NAMESPACE NoAlignment
#define ARDUINOJSON_ENABLE_ALIGNMENT 0
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 0") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
const size_t N = sizeof(void*);

View File

@ -4,7 +4,7 @@
#include <catch.hpp>
TEST_CASE("ARDUINOJSON_ENABLE_ALIGNMENT == 1") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
const size_t N = sizeof(void*);

View File

@ -5,7 +5,7 @@
#include <limits>
namespace my {
using ARDUINOJSON_NAMESPACE::isinf;
using ArduinoJson::detail::isinf;
} // namespace my
TEST_CASE("ARDUINOJSON_ENABLE_INFINITY == 1") {

View File

@ -5,7 +5,7 @@
#include <limits>
namespace my {
using ARDUINOJSON_NAMESPACE::isnan;
using ArduinoJson::detail::isnan;
} // namespace my
TEST_CASE("ARDUINOJSON_ENABLE_NAN == 1") {

View File

@ -53,7 +53,7 @@ TEST_CASE("Flash strings") {
}
TEST_CASE("parseNumber()") { // tables are in Flash
using ARDUINOJSON_NAMESPACE::parseNumber;
using ArduinoJson::detail::parseNumber;
CHECK(parseNumber<float>("1") == 1.f);
CHECK(parseNumber<float>("1.23") == 1.23f);
@ -95,7 +95,7 @@ TEST_CASE("memcpy_P") {
}
TEST_CASE("BoundedReader<const __FlashStringHelper*>") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
SECTION("read") {
BoundedReader<const __FlashStringHelper*> reader(F("\x01\xFF"), 2);
@ -135,7 +135,7 @@ TEST_CASE("BoundedReader<const __FlashStringHelper*>") {
}
TEST_CASE("Reader<const __FlashStringHelper*>") {
using namespace ARDUINOJSON_NAMESPACE;
using namespace ArduinoJson::detail;
SECTION("read()") {
Reader<const __FlashStringHelper*> reader(F("\x01\xFF\x00\x12"));