mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	Clang-format: set DerivePointerAlignment to false
				
					
				
			This commit is contained in:
		| @@ -14,18 +14,18 @@ class CustomWriter { | ||||
|     return 1; | ||||
|   } | ||||
|  | ||||
|   size_t write(const uint8_t *s, size_t n) { | ||||
|     _str.append(reinterpret_cast<const char *>(s), n); | ||||
|   size_t write(const uint8_t* s, size_t n) { | ||||
|     _str.append(reinterpret_cast<const char*>(s), n); | ||||
|     return n; | ||||
|   } | ||||
|  | ||||
|   const std::string &str() const { | ||||
|   const std::string& str() const { | ||||
|     return _str; | ||||
|   } | ||||
|  | ||||
|  private: | ||||
|   CustomWriter(const CustomWriter &);  // non-copiable | ||||
|   CustomWriter &operator=(const CustomWriter &); | ||||
|   CustomWriter(const CustomWriter&);  // non-copiable | ||||
|   CustomWriter& operator=(const CustomWriter&); | ||||
|  | ||||
|   std::string _str; | ||||
| }; | ||||
|   | ||||
| @@ -23,7 +23,7 @@ TEST_CASE("serializeJson(JsonArray)") { | ||||
|   } | ||||
|  | ||||
|   SECTION("Null") { | ||||
|     array.add(static_cast<char *>(0)); | ||||
|     array.add(static_cast<char*>(0)); | ||||
|  | ||||
|     check(array, "[null]"); | ||||
|   } | ||||
|   | ||||
| @@ -6,7 +6,7 @@ | ||||
| #include <catch.hpp> | ||||
| #include <string> | ||||
|  | ||||
| static void checkObject(const JsonObject obj, const std::string &expected) { | ||||
| static void checkObject(const JsonObject obj, const std::string& expected) { | ||||
|   char actual[256]; | ||||
|   memset(actual, '!', sizeof(actual)); | ||||
|  | ||||
| @@ -84,8 +84,8 @@ TEST_CASE("serializeJson(JsonObject)") { | ||||
|   } | ||||
|  | ||||
|   SECTION("TwoNull") { | ||||
|     obj["a"] = static_cast<char *>(0); | ||||
|     obj["b"] = static_cast<char *>(0); | ||||
|     obj["a"] = static_cast<char*>(0); | ||||
|     obj["b"] = static_cast<char*>(0); | ||||
|     checkObject(obj, "{\"a\":null,\"b\":null}"); | ||||
|   } | ||||
|  | ||||
|   | ||||
| @@ -7,7 +7,7 @@ | ||||
| #include <limits> | ||||
|  | ||||
| template <typename T> | ||||
| void check(T value, const std::string &expected) { | ||||
| void check(T value, const std::string& expected) { | ||||
|   DynamicJsonDocument doc(4096); | ||||
|   doc.to<JsonVariant>().set(value); | ||||
|   char buffer[256] = ""; | ||||
| @@ -22,7 +22,7 @@ TEST_CASE("serializeJson(JsonVariant)") { | ||||
|   } | ||||
|  | ||||
|   SECTION("Null string") { | ||||
|     check(static_cast<char *>(0), "null"); | ||||
|     check(static_cast<char*>(0), "null"); | ||||
|   } | ||||
|  | ||||
|   SECTION("const char*") { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user