diff --git a/extras/tests/JsonArray/equals.cpp b/extras/tests/JsonArray/equals.cpp index 365ab59d..595bd6ea 100644 --- a/extras/tests/JsonArray/equals.cpp +++ b/extras/tests/JsonArray/equals.cpp @@ -31,7 +31,7 @@ TEST_CASE("JsonArray::operator==()") { REQUIRE_FALSE(array1c == array2c); } - SECTION("should return false when RKS has more elements") { + SECTION("should return false when RHS has more elements") { array1.add(1); array2.add(1); array2.add(2); @@ -47,4 +47,23 @@ TEST_CASE("JsonArray::operator==()") { REQUIRE(array1 == array2); REQUIRE(array1c == array2c); } + + SECTION("should return false when RHS is null") { + JsonArray null; + + REQUIRE_FALSE(array1 == null); + } + + SECTION("should return false when LHS is null") { + JsonArray null; + + REQUIRE_FALSE(null == array1); + } + + SECTION("should return true when both are null") { + JsonArray null1; + JsonArray null2; + + REQUIRE(null1 == null2); + } } diff --git a/extras/tests/JsonArray/iterator.cpp b/extras/tests/JsonArray/iterator.cpp index ab1a5b70..4fe31bff 100644 --- a/extras/tests/JsonArray/iterator.cpp +++ b/extras/tests/JsonArray/iterator.cpp @@ -28,9 +28,25 @@ static void run_iterator_test() { } TEST_CASE("JsonArray::begin()/end()") { - run_iterator_test(); + SECTION("Non null JsonArray") { + run_iterator_test(); + } + + SECTION("Null JsonArray") { + JsonArray array; + + REQUIRE(array.begin() == array.end()); + } } TEST_CASE("JsonArrayConst::begin()/end()") { - run_iterator_test(); + SECTION("Non null JsonArrayConst") { + run_iterator_test(); + } + + SECTION("Null JsonArrayConst") { + JsonArrayConst array; + + REQUIRE(array.begin() == array.end()); + } }