Exposed JsonPairConst

This commit is contained in:
Benoit Blanchon
2020-02-13 16:58:23 +01:00
parent fbffadb2cf
commit 372b7d3d9d
2 changed files with 7 additions and 3 deletions

View File

@ -40,15 +40,18 @@ TEST_CASE("JsonObjectConst::begin()/end()") {
JsonObjectConst cobj = obj;
SECTION("NonConstIterator") {
SECTION("Iteration") {
JsonObjectConst::iterator it = cobj.begin();
REQUIRE(cobj.end() != it);
REQUIRE(it->key() == "ab");
REQUIRE(12 == it->value());
++it;
REQUIRE(cobj.end() != it);
REQUIRE(it->key() == "cd");
REQUIRE(34 == it->value());
JsonPairConst pair = *it;
REQUIRE(pair.key() == "cd");
REQUIRE(34 == pair.value());
++it;
REQUIRE(cobj.end() == it);
}

View File

@ -46,6 +46,7 @@ typedef ARDUINOJSON_NAMESPACE::Integer JsonInteger;
typedef ARDUINOJSON_NAMESPACE::ObjectConstRef JsonObjectConst;
typedef ARDUINOJSON_NAMESPACE::ObjectRef JsonObject;
typedef ARDUINOJSON_NAMESPACE::Pair JsonPair;
typedef ARDUINOJSON_NAMESPACE::PairConst JsonPairConst;
typedef ARDUINOJSON_NAMESPACE::String JsonString;
typedef ARDUINOJSON_NAMESPACE::UInt JsonUInt;
typedef ARDUINOJSON_NAMESPACE::VariantConstRef JsonVariantConst;