mirror of
				https://github.com/eledio-devices/thirdparty-ArduinoJson.git
				synced 2025-10-31 16:14:11 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			34 lines
		
	
	
		
			920 B
		
	
	
	
		
			C++
		
	
	
	
	
	
			
		
		
	
	
			34 lines
		
	
	
		
			920 B
		
	
	
	
		
			C++
		
	
	
	
	
	
| // Copyright Benoit Blanchon 2014-2016
 | |
| // MIT License
 | |
| //
 | |
| // Arduino JSON library
 | |
| // https://github.com/bblanchon/ArduinoJson
 | |
| // If you like this project, please add a star!
 | |
| 
 | |
| #include <gtest/gtest.h>
 | |
| #include <ArduinoJson.h>
 | |
| 
 | |
| TEST(JsonObject_Invalid_Tests, SubscriptFails) {
 | |
|   ASSERT_FALSE(JsonObject::invalid()[0].success());
 | |
| }
 | |
| 
 | |
| TEST(JsonObject_Invalid_Tests, AddFails) {
 | |
|   JsonObject& object = JsonObject::invalid();
 | |
|   object.set("hello", "world");
 | |
|   ASSERT_EQ(0, object.size());
 | |
| }
 | |
| 
 | |
| TEST(JsonObject_Invalid_Tests, CreateNestedArrayFails) {
 | |
|   ASSERT_FALSE(JsonObject::invalid().createNestedArray("hello").success());
 | |
| }
 | |
| 
 | |
| TEST(JsonObject_Invalid_Tests, CreateNestedObjectFails) {
 | |
|   ASSERT_FALSE(JsonObject::invalid().createNestedObject("world").success());
 | |
| }
 | |
| 
 | |
| TEST(JsonObject_Invalid_Tests, PrintToWritesBraces) {
 | |
|   char buffer[32];
 | |
|   JsonObject::invalid().printTo(buffer, sizeof(buffer));
 | |
|   ASSERT_STREQ("{}", buffer);
 | |
| }
 |