Pārlūkot izejas kodu

Organized test files in subfolders

Benoit Blanchon 8 gadi atpakaļ
vecāks
revīzija
ac89d91db5
65 mainītis faili ar 4 papildinājumiem un 141 dzēšanām
  1. 4 1
      test/CMakeLists.txt
  2. 0 0
      test/DynamicJsonBuffer/array.cpp
  3. 0 0
      test/DynamicJsonBuffer/basics.cpp
  4. 0 0
      test/DynamicJsonBuffer/noMemory.cpp
  5. 0 0
      test/DynamicJsonBuffer/object.cpp
  6. 0 0
      test/DynamicJsonBuffer/string.cpp
  7. 0 0
      test/IntegrationTests/gbathree.cpp
  8. 0 0
      test/IntegrationTests/parse_print.cpp
  9. 0 68
      test/Issue10.cpp
  10. 0 16
      test/Issue214.cpp
  11. 0 56
      test/Issue34.cpp
  12. 0 0
      test/JsonArray/add.cpp
  13. 0 0
      test/JsonArray/basics.cpp
  14. 0 0
      test/JsonArray/copyFrom.cpp
  15. 0 0
      test/JsonArray/copyTo.cpp
  16. 0 0
      test/JsonArray/invalid.cpp
  17. 0 0
      test/JsonArray/iterator.cpp
  18. 0 0
      test/JsonArray/prettyPrintTo.cpp
  19. 0 0
      test/JsonArray/printTo.cpp
  20. 0 0
      test/JsonArray/removeAt.cpp
  21. 0 0
      test/JsonArray/set.cpp
  22. 0 0
      test/JsonArray/subscript.cpp
  23. 0 0
      test/JsonBuffer/nested.cpp
  24. 0 0
      test/JsonBuffer/nestingLimit.cpp
  25. 0 0
      test/JsonBuffer/parse.cpp
  26. 0 0
      test/JsonBuffer/parseArray.cpp
  27. 0 0
      test/JsonBuffer/parseObject.cpp
  28. 0 0
      test/JsonObject/basics.cpp
  29. 0 0
      test/JsonObject/containsKey.cpp
  30. 0 0
      test/JsonObject/get.cpp
  31. 0 0
      test/JsonObject/invalid.cpp
  32. 0 0
      test/JsonObject/iterator.cpp
  33. 0 0
      test/JsonObject/prettyPrintTo.cpp
  34. 0 0
      test/JsonObject/printTo.cpp
  35. 0 0
      test/JsonObject/remove.cpp
  36. 0 0
      test/JsonObject/set.cpp
  37. 0 0
      test/JsonObject/subscript.cpp
  38. 0 0
      test/JsonVariant/as.cpp
  39. 0 0
      test/JsonVariant/compare.cpp
  40. 0 0
      test/JsonVariant/copy.cpp
  41. 0 0
      test/JsonVariant/is.cpp
  42. 0 0
      test/JsonVariant/printTo.cpp
  43. 0 0
      test/JsonVariant/set_get.cpp
  44. 0 0
      test/JsonVariant/subscript.cpp
  45. 0 0
      test/JsonVariant/success.cpp
  46. 0 0
      test/JsonVariant/undefined.cpp
  47. 0 0
      test/JsonWriter/writeFloat.cpp
  48. 0 0
      test/JsonWriter/writeString.cpp
  49. 0 0
      test/Misc/StringBuilder.cpp
  50. 0 0
      test/Misc/TypeTraits.cpp
  51. 0 0
      test/Misc/deprecated.cpp
  52. 0 0
      test/Misc/std_stream.cpp
  53. 0 0
      test/Misc/std_string.cpp
  54. 0 0
      test/Misc/unsigned_char.cpp
  55. 0 0
      test/Misc/vla.cpp
  56. 0 0
      test/Polyfills/isFloat.cpp
  57. 0 0
      test/Polyfills/isInteger.cpp
  58. 0 0
      test/Polyfills/parseFloat.cpp
  59. 0 0
      test/Polyfills/parseInteger.cpp
  60. 0 0
      test/StaticJsonBuffer/basics.cpp
  61. 0 0
      test/StaticJsonBuffer/createArray.cpp
  62. 0 0
      test/StaticJsonBuffer/createObject.cpp
  63. 0 0
      test/StaticJsonBuffer/parseArray.cpp
  64. 0 0
      test/StaticJsonBuffer/parseObject.cpp
  65. 0 0
      test/StaticJsonBuffer/string.cpp

