forked from bblanchon/ArduinoJson
Marked strdup()
as deprecated (issue #658)
This commit is contained in:
@ -9,7 +9,6 @@ add_executable(DynamicJsonBufferTests
|
||||
no_memory.cpp
|
||||
size.cpp
|
||||
startString.cpp
|
||||
strdup.cpp
|
||||
)
|
||||
|
||||
target_link_libraries(DynamicJsonBufferTests catch)
|
||||
|
@ -1,23 +0,0 @@
|
||||
// ArduinoJson - arduinojson.org
|
||||
// Copyright Benoit Blanchon 2014-2018
|
||||
// MIT License
|
||||
|
||||
#include <ArduinoJson.h>
|
||||
#include <catch.hpp>
|
||||
|
||||
TEST_CASE("DynamicJsonBuffer::strdup()") {
|
||||
DynamicJsonBuffer buffer;
|
||||
|
||||
SECTION("Should return a copy") {
|
||||
char original[] = "hello";
|
||||
const char* copy = buffer.strdup(original);
|
||||
strcpy(original, "world");
|
||||
REQUIRE(std::string("hello") == copy);
|
||||
}
|
||||
|
||||
SECTION("Given NULL, return NULL") {
|
||||
const char* original = NULL;
|
||||
const char* copy = buffer.strdup(original);
|
||||
REQUIRE(0 == copy);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user