Bläddra i källkod

JsonArray: remove redundant tests

Benoit Blanchon 1 år sedan
förälder
incheckning
f02fcc96a2
2 ändrade filer med 0 tillägg och 35 borttagningar
  1. 0 1
      extras/tests/JsonArray/CMakeLists.txt
  2. 0 34
      extras/tests/JsonArray/std_string.cpp

+ 0 - 1
extras/tests/JsonArray/CMakeLists.txt

@@ -13,7 +13,6 @@ add_executable(JsonArrayTests
 	nesting.cpp
 	remove.cpp
 	size.cpp
-	std_string.cpp
 	subscript.cpp
 	unbound.cpp
 )

+ 0 - 34
extras/tests/JsonArray/std_string.cpp

@@ -1,34 +0,0 @@
-// ArduinoJson - https://arduinojson.org
-// Copyright © 2014-2024, Benoit BLANCHON
-// MIT License
-
-#include <ArduinoJson.h>
-#include <catch.hpp>
-
-#include "Literals.hpp"
-
-static void eraseString(std::string& str) {
-  char* p = const_cast<char*>(str.c_str());
-  while (*p)
-    *p++ = '*';
-}
-
-TEST_CASE("std::string") {
-  JsonDocument doc;
-  JsonArray array = doc.to<JsonArray>();
-
-  SECTION("add()") {
-    std::string value("hello");
-    array.add(value);
-    eraseString(value);
-    REQUIRE("hello"_s == array[0]);
-  }
-
-  SECTION("operator[]") {
-    std::string value("world");
-    array.add("hello");
-    array[0] = value;
-    eraseString(value);
-    REQUIRE("world"_s == array[0]);
-  }
-}