+ 4 - 1
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(

+ 0 - 0
test/DynamicJsonBuffer_Array_Tests.cpp → test/DynamicJsonBuffer/array.cpp


+ 0 - 0
test/DynamicJsonBuffer_Basic_Tests.cpp → test/DynamicJsonBuffer/basics.cpp


+ 0 - 0
test/DynamicJsonBuffer_NoMemory_Tests.cpp → test/DynamicJsonBuffer/noMemory.cpp


+ 0 - 0
test/DynamicJsonBuffer_Object_Tests.cpp → test/DynamicJsonBuffer/object.cpp


+ 0 - 0
test/DynamicJsonBuffer_String_Tests.cpp → test/DynamicJsonBuffer/string.cpp


+ 0 - 0
test/GbathreeBug.cpp → test/IntegrationTests/gbathree.cpp


+ 0 - 0
test/IntegrationTests.cpp → test/IntegrationTests/parse_print.cpp


+ 0 - 68
test/Issue10.cpp

@@ -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 <ArduinoJson.h>
-#include <gtest/gtest.h>
-
-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 <typename T>
-  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_ARRAY_SIZE(2) + 2 * JSON_OBJECT_SIZE(2)> 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);
-}

+ 0 - 16
test/Issue214.cpp

@@ -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 <ArduinoJson.h>
-#include <gtest/gtest.h>
-
-TEST(Issue214, IsBool) {
-  char json[] = "{\"ota\": {\"enabled\": true}}";
-  StaticJsonBuffer<JSON_OBJECT_SIZE(1) + JSON_OBJECT_SIZE(1)> jsonBuffer;
-  JsonObject& parsedJson = jsonBuffer.parseObject(json);
-  ASSERT_TRUE(parsedJson["ota"]["enabled"].is<bool>());
-}

+ 0 - 56
test/Issue34.cpp

@@ -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 <ArduinoJson.h>
-#include <gtest/gtest.h>
-
-class Issue34 : public testing::Test {
- protected:
-  template <typename T>
-  void test_with_value(T expected) {
-    StaticJsonBuffer<JSON_OBJECT_SIZE(1)> jsonBuffer;
-
-    JsonObject& jsonObject = jsonBuffer.createObject();
-
-    jsonObject["key"] = expected;
-    T actual = jsonObject["key"];
-
-    ASSERT_EQ(expected, actual);
-  }
-};
-
-TEST_F(Issue34, int8_t) {
-  test_with_value<int8_t>(1);
-}
-
-TEST_F(Issue34, uint8_t) {
-  test_with_value<uint8_t>(2);
-}
-
-TEST_F(Issue34, int16_t) {
-  test_with_value<int16_t>(3);
-}
-
-TEST_F(Issue34, uint16_t) {
-  test_with_value<uint16_t>(4);
-}
-
-TEST_F(Issue34, int32_t) {
-  test_with_value<int32_t>(5);
-}
-
-TEST_F(Issue34, uint32_t) {
-  test_with_value<uint32_t>(6);
-}
-
-TEST_F(Issue34, float) {
-  test_with_value<float>(7);
-}
-
-TEST_F(Issue34, double) {
-  test_with_value<double>(8);
-}

+ 0 - 0
test/JsonArray_Add_Tests.cpp → test/JsonArray/add.cpp


+ 0 - 0
test/JsonArray_Basic_Tests.cpp → test/JsonArray/basics.cpp


+ 0 - 0
test/JsonArray_CopyFrom_Tests.cpp → test/JsonArray/copyFrom.cpp


+ 0 - 0
test/JsonArray_CopyTo_Tests.cpp → test/JsonArray/copyTo.cpp


+ 0 - 0
test/JsonArray_Invalid_Tests.cpp → test/JsonArray/invalid.cpp


+ 0 - 0
test/JsonArray_Iterator_Tests.cpp → test/JsonArray/iterator.cpp


+ 0 - 0
test/JsonArray_PrettyPrintTo_Tests.cpp → test/JsonArray/prettyPrintTo.cpp


+ 0 - 0
test/JsonArray_PrintTo_Tests.cpp → test/JsonArray/printTo.cpp


+ 0 - 0
test/JsonArray_Remove_Tests.cpp → test/JsonArray/removeAt.cpp


+ 0 - 0
test/JsonArray_Set_Tests.cpp → test/JsonArray/set.cpp


+ 0 - 0
test/JsonArray_Subscript_Tests.cpp → test/JsonArray/subscript.cpp


+ 0 - 0
test/JsonParser_Nested_Tests.cpp → test/JsonBuffer/nested.cpp


+ 0 - 0
test/JsonParser_NestingLimit_Tests.cpp → test/JsonBuffer/nestingLimit.cpp


+ 0 - 0
test/JsonParser_Variant_Tests.cpp → test/JsonBuffer/parse.cpp


