StringTraits.cpp 585 B

12345678910111213141516171819202122
  1. // ArduinoJson - arduinojson.org
  2. // Copyright Benoit Blanchon 2014-2023
  3. // MIT License
  4. #include <ArduinoJson.h>
  5. #include <catch.hpp>
  6. using namespace ArduinoJson::Internals;
  7. template <typename String>
  8. bool should_duplicate() {
  9. return StringTraits<String>::should_duplicate;
  10. }
  11. TEST_CASE("StringTraits") {
  12. SECTION("should_duplicate") {
  13. REQUIRE(false == should_duplicate<const char*>());
  14. REQUIRE(true == should_duplicate<char*>());
  15. REQUIRE(true == should_duplicate<RawJsonString<char*> >());
  16. REQUIRE(false == should_duplicate<RawJsonString<const char*> >());
  17. }
  18. }