source: rtos_arduino/trunk/arduino_lib/libraries/ArduinoJson/test/JsonObject_Invalid_Tests.cpp@ 209

Last change on this file since 209 was 209, checked in by ertl-honda, 8 years ago

BlueMix用のフィアルを追加

File size: 920 bytes
Line 
1// Copyright Benoit Blanchon 2014-2016
2// MIT License
3//
4// Arduino JSON library
5// https://github.com/bblanchon/ArduinoJson
6// If you like this project, please add a star!
7
8#include <gtest/gtest.h>
9#include <ArduinoJson.h>
10
11TEST(JsonObject_Invalid_Tests, SubscriptFails) {
12 ASSERT_FALSE(JsonObject::invalid()[0].success());
13}
14
15TEST(JsonObject_Invalid_Tests, AddFails) {
16 JsonObject& object = JsonObject::invalid();
17 object.set("hello", "world");
18 ASSERT_EQ(0, object.size());
19}
20
21TEST(JsonObject_Invalid_Tests, CreateNestedArrayFails) {
22 ASSERT_FALSE(JsonObject::invalid().createNestedArray("hello").success());
23}
24
25TEST(JsonObject_Invalid_Tests, CreateNestedObjectFails) {
26 ASSERT_FALSE(JsonObject::invalid().createNestedObject("world").success());
27}
28
29TEST(JsonObject_Invalid_Tests, PrintToWritesBraces) {
30 char buffer[32];
31 JsonObject::invalid().printTo(buffer, sizeof(buffer));
32 ASSERT_STREQ("{}", buffer);
33}
Note: See TracBrowser for help on using the repository browser.