forked from bblanchon/ArduinoJson
* Removed `ArduinoJson::String` * Removed `JsonVariant::defaultValue<T>()` * Removed non-template `JsonObject::get()` and `JsonArray.get()` * Fixed support for `StringSumHelper` (issue #184) * Replaced `ARDUINOJSON_USE_ARDUINO_STRING` by `ARDUINOJSON_ENABLE_STD_STRING` and `ARDUINOJSON_ENABLE_ARDUINO_STRING` (issue #378) * Added example `StringExample.ino` to show where `String` can be used
27 lines
655 B
C++
27 lines
655 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 <ArduinoJson.h>
|
|
#include <gtest/gtest.h>
|
|
|
|
class JsonObject_Get_Tests : public ::testing::Test {
|
|
public:
|
|
JsonObject_Get_Tests() : _object(_jsonBuffer.createObject()) {}
|
|
|
|
protected:
|
|
DynamicJsonBuffer _jsonBuffer;
|
|
JsonObject& _object;
|
|
};
|
|
|
|
#define TEST_(name) TEST_F(JsonObject_Get_Tests, name)
|
|
|
|
TEST_(GetConstCharPointer_GivenStringLiteral) {
|
|
_object.set("hello", "world");
|
|
const char* value = _object.get<const char*>("hello");
|
|
EXPECT_STREQ("world", value);
|
|
}
|