@@ -1007,20 +1007,6 @@ TEMPLATE_TEST_CASE("middle: add relation with attributes", "",
10071007 }
10081008}
10091009
1010- struct test_pending_processor : public middle_t ::pending_processor
1011- {
1012- test_pending_processor () = default ;
1013-
1014- void enqueue_ways (osmid_t id) override { m_way_ids.push_back (id); }
1015- void enqueue_relations (osmid_t id) override { m_rel_ids.push_back (id); }
1016-
1017- void process_ways () override {}
1018- void process_relations () override {}
1019-
1020- std::vector<osmid_t > m_way_ids;
1021- std::vector<osmid_t > m_rel_ids;
1022- };
1023-
10241010TEMPLATE_TEST_CASE (" middle: change nodes in way" , " " , options_slim_default,
10251011 options_slim_dense_cache, options_flat_node_cache)
10261012{
@@ -1065,11 +1051,7 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
10651051 check_way (mid, way21);
10661052 check_way_nodes (mid, way21.id (), {&node11, &node12});
10671053
1068- // Nothing pending yet
10691054 REQUIRE_FALSE (dependency_manager.has_pending ());
1070- test_pending_processor proc;
1071- dependency_manager.process_pending (proc);
1072- REQUIRE (proc.m_way_ids .empty ());
10731055
10741056 mid->commit ();
10751057 }
@@ -1089,9 +1071,9 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
10891071 mid->flush ();
10901072
10911073 REQUIRE (dependency_manager.has_pending ());
1092- test_pending_processor proc ;
1093- dependency_manager.process_pending (proc );
1094- REQUIRE_THAT (proc. m_way_ids , Catch::Equals<osmid_t >({20 }));
1074+ idlist_t way_ids ;
1075+ dependency_manager.get_pending_way_ids ( std::back_inserter (way_ids) );
1076+ REQUIRE_THAT (way_ids , Catch::Equals<osmid_t >({20 }));
10951077
10961078 check_way (mid, way20);
10971079 check_way_nodes (mid, way20.id (), {&node10a, &node11});
@@ -1122,9 +1104,9 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
11221104 mid->flush ();
11231105
11241106 REQUIRE (dependency_manager.has_pending ());
1125- test_pending_processor proc ;
1126- dependency_manager.process_pending (proc );
1127- REQUIRE_THAT (proc. m_way_ids , Catch::Equals<osmid_t >({20 , 22 }));
1107+ idlist_t way_ids ;
1108+ dependency_manager.get_pending_way_ids ( std::back_inserter (way_ids) );
1109+ REQUIRE_THAT (way_ids , Catch::Equals<osmid_t >({20 , 22 }));
11281110
11291111 check_way (mid, way20);
11301112 check_way_nodes (mid, way20.id (), {&node10a, &node11});
@@ -1162,9 +1144,6 @@ TEMPLATE_TEST_CASE("middle: change nodes in way", "", options_slim_default,
11621144 mid->flush ();
11631145
11641146 REQUIRE_FALSE (dependency_manager.has_pending ());
1165- test_pending_processor proc;
1166- dependency_manager.process_pending (proc);
1167- REQUIRE (proc.m_way_ids .empty ());
11681147
11691148 mid->commit ();
11701149 }
@@ -1228,10 +1207,10 @@ TEMPLATE_TEST_CASE("middle: change nodes in relation", "", options_slim_default,
12281207 mid->flush ();
12291208
12301209 REQUIRE (dependency_manager.has_pending ());
1231- test_pending_processor proc ;
1232- dependency_manager.process_pending (proc );
1210+ idlist_t rel_ids ;
1211+ dependency_manager.get_pending_relation_ids ( std::back_inserter (rel_ids) );
12331212
1234- REQUIRE_THAT (proc. m_rel_ids , Catch::Equals<osmid_t >({30 }));
1213+ REQUIRE_THAT (rel_ids , Catch::Equals<osmid_t >({30 }));
12351214 check_relation (mid, rel30);
12361215
12371216 mid->commit ();
@@ -1249,10 +1228,12 @@ TEMPLATE_TEST_CASE("middle: change nodes in relation", "", options_slim_default,
12491228 mid->flush ();
12501229
12511230 REQUIRE (dependency_manager.has_pending ());
1252- test_pending_processor proc;
1253- dependency_manager.process_pending (proc);
1254- REQUIRE_THAT (proc.m_way_ids , Catch::Equals<osmid_t >({20 }));
1255- REQUIRE_THAT (proc.m_rel_ids , Catch::Equals<osmid_t >({31 }));
1231+ idlist_t way_ids;
1232+ dependency_manager.get_pending_way_ids (std::back_inserter (way_ids));
1233+ REQUIRE_THAT (way_ids, Catch::Equals<osmid_t >({20 }));
1234+ idlist_t rel_ids;
1235+ dependency_manager.get_pending_relation_ids (std::back_inserter (rel_ids));
1236+ REQUIRE_THAT (rel_ids, Catch::Equals<osmid_t >({31 }));
12561237 check_relation (mid, rel31);
12571238 }
12581239}
0 commit comments