From 4b66f5dcc7aac65be623d1bf93023793d74dd109 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Motiejus=20Jak=C5=A1tys?= Date: Sat, 17 Apr 2021 17:23:48 +0300 Subject: [PATCH] proper cleanup before 'make test' --- IV/tests-integration.sql | 2 ++ IV/tests.sql | 10 ++++++---- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/IV/tests-integration.sql b/IV/tests-integration.sql index ce791e5..bcc6a5e 100644 --- a/IV/tests-integration.sql +++ b/IV/tests-integration.sql @@ -10,4 +10,6 @@ begin raise notice 'Expected duration: %s (+-%s)', ceil(secs), floor(secs*.5); end $$ language plpgsql; +delete from wm_demo where name in (select distinct name from wm_rivers); + insert into wm_demo (name, way) select name, ST_SimplifyWM(way, name) from wm_rivers; diff --git a/IV/tests.sql b/IV/tests.sql index 9e0ec20..8b8eece 100644 --- a/IV/tests.sql +++ b/IV/tests.sql @@ -51,6 +51,8 @@ insert into wm_figures (name, way) values ('multi-island',ST_GeomFromText('MULTI insert into wm_figures (name, way) values ('selfcrossing-1',ST_GeomFromText('LINESTRING(-27 180,-20 166,-21 142,-18 136,55 136,55 136,71 145,44 165,37 146,22 145,14 164,11 164,3 146,-12 146,-13 176,-18 184)')); insert into wm_figures (name, way) values ('selfcrossing-1-rev',ST_Reverse(ST_Translate((select way from wm_figures where name='selfcrossing-1'), 0, 60))); +delete from wm_debug where name in (select name from wm_figures); + insert into wm_demo (name, way) select name, ST_SimplifyWM(way, name) from wm_figures; -- wm_visuals holds visual aids for the paper. @@ -68,10 +70,10 @@ begin insert into wm_visuals (name, way) values('fig6-baseline', st_makeline(st_startpoint(fig6b2), st_endpoint(fig6b2))); insert into wm_visuals (name, way) values('fig6-newline', st_makeline(st_endpoint(fig6b1), st_endpoint(fig6b2))); - --select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scb1 limit 1 offset 0; - --select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scb2 limit 1 offset 2; - --insert into wm_visuals (name, way) values('selfcrossing-1-baseline', st_makeline(st_startpoint(scb2), st_endpoint(scb2))); - --insert into wm_visuals (name, way) values('selfcrossing-1-newline', st_makeline(st_endpoint(scb1), st_endpoint(scb2))); + select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scb1 limit 1 offset 0; + select way from wm_debug where name='selfcrossing-1' and stage='bbends' and gen=1 into scb2 limit 1 offset 2; + insert into wm_visuals (name, way) values('selfcrossing-1-baseline', st_makeline(st_startpoint(scb2), st_endpoint(scb2))); + insert into wm_visuals (name, way) values('selfcrossing-1-newline', st_makeline(st_endpoint(scb1), st_endpoint(scb2))); end $$ language plpgsql;