-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added
deprecated
attribute on asArray()
, asObject()
and `asStri…
…ng()` (issue #420)
- Loading branch information
Showing
14 changed files
with
101 additions
and
60 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright Benoit Blanchon 2014-2017 | ||
// MIT License | ||
// | ||
// Arduino JSON library | ||
// https://github.com/bblanchon/ArduinoJson | ||
// If you like this project, please add a star! | ||
|
||
#define ARDUINOJSON_ENABLE_DEPRECATED 1 | ||
|
||
#include <ArduinoJson.h> | ||
#include <gtest/gtest.h> | ||
|
||
#if defined(__clang__) | ||
#pragma clang diagnostic ignored "-Wdeprecated-declarations" | ||
#elif defined(__GNUC__) | ||
#pragma GCC diagnostic ignored "-Wdeprecated-declarations" | ||
#elif defined(_MSC_VER) | ||
#pragma warning(disable : 4996) | ||
#endif | ||
|
||
TEST(Deprecated, asArray) { | ||
DynamicJsonBuffer jsonBuffer; | ||
JsonVariant variant = jsonBuffer.createArray(); | ||
ASSERT_TRUE(variant.asArray().success()); | ||
} | ||
|
||
TEST(Deprecated, asObject) { | ||
DynamicJsonBuffer jsonBuffer; | ||
JsonVariant variant = jsonBuffer.createObject(); | ||
ASSERT_TRUE(variant.asObject().success()); | ||
} | ||
|
||
TEST(Deprecated, asString) { | ||
JsonVariant variant = "hello"; | ||
ASSERT_STREQ("hello", variant.asString()); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.