// Copyright Benoit Blanchon 2014-2017 // MIT License // // Arduino JSON library // https://github.com/bblanchon/ArduinoJson // If you like this project, please add a star! #include #include template static void run_iterator_test() { StaticJsonBuffer jsonBuffer; JsonArray &array = jsonBuffer.createArray(); array.add(12); array.add(34); TIterator it = array.begin(); TIterator end = array.end(); EXPECT_NE(end, it); EXPECT_EQ(12, it->template as()); EXPECT_EQ(12, static_cast(*it)); ++it; EXPECT_NE(end, it); EXPECT_EQ(34, it->template as()); EXPECT_EQ(34, static_cast(*it)); ++it; EXPECT_EQ(end, it); } TEST(JsonArray_Iterator_Test, RunItertorToEnd) { run_iterator_test(); } TEST(JsonArray_Iterator_Test, RunConstItertorToEnd) { run_iterator_test(); }