@@ -248,16 +248,22 @@ BOOST_AUTO_TEST_CASE(TestSparseMatrixAdapter2) {
248248 auto chldren = graph.Children (vert);
249249 auto chldren2 = graph2.Children (vert);
250250 auto it = chldren.begin ();
251+ auto it_other = chldren.begin ();
252+ const auto begin = chldren.begin ();
251253 auto it2 = chldren2.begin ();
252254 auto end = chldren.end ();
253255 auto end2 = chldren2.end ();
254256
255257 std::size_t cntr = 0 ;
256258 while ((it != end) && (it2 != end2)) {
257259 BOOST_CHECK_EQUAL (*it, *it2);
260+ BOOST_CHECK (it == it_other);
261+ BOOST_CHECK (cntr == 0U || it != begin);
262+ BOOST_CHECK (cntr == 0U || (not (it == begin)));
258263
259264 ++cntr;
260265 ++it;
266+ ++it_other;
261267 ++it2;
262268 }
263269 BOOST_CHECK_EQUAL (cntr, graph.OutDegree (vert));
@@ -271,13 +277,17 @@ BOOST_AUTO_TEST_CASE(TestSparseMatrixAdapter2) {
271277 auto parents = graph.Parents (vert);
272278 auto parents2 = graph2.Parents (vert);
273279 auto it = parents.begin ();
280+ auto it_other = parents.begin ();
281+ const auto begin = parents.begin ();
274282 auto it2 = parents2.begin ();
275283 auto end = parents.end ();
276284 auto end2 = parents2.end ();
277285
278286 std::size_t cntr = 0 ;
279287 while ((it != end) && (it2 != end2)) {
280288 BOOST_CHECK_EQUAL (*it, *it2);
289+ BOOST_CHECK (cntr == 0U || it != begin);
290+ BOOST_CHECK (cntr == 0U || (not (it == begin)));
281291
282292 ++cntr;
283293 ++it;
0 commit comments