diff --git a/test/CMakeLists.txt b/test/CMakeLists.txt index cfdae39f..6a0ffd70 100644 --- a/test/CMakeLists.txt +++ b/test/CMakeLists.txt @@ -7,7 +7,10 @@ include(gtest.cmake) -file(GLOB TESTS_FILES *.hpp *.cpp) +file(GLOB_RECURSE TESTS_FILES + *.hpp + *.cpp +) if(CMAKE_CXX_COMPILER_ID MATCHES "(GNU|Clang)") add_compile_options( diff --git a/test/DynamicJsonBuffer_Array_Tests.cpp b/test/DynamicJsonBuffer/array.cpp similarity index 100% rename from test/DynamicJsonBuffer_Array_Tests.cpp rename to test/DynamicJsonBuffer/array.cpp diff --git a/test/DynamicJsonBuffer_Basic_Tests.cpp b/test/DynamicJsonBuffer/basics.cpp similarity index 100% rename from test/DynamicJsonBuffer_Basic_Tests.cpp rename to test/DynamicJsonBuffer/basics.cpp diff --git a/test/DynamicJsonBuffer_NoMemory_Tests.cpp b/test/DynamicJsonBuffer/noMemory.cpp similarity index 100% rename from test/DynamicJsonBuffer_NoMemory_Tests.cpp rename to test/DynamicJsonBuffer/noMemory.cpp diff --git a/test/DynamicJsonBuffer_Object_Tests.cpp b/test/DynamicJsonBuffer/object.cpp similarity index 100% rename from test/DynamicJsonBuffer_Object_Tests.cpp rename to test/DynamicJsonBuffer/object.cpp diff --git a/test/DynamicJsonBuffer_String_Tests.cpp b/test/DynamicJsonBuffer/string.cpp similarity index 100% rename from test/DynamicJsonBuffer_String_Tests.cpp rename to test/DynamicJsonBuffer/string.cpp diff --git a/test/GbathreeBug.cpp b/test/IntegrationTests/gbathree.cpp similarity index 100% rename from test/GbathreeBug.cpp rename to test/IntegrationTests/gbathree.cpp diff --git a/test/IntegrationTests.cpp b/test/IntegrationTests/parse_print.cpp similarity index 100% rename from test/IntegrationTests.cpp rename to test/IntegrationTests/parse_print.cpp diff --git a/test/Issue10.cpp b/test/Issue10.cpp deleted file mode 100644 index 6e0d1a14..00000000 --- a/test/Issue10.cpp +++ /dev/null @@ -1,68 +0,0 @@ -// Copyright Benoit Blanchon 2014-2017 -// MIT License -// -// Arduino JSON library -// https://bblanchon.github.io/ArduinoJson/ -// If you like this project, please add a star! - -#include -#include - -struct Person { - int id; - char name[32]; -}; - -class Issue10 : public testing::Test { - protected: - virtual void SetUp() { - Person boss; - boss.id = 1; - strcpy(boss.name, "Jeff"); - Person employee; - employee.id = 2; - strcpy(employee.name, "John"); - persons[0] = boss; - persons[1] = employee; - } - - template - void checkJsonString(const T &p) { - char buffer[256]; - p.printTo(buffer, sizeof(buffer)); - - EXPECT_STREQ("[{\"id\":1,\"name\":\"Jeff\"},{\"id\":2,\"name\":\"John\"}]", - buffer); - } - - StaticJsonBuffer json; - Person persons[2]; -}; - -TEST_F(Issue10, PopulateArrayByAddingAnObject) { - JsonArray &array = json.createArray(); - - for (int i = 0; i < 2; i++) { - JsonObject &object = json.createObject(); - - object["id"] = persons[i].id; - object["name"] = persons[i].name; - - array.add(object); - } - - checkJsonString(array); -} - -TEST_F(Issue10, PopulateArrayByCreatingNestedObjects) { - JsonArray &array = json.createArray(); - - for (int i = 0; i < 2; i++) { - JsonObject &object = array.createNestedObject(); - - object["id"] = persons[i].id; - object["name"] = persons[i].name; - } - - checkJsonString(array); -} diff --git a/test/Issue214.cpp b/test/Issue214.cpp deleted file mode 100644 index e0b1afba..00000000 --- a/test/Issue214.cpp +++ /dev/null @@ -1,16 +0,0 @@ -// Copyright Benoit Blanchon 2014-2017 -// MIT License -// -// Arduino JSON library -// https://bblanchon.github.io/ArduinoJson/ -// If you like this project, please add a star! - -#include -#include - -TEST(Issue214, IsBool) { - char json[] = "{\"ota\": {\"enabled\": true}}"; - StaticJsonBuffer jsonBuffer; - JsonObject& parsedJson = jsonBuffer.parseObject(json); - ASSERT_TRUE(parsedJson["ota"]["enabled"].is()); -} diff --git a/test/Issue34.cpp b/test/Issue34.cpp deleted file mode 100644 index ffcd778a..00000000 --- a/test/Issue34.cpp +++ /dev/null @@ -1,56 +0,0 @@ -// Copyright Benoit Blanchon 2014-2017 -// MIT License -// -// Arduino JSON library -// https://bblanchon.github.io/ArduinoJson/ -// If you like this project, please add a star! - -#include -#include - -class Issue34 : public testing::Test { - protected: - template - void test_with_value(T expected) { - StaticJsonBuffer jsonBuffer; - - JsonObject& jsonObject = jsonBuffer.createObject(); - - jsonObject["key"] = expected; - T actual = jsonObject["key"]; - - ASSERT_EQ(expected, actual); - } -}; - -TEST_F(Issue34, int8_t) { - test_with_value(1); -} - -TEST_F(Issue34, uint8_t) { - test_with_value(2); -} - -TEST_F(Issue34, int16_t) { - test_with_value(3); -} - -TEST_F(Issue34, uint16_t) { - test_with_value(4); -} - -TEST_F(Issue34, int32_t) { - test_with_value(5); -} - -TEST_F(Issue34, uint32_t) { - test_with_value(6); -} - -TEST_F(Issue34, float) { - test_with_value(7); -} - -TEST_F(Issue34, double) { - test_with_value(8); -} diff --git a/test/JsonArray_Add_Tests.cpp b/test/JsonArray/add.cpp similarity index 100% rename from test/JsonArray_Add_Tests.cpp rename to test/JsonArray/add.cpp diff --git a/test/JsonArray_Basic_Tests.cpp b/test/JsonArray/basics.cpp similarity index 100% rename from test/JsonArray_Basic_Tests.cpp rename to test/JsonArray/basics.cpp diff --git a/test/JsonArray_CopyFrom_Tests.cpp b/test/JsonArray/copyFrom.cpp similarity index 100% rename from test/JsonArray_CopyFrom_Tests.cpp rename to test/JsonArray/copyFrom.cpp diff --git a/test/JsonArray_CopyTo_Tests.cpp b/test/JsonArray/copyTo.cpp similarity index 100% rename from test/JsonArray_CopyTo_Tests.cpp rename to test/JsonArray/copyTo.cpp diff --git a/test/JsonArray_Invalid_Tests.cpp b/test/JsonArray/invalid.cpp similarity index 100% rename from test/JsonArray_Invalid_Tests.cpp rename to test/JsonArray/invalid.cpp diff --git a/test/JsonArray_Iterator_Tests.cpp b/test/JsonArray/iterator.cpp similarity index 100% rename from test/JsonArray_Iterator_Tests.cpp rename to test/JsonArray/iterator.cpp diff --git a/test/JsonArray_PrettyPrintTo_Tests.cpp b/test/JsonArray/prettyPrintTo.cpp similarity index 100% rename from test/JsonArray_PrettyPrintTo_Tests.cpp rename to test/JsonArray/prettyPrintTo.cpp diff --git a/test/JsonArray_PrintTo_Tests.cpp b/test/JsonArray/printTo.cpp similarity index 100% rename from test/JsonArray_PrintTo_Tests.cpp rename to test/JsonArray/printTo.cpp diff --git a/test/JsonArray_Remove_Tests.cpp b/test/JsonArray/removeAt.cpp similarity index 100% rename from test/JsonArray_Remove_Tests.cpp rename to test/JsonArray/removeAt.cpp diff --git a/test/JsonArray_Set_Tests.cpp b/test/JsonArray/set.cpp similarity index 100% rename from test/JsonArray_Set_Tests.cpp rename to test/JsonArray/set.cpp diff --git a/test/JsonArray_Subscript_Tests.cpp b/test/JsonArray/subscript.cpp similarity index 100% rename from test/JsonArray_Subscript_Tests.cpp rename to test/JsonArray/subscript.cpp diff --git a/test/JsonParser_Nested_Tests.cpp b/test/JsonBuffer/nested.cpp similarity index 100% rename from test/JsonParser_Nested_Tests.cpp rename to test/JsonBuffer/nested.cpp diff --git a/test/JsonParser_NestingLimit_Tests.cpp b/test/JsonBuffer/nestingLimit.cpp similarity index 100% rename from test/JsonParser_NestingLimit_Tests.cpp rename to test/JsonBuffer/nestingLimit.cpp diff --git a/test/JsonParser_Variant_Tests.cpp b/test/JsonBuffer/parse.cpp similarity index 100% rename from test/JsonParser_Variant_Tests.cpp rename to test/JsonBuffer/parse.cpp diff --git a/test/JsonParser_Array_Tests.cpp b/test/JsonBuffer/parseArray.cpp similarity index 100% rename from test/JsonParser_Array_Tests.cpp rename to test/JsonBuffer/parseArray.cpp diff --git a/test/JsonParser_Object_Tests.cpp b/test/JsonBuffer/parseObject.cpp similarity index 100% rename from test/JsonParser_Object_Tests.cpp rename to test/JsonBuffer/parseObject.cpp diff --git a/test/JsonObject_Basic_Tests.cpp b/test/JsonObject/basics.cpp similarity index 100% rename from test/JsonObject_Basic_Tests.cpp rename to test/JsonObject/basics.cpp diff --git a/test/JsonObject_ContainsKey_Tests.cpp b/test/JsonObject/containsKey.cpp similarity index 100% rename from test/JsonObject_ContainsKey_Tests.cpp rename to test/JsonObject/containsKey.cpp diff --git a/test/JsonObject_Get_Tests.cpp b/test/JsonObject/get.cpp similarity index 100% rename from test/JsonObject_Get_Tests.cpp rename to test/JsonObject/get.cpp diff --git a/test/JsonObject_Invalid_Tests.cpp b/test/JsonObject/invalid.cpp similarity index 100% rename from test/JsonObject_Invalid_Tests.cpp rename to test/JsonObject/invalid.cpp diff --git a/test/JsonObject_Iterator_Tests.cpp b/test/JsonObject/iterator.cpp similarity index 100% rename from test/JsonObject_Iterator_Tests.cpp rename to test/JsonObject/iterator.cpp diff --git a/test/JsonObject_PrettyPrintTo_Tests.cpp b/test/JsonObject/prettyPrintTo.cpp similarity index 100% rename from test/JsonObject_PrettyPrintTo_Tests.cpp rename to test/JsonObject/prettyPrintTo.cpp diff --git a/test/JsonObject_PrintTo_Tests.cpp b/test/JsonObject/printTo.cpp similarity index 100% rename from test/JsonObject_PrintTo_Tests.cpp rename to test/JsonObject/printTo.cpp diff --git a/test/JsonObject_Remove_Tests.cpp b/test/JsonObject/remove.cpp similarity index 100% rename from test/JsonObject_Remove_Tests.cpp rename to test/JsonObject/remove.cpp diff --git a/test/JsonObject_Set_Tests.cpp b/test/JsonObject/set.cpp similarity index 100% rename from test/JsonObject_Set_Tests.cpp rename to test/JsonObject/set.cpp diff --git a/test/JsonObject_Subscript_Tests.cpp b/test/JsonObject/subscript.cpp similarity index 100% rename from test/JsonObject_Subscript_Tests.cpp rename to test/JsonObject/subscript.cpp diff --git a/test/JsonVariant_As_Tests.cpp b/test/JsonVariant/as.cpp similarity index 100% rename from test/JsonVariant_As_Tests.cpp rename to test/JsonVariant/as.cpp diff --git a/test/JsonVariant_Comparison_Tests.cpp b/test/JsonVariant/compare.cpp similarity index 100% rename from test/JsonVariant_Comparison_Tests.cpp rename to test/JsonVariant/compare.cpp diff --git a/test/JsonVariant_Copy_Tests.cpp b/test/JsonVariant/copy.cpp similarity index 100% rename from test/JsonVariant_Copy_Tests.cpp rename to test/JsonVariant/copy.cpp diff --git a/test/JsonVariant_Is_Tests.cpp b/test/JsonVariant/is.cpp similarity index 100% rename from test/JsonVariant_Is_Tests.cpp rename to test/JsonVariant/is.cpp diff --git a/test/JsonVariant_PrintTo_Tests.cpp b/test/JsonVariant/printTo.cpp similarity index 100% rename from test/JsonVariant_PrintTo_Tests.cpp rename to test/JsonVariant/printTo.cpp diff --git a/test/JsonVariant_Storage_Tests.cpp b/test/JsonVariant/set_get.cpp similarity index 100% rename from test/JsonVariant_Storage_Tests.cpp rename to test/JsonVariant/set_get.cpp diff --git a/test/JsonVariant_Subscript_Tests.cpp b/test/JsonVariant/subscript.cpp similarity index 100% rename from test/JsonVariant_Subscript_Tests.cpp rename to test/JsonVariant/subscript.cpp diff --git a/test/JsonVariant_Success_Tests.cpp b/test/JsonVariant/success.cpp similarity index 100% rename from test/JsonVariant_Success_Tests.cpp rename to test/JsonVariant/success.cpp diff --git a/test/JsonVariant_Undefined_Tests.cpp b/test/JsonVariant/undefined.cpp similarity index 100% rename from test/JsonVariant_Undefined_Tests.cpp rename to test/JsonVariant/undefined.cpp diff --git a/test/JsonWriter_WriteFloat_Tests.cpp b/test/JsonWriter/writeFloat.cpp similarity index 100% rename from test/JsonWriter_WriteFloat_Tests.cpp rename to test/JsonWriter/writeFloat.cpp diff --git a/test/JsonWriter_WriteString_Tests.cpp b/test/JsonWriter/writeString.cpp similarity index 100% rename from test/JsonWriter_WriteString_Tests.cpp rename to test/JsonWriter/writeString.cpp diff --git a/test/StringBuilderTests.cpp b/test/Misc/StringBuilder.cpp similarity index 100% rename from test/StringBuilderTests.cpp rename to test/Misc/StringBuilder.cpp diff --git a/test/TypeTraits_Tests.cpp b/test/Misc/TypeTraits.cpp similarity index 100% rename from test/TypeTraits_Tests.cpp rename to test/Misc/TypeTraits.cpp diff --git a/test/Deprecated_Tests.cpp b/test/Misc/deprecated.cpp similarity index 100% rename from test/Deprecated_Tests.cpp rename to test/Misc/deprecated.cpp diff --git a/test/StdStream_Tests.cpp b/test/Misc/std_stream.cpp similarity index 100% rename from test/StdStream_Tests.cpp rename to test/Misc/std_stream.cpp diff --git a/test/String_Tests.cpp b/test/Misc/std_string.cpp similarity index 100% rename from test/String_Tests.cpp rename to test/Misc/std_string.cpp diff --git a/test/UnsignedChar_Tests.cpp b/test/Misc/unsigned_char.cpp similarity index 100% rename from test/UnsignedChar_Tests.cpp rename to test/Misc/unsigned_char.cpp diff --git a/test/VariableLengthArray_Tests.cpp b/test/Misc/vla.cpp similarity index 100% rename from test/VariableLengthArray_Tests.cpp rename to test/Misc/vla.cpp diff --git a/test/Polyfills_IsFloat_Tests.cpp b/test/Polyfills/isFloat.cpp similarity index 100% rename from test/Polyfills_IsFloat_Tests.cpp rename to test/Polyfills/isFloat.cpp diff --git a/test/Polyfills_IsInteger_Tests.cpp b/test/Polyfills/isInteger.cpp similarity index 100% rename from test/Polyfills_IsInteger_Tests.cpp rename to test/Polyfills/isInteger.cpp diff --git a/test/Polyfills_ParseFloat_Tests.cpp b/test/Polyfills/parseFloat.cpp similarity index 100% rename from test/Polyfills_ParseFloat_Tests.cpp rename to test/Polyfills/parseFloat.cpp diff --git a/test/Polyfills_ParseInteger_Tests.cpp b/test/Polyfills/parseInteger.cpp similarity index 100% rename from test/Polyfills_ParseInteger_Tests.cpp rename to test/Polyfills/parseInteger.cpp diff --git a/test/StaticJsonBuffer_Basic_Tests.cpp b/test/StaticJsonBuffer/basics.cpp similarity index 100% rename from test/StaticJsonBuffer_Basic_Tests.cpp rename to test/StaticJsonBuffer/basics.cpp diff --git a/test/StaticJsonBuffer_CreateArray_Tests.cpp b/test/StaticJsonBuffer/createArray.cpp similarity index 100% rename from test/StaticJsonBuffer_CreateArray_Tests.cpp rename to test/StaticJsonBuffer/createArray.cpp diff --git a/test/StaticJsonBuffer_CreateObject_Tests.cpp b/test/StaticJsonBuffer/createObject.cpp similarity index 100% rename from test/StaticJsonBuffer_CreateObject_Tests.cpp rename to test/StaticJsonBuffer/createObject.cpp diff --git a/test/StaticJsonBuffer_ParseArray_Tests.cpp b/test/StaticJsonBuffer/parseArray.cpp similarity index 100% rename from test/StaticJsonBuffer_ParseArray_Tests.cpp rename to test/StaticJsonBuffer/parseArray.cpp diff --git a/test/StaticJsonBuffer_ParseObject_Tests.cpp b/test/StaticJsonBuffer/parseObject.cpp similarity index 100% rename from test/StaticJsonBuffer_ParseObject_Tests.cpp rename to test/StaticJsonBuffer/parseObject.cpp diff --git a/test/StaticJsonBuffer_String_Tests.cpp b/test/StaticJsonBuffer/string.cpp similarity index 100% rename from test/StaticJsonBuffer_String_Tests.cpp rename to test/StaticJsonBuffer/string.cpp