mirror of
https://github.com/eledio-devices/thirdparty-ArduinoJson.git
synced 2025-11-01 00:38:27 +01:00
Changed the return type of strdup() to const char* (issue #658)
This commit is contained in:
@@ -10,14 +10,14 @@ TEST_CASE("DynamicJsonBuffer::strdup()") {
|
||||
|
||||
SECTION("Should return a copy") {
|
||||
char original[] = "hello";
|
||||
char* copy = buffer.strdup(original);
|
||||
const char* copy = buffer.strdup(original);
|
||||
strcpy(original, "world");
|
||||
REQUIRE(std::string("hello") == copy);
|
||||
}
|
||||
|
||||
SECTION("Given NULL, return NULL") {
|
||||
const char* original = NULL;
|
||||
char* copy = buffer.strdup(original);
|
||||
const char* copy = buffer.strdup(original);
|
||||
REQUIRE(0 == copy);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user