Your ROOT_URL in app.ini is https://source.parasitstudio.de:63000/ but you are visiting https://source.parasitstudio.de/wirtz/MicroDexed/src/commit/fad9c6f91b3e55b3bb235ad96d37f7bb615691cf/third-party/ArduinoJson/extras/tests/JsonDocument/remove.cpp You should set ROOT_URL correctly, otherwise the web may not work correctly.

52 lines
914 B

// ArduinoJson - https://arduinojson.org
// Copyright Benoit Blanchon 2014-2021
// MIT License
#include <ArduinoJson.h>
#include <catch.hpp>
TEST_CASE("JsonDocument::remove()") {
DynamicJsonDocument doc(4096);
SECTION("remove(int)") {
doc.add(1);
doc.add(2);
doc.add(3);
doc.remove(1);
REQUIRE(doc.as<std::string>() == "[1,3]");
}
SECTION("remove(const char *)") {
doc["a"] = 1;
doc["b"] = 2;
doc.remove("a");
REQUIRE(doc.as<std::string>() == "{\"b\":2}");
}
SECTION("remove(std::string)") {
doc["a"] = 1;
doc["b"] = 2;
doc.remove(std::string("b"));
REQUIRE(doc.as<std::string>() == "{\"a\":1}");
}
#ifdef HAS_VARIABLE_LENGTH_ARRAY
SECTION("remove(vla)") {
doc["a"] = 1;
doc["b"] = 2;
int i = 4;
char vla[i];
strcpy(vla, "b");
doc.remove(vla);
REQUIRE(doc.as<std::string>() == "{\"a\":1}");
}
#endif
}