Commit b573841a by Niels

+ more test cases

parent 98af0887
...@@ -23,4 +23,3 @@ after_success: ...@@ -23,4 +23,3 @@ after_success:
- make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage" - make json_unit CXXFLAGS="-fprofile-arcs -ftest-coverage"
- ./json_unit - ./json_unit
- coveralls --exclude lib --exclude test --gcov-options '\-lp' --gcov 'gcov-4.8' - coveralls --exclude lib --exclude test --gcov-options '\-lp' --gcov 'gcov-4.8'
...@@ -1381,6 +1381,7 @@ JSON::iterator::iterator(const JSON::iterator& o) : _object(o._object) ...@@ -1381,6 +1381,7 @@ JSON::iterator::iterator(const JSON::iterator& o) : _object(o._object)
} }
default: default:
{ {
// not sure if used
break; break;
} }
} }
......
...@@ -1402,12 +1402,31 @@ TEST_CASE("Iterators") ...@@ -1402,12 +1402,31 @@ TEST_CASE("Iterators")
JSON::iterator i2(i1); JSON::iterator i2(i1);
JSON::iterator i3; JSON::iterator i3;
i3 = i2; i3 = i2;
CHECK(i1 == i1);
JSON::const_iterator i4 = j_array.begin(); JSON::const_iterator i4 = j_array.begin();
++i4; ++i4;
JSON::const_iterator i5(i4); JSON::const_iterator i5(i4);
JSON::const_iterator i6; JSON::const_iterator i6;
i6 = i5; i6 = i5;
CHECK(i4 == i4);
}
{
JSON j_object = {{"1", 1}, {"2", 2}};
JSON::iterator i1 = j_object.begin();
++i1;
JSON::iterator i2(i1);
JSON::iterator i3;
i3 = i2;
CHECK(i1 == i1);
JSON::const_iterator i4 = j_object.begin();
++i4;
JSON::const_iterator i5(i4);
JSON::const_iterator i6;
i6 = i5;
CHECK(i4 == i4);
} }
// iterator copy assignment // iterator copy assignment
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment