Files
secondo/Tests/Testspecs/realminize.test
2026-01-23 17:03:45 +08:00

185 lines
6.7 KiB
Plaintext

#setup realminize
create database rtest;
open database rtest;
# #############################################
# simple tests, only single pairs of segments
# #############################################
# non - vertical segments
# #############################################
# #############################################
# overlappings
# #############################################
# connected, result should contain 2 segments
#testcase simple connected
#yields (line ( (10.0 10.0 20.0 20.0) (20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 20.0 20.0)
(20.0 20.0 30.0 30.0)
)]);
# overlapping, result should have one segment
#testcase overlap1
#yields (line ((10.0 10.0 20.0 20.0)(20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 20.0 20.0)
(15.0 15.0 30.0 30.0)
)]);
# overlapping, the same start point
#testcase overlap2
#yields (line ((10.0 10.0 20.0 20.0)(20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 20.0 20.0)
(10.0 10.0 30.0 30.0)
)]);
# overlapping, same endpoint
#testcase overlap3
#yields (line ((10.0 10.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(15.0 15.0 30.0 30.0)
)]);
# one segment is part of the other one
#testcase overlap3
#yields (line ((10.0 10.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(15.0 15.0 20.0 20.0)
)]);
# ##############################################
# crossings
# #############################################
# same x coordinates of start and endpoints
#testcase crossings1
#yields (line ((10.0 10.0 20.0 20.0) (10.0 30.0 20.0 20.0) (20.0 20.0 30.0 10.0) (20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(10.0 30.0 30.0 10.0)
)]);
# different start and end x coordinates
#testcase crossings2
#yields (line ((10.0 10.0 20.0 20.0) (15.0 30.0 20.0 20.0) (20.0 20.0 25.0 10.0) (20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(15.0 30.0 25.0 10.0)
)]);
# branch
#testcase branch
#yields (line ((10.0 10.0 15.0 15.0) (15.0 15.0 30.0 10.0) (15.0 15.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(15.0 15.0 30.0 10.0)
)]);
#####################################################
# more than 2 segments
#####################################################
#testcase connected and overlap
#yields (line ( (10.0 10.0 20.0 20.0)(20.0 20.0 25.0 25.0)(25.0 25.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 20.0 20.0)
(20.0 20.0 30.0 30.0)
(15.0 15.0 25.0 25.0)
)]);
# several segments meets within a single point
#testcase star
#yields (line ( (5.0 30.0 20.0 20.0) (10.0 10.0 20.0 20.0) (20.0 20.0 30.0 30.0) (20.0 20.0 40.0 50.0)))
query realminize( [const line value (
(5.0 30.0 20.0 20.0)
(10.0 10 20.0 20.0)
(20.0 20.0 30.0 30.0)
(20.0 20.0 40.0 50.0)
)]);
#testcase triangle
#tolerance_real 0.000001
#yields (line ( (10.0 10.0 16.66666666666667 16.66666666666667) (10.0 20.0 15.0 20.0) (10.0 30.0 15.0 20.0) (15.0 20.0 16.66666666666667 16.66666666666666) (15.0 20.0 20.0 20.0) (16.66666666666667 16.66666666666666 20.0 10.0) (16.66666666666667 16.66666666666667 20.0 20.0) (20.0 20.0 30.0 20.0) (20.0 20.0 30.0 30.0)))
query realminize( [const line value (
(10.0 10.0 30.0 30.0)
(10.0 30.0 20.0 10.0)
(10.0 20.0 30.0 20.0)
)]);
#testcase star
#tolerance real 0.000001
#yields (line ( (10.0 10.0 50.0 50.0) (10.0 50.0 50.0 50.0) (10.0 90.0 50.0 50.0) (50.0 50.0 90.0 10.0) (50.0 50.0 90.0 50.0) (50.0 50.0 90.0 90.0)))
query realminize([const line value(
(10.0 10.0 90.0 90.0)
(10.0 90.0 90.0 10.0)
(10.0 50.0 90.0 50.0)
)]);
#testcase star and vertical
#yields (line ( (10.0 10.0 50.0 50.0) (10.0 50.0 50.0 50.0) (10.0 90.0 50.0 50.0) (50.0 10.0 50.0 50.0) (50.0 50.0 90.0 10.0) (50.0 50.0 90.0 50.0) (50.0 50.0 90.0 90.0) (50.0 50.0 50.0 90.0)))
query realminize([const line value(
(10.0 10.0 90.0 90.0)
(10.0 90.0 90.0 10.0)
(10.0 50.0 90.0 50.0)
(50.0 10 50.0 90.0)
)]);
#testcase star and several verticals
#yields (line ( (10.0 10.0 30.0 30.0) (10.0 50.0 30.0 50.0) (10.0 90.0 30.0 70.0) (30.0 10.0 30.0 30.0) (30.0 30.0 50.0 50.0) (30.0 30.0 30.0 50.0) (30.0 50.0 50.0 50.0) (30.0 50.0 30.0 70.0) (30.0 70.0 50.0 50.0) (30.0 70.0 30.0 90.0) (50.0 10.0 50.0 50.0) (50.0 50.0 80.0 20.0) (50.0 50.0 80.0 50.0) (50.0 50.0 80.0 80.0) (50.0 50.0 50.0 90.0) (80.0 10.0 80.0 20.0) (80.0 20.0 90.0 10.0) (80.0 20.0 80.0 50.0) (80.0 50.0 90.0 50.0) (80.0 50.0 80.0 80.0) (80.0 80.0 90.0 90.0) (80.0 80.0 80.0 90.0)))
query realminize([const line value(
(10.0 10.0 90.0 90.0)
(10.0 90.0 90.0 10.0)
(10.0 50.0 90.0 50.0)
(30.0 10 30.0 90.0)
(80.0 10 80.0 90.0)
(50.0 10 50.0 90.0)
)])
#testcase star with overlaps
#yields (line ( (10.0 10.0 30.0 30.0) (10.0 50.0 30.0 50.0) (10.0 90.0 30.0 70.0) (30.0 10.0 30.0 30.0) (30.0 30.0 50.0 50.0) (30.0 30.0 30.0 50.0) (30.0 50.0 50.0 50.0) (30.0 50.0 30.0 70.0) (30.0 70.0 50.0 50.0) (30.0 70.0 30.0 90.0) (50.0 10.0 50.0 50.0) (50.0 50.0 80.0 20.0) (50.0 50.0 80.0 50.0) (50.0 50.0 80.0 80.0) (50.0 50.0 50.0 90.0) (80.0 10.0 80.0 20.0) (80.0 20.0 90.0 10.0) (80.0 20.0 80.0 50.0) (80.0 50.0 90.0 50.0) (80.0 50.0 80.0 80.0) (80.0 80.0 90.0 90.0) (80.0 80.0 80.0 90.0) (90.0 90.0 100.0 100.0)))
query realminize([const line value(
(10.0 10.0 90.0 90.0)
(30.0 30.0 100.0 100.0)
(10.0 90.0 90.0 10.0)
(20.0 80.0 80.0 20.0)
(10.0 50.0 90.0 50.0)
(20.0 50.0 80.0 50.0)
(30.0 10.0 30.0 90.0)
(30.0 20.0 30.0 80.0)
(80.0 10.0 80.0 90.0)
(80.0 10.0 80.0 90.0)
(50.0 10.0 50.0 90.0)
(50.0 20.0 50.0 120.0)
)])
#teardown
close database;
delete database rtest;