forked from bblanchon/ArduinoJson
Set clang-format standard to C++11 (#1820)
This commit is contained in:
@ -12,7 +12,7 @@
|
||||
|
||||
namespace ArduinoJson {
|
||||
template <typename T>
|
||||
struct Converter<std::vector<T> > {
|
||||
struct Converter<std::vector<T>> {
|
||||
static void toJson(const std::vector<T>& src, JsonVariant dst) {
|
||||
JsonArray array = dst.to<JsonArray>();
|
||||
for (T item : src)
|
||||
@ -36,7 +36,7 @@ struct Converter<std::vector<T> > {
|
||||
};
|
||||
|
||||
template <typename T, size_t N>
|
||||
struct Converter<std::array<T, N> > {
|
||||
struct Converter<std::array<T, N>> {
|
||||
static void toJson(const std::array<T, N>& src, JsonVariant dst) {
|
||||
JsonArray array = dst.to<JsonArray>();
|
||||
for (T item : src)
|
||||
@ -79,7 +79,7 @@ TEST_CASE("vector<int>") {
|
||||
doc.add(1);
|
||||
doc.add(2);
|
||||
|
||||
auto v = doc.as<std::vector<int> >();
|
||||
auto v = doc.as<std::vector<int>>();
|
||||
REQUIRE(v.size() == 2);
|
||||
CHECK(v[0] == 1);
|
||||
CHECK(v[1] == 2);
|
||||
@ -87,14 +87,14 @@ TEST_CASE("vector<int>") {
|
||||
|
||||
SECTION("checkJson") {
|
||||
StaticJsonDocument<128> doc;
|
||||
CHECK(doc.is<std::vector<int> >() == false);
|
||||
CHECK(doc.is<std::vector<int>>() == false);
|
||||
|
||||
doc.add(1);
|
||||
doc.add(2);
|
||||
CHECK(doc.is<std::vector<int> >() == true);
|
||||
CHECK(doc.is<std::vector<int>>() == true);
|
||||
|
||||
doc.add("foo");
|
||||
CHECK(doc.is<std::vector<int> >() == false);
|
||||
CHECK(doc.is<std::vector<int>>() == false);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -91,13 +91,13 @@ struct EmptyStruct {};
|
||||
|
||||
TEST_CASE("IsString<T>") {
|
||||
CHECK(IsString<std::string>::value == true);
|
||||
CHECK(IsString<std::basic_string<wchar_t> >::value == false);
|
||||
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);
|
||||
CHECK(IsString<::String>::value == true);
|
||||
CHECK(IsString<::StringSumHelper>::value == true);
|
||||
CHECK(IsString<const EmptyStruct*>::value == false);
|
||||
}
|
||||
|
||||
|
@ -65,7 +65,7 @@ TEST_CASE("Writer<std::string>") {
|
||||
|
||||
TEST_CASE("Writer<String>") {
|
||||
::String output;
|
||||
Writer< ::String> writer(output);
|
||||
Writer<::String> writer(output);
|
||||
|
||||
SECTION("write(char)") {
|
||||
SECTION("writes to temporary buffer") {
|
||||
|
@ -17,7 +17,7 @@ template <typename TFloat>
|
||||
void check(TFloat input, const std::string& expected) {
|
||||
std::string output;
|
||||
Writer<std::string> sb(output);
|
||||
TextFormatter<Writer<std::string> > writer(sb);
|
||||
TextFormatter<Writer<std::string>> writer(sb);
|
||||
writer.writeFloat(input);
|
||||
REQUIRE(writer.bytesWritten() == output.size());
|
||||
CHECK(expected == output);
|
||||
|
Reference in New Issue
Block a user