@@ -25,14 +25,14 @@ std::shared_ptr<reprojection> defproj{
2525
2626// We are using zoom level 12 here, because at that level a tile is about
2727// 10,000 units wide/high which gives us easy numbers to work with.
28- constexpr uint32_t zoom = 12 ;
28+ constexpr uint32_t ZOOM = 12 ;
2929
3030} // anonymous namespace
3131
3232TEST_CASE (" expire null geometry does nothing" , " [NoDB]" )
3333{
3434 expire_config_t const expire_config;
35- expire_tiles et{zoom , defproj};
35+ expire_tiles et{ZOOM , defproj};
3636
3737 SECTION (" geom" )
3838 {
@@ -53,7 +53,7 @@ TEST_CASE("expire null geometry does nothing", "[NoDB]")
5353TEST_CASE (" expire point at tile boundary" , " [NoDB]" )
5454{
5555 expire_config_t const expire_config;
56- expire_tiles et{zoom , defproj};
56+ expire_tiles et{ZOOM , defproj};
5757
5858 geom::point_t const pt{0.0 , 0.0 };
5959
@@ -74,16 +74,16 @@ TEST_CASE("expire point at tile boundary", "[NoDB]")
7474
7575 auto const tiles = et.get_tiles ();
7676 REQUIRE (tiles.size () == 4 );
77- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2047 , 2047 });
78- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2048 , 2047 });
79- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2047 , 2048 });
80- CHECK (tile_t::from_quadkey (tiles[3 ], zoom ) == tile_t {zoom , 2048 , 2048 });
77+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2047 , 2047 });
78+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
79+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2047 , 2048 });
80+ CHECK (tile_t::from_quadkey (tiles[3 ], ZOOM ) == tile_t {ZOOM , 2048 , 2048 });
8181}
8282
8383TEST_CASE (" expire point away from tile boundary" , " [NoDB]" )
8484{
8585 expire_config_t const expire_config;
86- expire_tiles et{zoom , defproj};
86+ expire_tiles et{ZOOM , defproj};
8787
8888 geom::point_t const pt{5000.0 , 5000.0 };
8989
@@ -104,13 +104,13 @@ TEST_CASE("expire point away from tile boundary", "[NoDB]")
104104
105105 auto const tiles = et.get_tiles ();
106106 REQUIRE (tiles.size () == 1 );
107- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2047 });
107+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
108108}
109109
110110TEST_CASE (" expire linestring away from tile boundary" , " [NoDB]" )
111111{
112112 expire_config_t const expire_config;
113- expire_tiles et{zoom , defproj};
113+ expire_tiles et{ZOOM , defproj};
114114
115115 SECTION (" line" )
116116 {
@@ -135,13 +135,13 @@ TEST_CASE("expire linestring away from tile boundary", "[NoDB]")
135135
136136 auto const tiles = et.get_tiles ();
137137 REQUIRE (tiles.size () == 1 );
138- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2047 });
138+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
139139}
140140
141141TEST_CASE (" expire linestring crossing tile boundary" , " [NoDB]" )
142142{
143143 expire_config_t const expire_config;
144- expire_tiles et{zoom , defproj};
144+ expire_tiles et{ZOOM , defproj};
145145
146146 SECTION (" line" )
147147 {
@@ -166,14 +166,14 @@ TEST_CASE("expire linestring crossing tile boundary", "[NoDB]")
166166
167167 auto const tiles = et.get_tiles ();
168168 REQUIRE (tiles.size () == 2 );
169- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2046 });
170- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2048 , 2047 });
169+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2046 });
170+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
171171}
172172
173173TEST_CASE (" expire small polygon" , " [NoDB]" )
174174{
175175 expire_config_t const expire_config;
176- expire_tiles et{zoom , defproj};
176+ expire_tiles et{ZOOM , defproj};
177177
178178 SECTION (" polygon" )
179179 {
@@ -210,15 +210,15 @@ TEST_CASE("expire small polygon", "[NoDB]")
210210
211211 auto const tiles = et.get_tiles ();
212212 REQUIRE (tiles.size () == 1 );
213- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2047 });
213+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
214214}
215215
216216TEST_CASE (" expire large polygon as bbox" , " [NoDB]" )
217217{
218218 expire_config_t expire_config;
219219 expire_config.mode = expire_mode::hybrid;
220220 expire_config.full_area_limit = 40000 ;
221- expire_tiles et{zoom , defproj};
221+ expire_tiles et{ZOOM , defproj};
222222
223223 SECTION (" polygon" )
224224 {
@@ -255,25 +255,25 @@ TEST_CASE("expire large polygon as bbox", "[NoDB]")
255255
256256 auto const tiles = et.get_tiles ();
257257 REQUIRE (tiles.size () == 9 );
258- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2045 });
259- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2049 , 2045 });
260- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2050 , 2045 });
258+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2045 });
259+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2049 , 2045 });
260+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2050 , 2045 });
261261
262- CHECK (tile_t::from_quadkey (tiles[3 ], zoom ) == tile_t {zoom , 2048 , 2046 });
263- CHECK (tile_t::from_quadkey (tiles[4 ], zoom ) == tile_t {zoom , 2049 , 2046 });
264- CHECK (tile_t::from_quadkey (tiles[7 ], zoom ) == tile_t {zoom , 2050 , 2046 });
262+ CHECK (tile_t::from_quadkey (tiles[3 ], ZOOM ) == tile_t {ZOOM , 2048 , 2046 });
263+ CHECK (tile_t::from_quadkey (tiles[4 ], ZOOM ) == tile_t {ZOOM , 2049 , 2046 });
264+ CHECK (tile_t::from_quadkey (tiles[7 ], ZOOM ) == tile_t {ZOOM , 2050 , 2046 });
265265
266- CHECK (tile_t::from_quadkey (tiles[5 ], zoom ) == tile_t {zoom , 2048 , 2047 });
267- CHECK (tile_t::from_quadkey (tiles[6 ], zoom ) == tile_t {zoom , 2049 , 2047 });
268- CHECK (tile_t::from_quadkey (tiles[8 ], zoom ) == tile_t {zoom , 2050 , 2047 });
266+ CHECK (tile_t::from_quadkey (tiles[5 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
267+ CHECK (tile_t::from_quadkey (tiles[6 ], ZOOM ) == tile_t {ZOOM , 2049 , 2047 });
268+ CHECK (tile_t::from_quadkey (tiles[8 ], ZOOM ) == tile_t {ZOOM , 2050 , 2047 });
269269}
270270
271271TEST_CASE (" expire large polygon as boundary" , " [NoDB]" )
272272{
273273 expire_config_t expire_config;
274274 expire_config.mode = expire_mode::hybrid;
275275 expire_config.full_area_limit = 10000 ;
276- expire_tiles et{zoom , defproj};
276+ expire_tiles et{ZOOM , defproj};
277277
278278 SECTION (" polygon" )
279279 {
@@ -320,22 +320,22 @@ TEST_CASE("expire large polygon as boundary", "[NoDB]")
320320
321321 auto const tiles = et.get_tiles ();
322322 REQUIRE (tiles.size () == 8 );
323- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2048 , 2045 });
324- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2049 , 2045 });
325- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2050 , 2045 });
323+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2048 , 2045 });
324+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2049 , 2045 });
325+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2050 , 2045 });
326326
327- CHECK (tile_t::from_quadkey (tiles[3 ], zoom ) == tile_t {zoom , 2048 , 2046 });
328- CHECK (tile_t::from_quadkey (tiles[6 ], zoom ) == tile_t {zoom , 2050 , 2046 });
327+ CHECK (tile_t::from_quadkey (tiles[3 ], ZOOM ) == tile_t {ZOOM , 2048 , 2046 });
328+ CHECK (tile_t::from_quadkey (tiles[6 ], ZOOM ) == tile_t {ZOOM , 2050 , 2046 });
329329
330- CHECK (tile_t::from_quadkey (tiles[4 ], zoom ) == tile_t {zoom , 2048 , 2047 });
331- CHECK (tile_t::from_quadkey (tiles[5 ], zoom ) == tile_t {zoom , 2049 , 2047 });
332- CHECK (tile_t::from_quadkey (tiles[7 ], zoom ) == tile_t {zoom , 2050 , 2047 });
330+ CHECK (tile_t::from_quadkey (tiles[4 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
331+ CHECK (tile_t::from_quadkey (tiles[5 ], ZOOM ) == tile_t {ZOOM , 2049 , 2047 });
332+ CHECK (tile_t::from_quadkey (tiles[7 ], ZOOM ) == tile_t {ZOOM , 2050 , 2047 });
333333}
334334
335335TEST_CASE (" expire multipoint geometry" , " [NoDB]" )
336336{
337337 expire_config_t const expire_config;
338- expire_tiles et{zoom , defproj};
338+ expire_tiles et{ZOOM , defproj};
339339
340340 geom::point_t const p1{0.0 , 0.0 };
341341 geom::point_t const p2{15000.0 , 15000.0 };
@@ -369,17 +369,17 @@ TEST_CASE("expire multipoint geometry", "[NoDB]")
369369
370370 auto const tiles = et.get_tiles ();
371371 REQUIRE (tiles.size () == 5 );
372- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2047 , 2047 });
373- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2049 , 2046 });
374- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2048 , 2047 });
375- CHECK (tile_t::from_quadkey (tiles[3 ], zoom ) == tile_t {zoom , 2047 , 2048 });
376- CHECK (tile_t::from_quadkey (tiles[4 ], zoom ) == tile_t {zoom , 2048 , 2048 });
372+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2047 , 2047 });
373+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2049 , 2046 });
374+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
375+ CHECK (tile_t::from_quadkey (tiles[3 ], ZOOM ) == tile_t {ZOOM , 2047 , 2048 });
376+ CHECK (tile_t::from_quadkey (tiles[4 ], ZOOM ) == tile_t {ZOOM , 2048 , 2048 });
377377}
378378
379379TEST_CASE (" expire multilinestring geometry" , " [NoDB]" )
380380{
381381 expire_config_t const expire_config;
382- expire_tiles et{zoom , defproj};
382+ expire_tiles et{ZOOM , defproj};
383383
384384 geom::linestring_t l1{{2000.0 , 2000.0 }, {3000.0 , 3000.0 }};
385385 geom::linestring_t l2{{15000.0 , 15000.0 }, {25000.0 , 15000.0 }};
@@ -397,17 +397,17 @@ TEST_CASE("expire multilinestring geometry", "[NoDB]")
397397
398398 auto const tiles = et.get_tiles ();
399399 REQUIRE (tiles.size () == 3 );
400- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2049 , 2046 });
401- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2048 , 2047 });
402- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2050 , 2046 });
400+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2049 , 2046 });
401+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
402+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2050 , 2046 });
403403}
404404
405405TEST_CASE (" expire multipolygon geometry" , " [NoDB]" )
406406{
407407 expire_config_t expire_config;
408408 expire_config.mode = expire_mode::hybrid;
409409 expire_config.full_area_limit = 10000 ;
410- expire_tiles et{zoom , defproj};
410+ expire_tiles et{ZOOM , defproj};
411411
412412 geom::polygon_t p1{{{2000.0 , 2000.0 },
413413 {2000.0 , 3000.0 },
@@ -447,11 +447,11 @@ TEST_CASE("expire multipolygon geometry", "[NoDB]")
447447 }
448448
449449 std::set<quadkey_t > expected;
450- expected.insert (tile_t {zoom , 2048 , 2047 }.quadkey ()); // p1
450+ expected.insert (tile_t {ZOOM , 2048 , 2047 }.quadkey ()); // p1
451451
452452 for (uint32_t x = 2049 ; x <= 2052 ; ++x) {
453453 for (uint32_t y = 2043 ; y <= 2046 ; ++y) {
454- expected.insert (tile_t {zoom , x, y}.quadkey ()); // p2
454+ expected.insert (tile_t {ZOOM , x, y}.quadkey ()); // p2
455455 }
456456 }
457457 REQUIRE (expected == result);
@@ -460,7 +460,7 @@ TEST_CASE("expire multipolygon geometry", "[NoDB]")
460460TEST_CASE (" expire geometry collection" , " [NoDB]" )
461461{
462462 expire_config_t const expire_config;
463- expire_tiles et{zoom , defproj};
463+ expire_tiles et{ZOOM , defproj};
464464
465465 geom::collection_t collection;
466466 collection.add_geometry (geom::geometry_t {geom::point_t {0.0 , 0.0 }});
@@ -472,18 +472,18 @@ TEST_CASE("expire geometry collection", "[NoDB]")
472472
473473 auto const tiles = et.get_tiles ();
474474 REQUIRE (tiles.size () == 6 );
475- CHECK (tile_t::from_quadkey (tiles[0 ], zoom ) == tile_t {zoom , 2047 , 2047 });
476- CHECK (tile_t::from_quadkey (tiles[1 ], zoom ) == tile_t {zoom , 2049 , 2046 });
477- CHECK (tile_t::from_quadkey (tiles[2 ], zoom ) == tile_t {zoom , 2048 , 2047 });
478- CHECK (tile_t::from_quadkey (tiles[3 ], zoom ) == tile_t {zoom , 2050 , 2046 });
479- CHECK (tile_t::from_quadkey (tiles[4 ], zoom ) == tile_t {zoom , 2047 , 2048 });
480- CHECK (tile_t::from_quadkey (tiles[5 ], zoom ) == tile_t {zoom , 2048 , 2048 });
475+ CHECK (tile_t::from_quadkey (tiles[0 ], ZOOM ) == tile_t {ZOOM , 2047 , 2047 });
476+ CHECK (tile_t::from_quadkey (tiles[1 ], ZOOM ) == tile_t {ZOOM , 2049 , 2046 });
477+ CHECK (tile_t::from_quadkey (tiles[2 ], ZOOM ) == tile_t {ZOOM , 2048 , 2047 });
478+ CHECK (tile_t::from_quadkey (tiles[3 ], ZOOM ) == tile_t {ZOOM , 2050 , 2046 });
479+ CHECK (tile_t::from_quadkey (tiles[4 ], ZOOM ) == tile_t {ZOOM , 2047 , 2048 });
480+ CHECK (tile_t::from_quadkey (tiles[5 ], ZOOM ) == tile_t {ZOOM , 2048 , 2048 });
481481}
482482
483483TEST_CASE (" expire works if in 3857" , " [NoDB]" )
484484{
485485 expire_config_t const expire_config;
486- expire_tiles et{zoom , defproj};
486+ expire_tiles et{ZOOM , defproj};
487487
488488 geom::geometry_t geom{geom::point_t {0.0 , 0.0 }};
489489 geom.set_srid (PROJ_SPHERE_MERC);
@@ -496,7 +496,7 @@ TEST_CASE("expire works if in 3857", "[NoDB]")
496496TEST_CASE (" expire doesn't do anything if not in 3857" , " [NoDB]" )
497497{
498498 expire_config_t const expire_config;
499- expire_tiles et{zoom , defproj};
499+ expire_tiles et{ZOOM , defproj};
500500
501501 geom::geometry_t geom{geom::point_t {0.0 , 0.0 }};
502502 geom.set_srid (1234 );
0 commit comments