From 8c4013c50042b82906e65b771a861ccae4bf5384 Mon Sep 17 00:00:00 2001 From: Matthias Koefferlein Date: Wed, 15 Feb 2017 01:15:47 +0100 Subject: [PATCH] Added some more unit tests. --- src/unit_tests/dbRecursiveShapeIterator.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/unit_tests/dbRecursiveShapeIterator.cc b/src/unit_tests/dbRecursiveShapeIterator.cc index 4dcb94f4b..974376932 100644 --- a/src/unit_tests/dbRecursiveShapeIterator.cc +++ b/src/unit_tests/dbRecursiveShapeIterator.cc @@ -447,6 +447,8 @@ TEST(3) EXPECT_EQ (x, "[$3](1000,-500;2000,500)/[$3](1000,1500;2000,2500)/[$3](4000,500;5000,1500)/[$3](4000,2500;5000,3500)/[$3](1000,5500;2000,6500)/[$3](1000,7500;2000,8500)/[$3](4000,6500;5000,7500)/[$3](4000,8500;5000,9500)/[$3](7000,-500;8000,500)/[$3](7000,1500;8000,2500)/[$3](10000,500;11000,1500)/[$3](10000,2500;11000,3500)/[$3](7000,5500;8000,6500)/[$3](7000,7500;8000,8500)/[$3](10000,6500;11000,7500)/[$3](10000,8500;11000,9500)"); db::RecursiveShapeIterator i2 (g, c0, 0, db::Region (db::Box (3400, 3450, 5600, 6500))); + EXPECT_EQ (i2.has_complex_region (), false); + EXPECT_EQ (i2.region ().to_string (), "(3400,3450;5600,6500)"); x = collect(i2, g); EXPECT_EQ (x, "[$3](4000,2500;5000,3500)/[$3](4000,6500;5000,7500)"); @@ -475,6 +477,9 @@ TEST(3) rro.insert (db::Box (6650, 5300, 10000, 7850)); db::RecursiveShapeIterator i23o (g, c0, 0, rro, true); + EXPECT_EQ (i23o.has_complex_region (), true); + EXPECT_EQ (i23o.complex_region ().to_string (), "(3400,3450;3400,6500;5600,6500;5600,3450);(6650,5300;6650,7850;10000,7850;10000,5300)"); + db::RecursiveShapeIterator i23ocopy = i23o; x = collect(i23o, g);