+ 0 - 0
test/JsonParser_Array_Tests.cpp → test/JsonBuffer/parseArray.cpp


+ 0 - 0
test/JsonParser_Object_Tests.cpp → test/JsonBuffer/parseObject.cpp


+ 0 - 0
test/JsonObject_Basic_Tests.cpp → test/JsonObject/basics.cpp


+ 0 - 0
test/JsonObject_ContainsKey_Tests.cpp → test/JsonObject/containsKey.cpp


+ 0 - 0
test/JsonObject_Get_Tests.cpp → test/JsonObject/get.cpp


+ 0 - 0
test/JsonObject_Invalid_Tests.cpp → test/JsonObject/invalid.cpp


+ 0 - 0
test/JsonObject_Iterator_Tests.cpp → test/JsonObject/iterator.cpp


+ 0 - 0
test/JsonObject_PrettyPrintTo_Tests.cpp → test/JsonObject/prettyPrintTo.cpp


+ 0 - 0
test/JsonObject_PrintTo_Tests.cpp → test/JsonObject/printTo.cpp


+ 0 - 0
test/JsonObject_Remove_Tests.cpp → test/JsonObject/remove.cpp


+ 0 - 0
test/JsonObject_Set_Tests.cpp → test/JsonObject/set.cpp


+ 0 - 0
test/JsonObject_Subscript_Tests.cpp → test/JsonObject/subscript.cpp


+ 0 - 0
test/JsonVariant_As_Tests.cpp → test/JsonVariant/as.cpp


+ 0 - 0
test/JsonVariant_Comparison_Tests.cpp → test/JsonVariant/compare.cpp


+ 0 - 0
test/JsonVariant_Copy_Tests.cpp → test/JsonVariant/copy.cpp


+ 0 - 0
test/JsonVariant_Is_Tests.cpp → test/JsonVariant/is.cpp


+ 0 - 0
test/JsonVariant_PrintTo_Tests.cpp → test/JsonVariant/printTo.cpp


+ 0 - 0
test/JsonVariant_Storage_Tests.cpp → test/JsonVariant/set_get.cpp


+ 0 - 0
test/JsonVariant_Subscript_Tests.cpp → test/JsonVariant/subscript.cpp


+ 0 - 0
test/JsonVariant_Success_Tests.cpp → test/JsonVariant/success.cpp


+ 0 - 0
test/JsonVariant_Undefined_Tests.cpp → test/JsonVariant/undefined.cpp


+ 0 - 0
test/JsonWriter_WriteFloat_Tests.cpp → test/JsonWriter/writeFloat.cpp


+ 0 - 0
test/JsonWriter_WriteString_Tests.cpp → test/JsonWriter/writeString.cpp


+ 0 - 0
test/StringBuilderTests.cpp → test/Misc/StringBuilder.cpp


+ 0 - 0
test/TypeTraits_Tests.cpp → test/Misc/TypeTraits.cpp


+ 0 - 0
test/Deprecated_Tests.cpp → test/Misc/deprecated.cpp


+ 0 - 0
test/StdStream_Tests.cpp → test/Misc/std_stream.cpp


+ 0 - 0
test/String_Tests.cpp → test/Misc/std_string.cpp


+ 0 - 0
test/UnsignedChar_Tests.cpp → test/Misc/unsigned_char.cpp


+ 0 - 0
test/VariableLengthArray_Tests.cpp → test/Misc/vla.cpp


+ 0 - 0
test/Polyfills_IsFloat_Tests.cpp → test/Polyfills/isFloat.cpp


+ 0 - 0
test/Polyfills_IsInteger_Tests.cpp → test/Polyfills/isInteger.cpp


+ 0 - 0
test/Polyfills_ParseFloat_Tests.cpp → test/Polyfills/parseFloat.cpp


+ 0 - 0
test/Polyfills_ParseInteger_Tests.cpp → test/Polyfills/parseInteger.cpp


+ 0 - 0
test/StaticJsonBuffer_Basic_Tests.cpp → test/StaticJsonBuffer/basics.cpp


+ 0 - 0
test/StaticJsonBuffer_CreateArray_Tests.cpp → test/StaticJsonBuffer/createArray.cpp


+ 0 - 0
test/StaticJsonBuffer_CreateObject_Tests.cpp → test/StaticJsonBuffer/createObject.cpp


+ 0 - 0
test/StaticJsonBuffer_ParseArray_Tests.cpp → test/StaticJsonBuffer/parseArray.cpp


+ 0 - 0
test/StaticJsonBuffer_ParseObject_Tests.cpp → test/StaticJsonBuffer/parseObject.cpp


+ 0 - 0
test/StaticJsonBuffer_String_Tests.cpp → test/StaticJsonBuffer/string.cpp