forked from bblanchon/ArduinoJson
Test IsString<String>
and IsString<StringSumHelper>
This commit is contained in:
@ -62,7 +62,7 @@ class String {
|
||||
size_t _maxCapacity;
|
||||
};
|
||||
|
||||
class StringSumHelper;
|
||||
class StringSumHelper : public ::String {};
|
||||
|
||||
inline bool operator==(const std::string& lhs, const ::String& rhs) {
|
||||
return lhs == rhs.c_str();
|
||||
|
@ -87,29 +87,14 @@ TEST_CASE("custom_string") {
|
||||
}
|
||||
|
||||
TEST_CASE("IsString<T>") {
|
||||
SECTION("std::string") {
|
||||
CHECK(IsString<std::string>::value == true);
|
||||
}
|
||||
|
||||
SECTION("basic_string<wchar_t>") {
|
||||
CHECK(IsString<std::basic_string<wchar_t> >::value == false);
|
||||
}
|
||||
|
||||
SECTION("custom_string") {
|
||||
CHECK(IsString<custom_string>::value == true);
|
||||
}
|
||||
|
||||
SECTION("const __FlashStringHelper*") {
|
||||
CHECK(IsString<const __FlashStringHelper*>::value == true);
|
||||
}
|
||||
|
||||
SECTION("const char*") {
|
||||
CHECK(IsString<const char*>::value == true);
|
||||
}
|
||||
|
||||
SECTION("const char[]") {
|
||||
CHECK(IsString<const char[8]>::value == true);
|
||||
}
|
||||
CHECK(IsString<std::string>::value == true);
|
||||
CHECK(IsString<std::basic_string<wchar_t> >::value == false);
|
||||
CHECK(IsString<custom_string>::value == true);
|
||||
CHECK(IsString<const __FlashStringHelper*>::value == true);
|
||||
CHECK(IsString<const char*>::value == true);
|
||||
CHECK(IsString<const char[8]>::value == true);
|
||||
CHECK(IsString< ::String>::value == true);
|
||||
CHECK(IsString< ::StringSumHelper>::value == true);
|
||||
}
|
||||
|
||||
TEST_CASE("stringCompare") {
|
||||
|
Reference in New Issue
Block a user