mirror of https://github.com/KLayout/klayout.git
DRC tests for 'size/sized inside
This commit is contained in:
parent
4c28d9f6a9
commit
58d53636cb
|
|
@ -2591,6 +2591,17 @@ TEST(60_sized_inside)
|
||||||
EXPECT_EQ (r.sized_inside (inside, false, 1, 2, 0).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
EXPECT_EQ (r.sized_inside (inside, false, 1, 2, 0).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
||||||
EXPECT_EQ (r.sized_inside (inside, false, 10, 20, 10).to_string (), "(-10,10;-10,80;40,80;40,10)");
|
EXPECT_EQ (r.sized_inside (inside, false, 10, 20, 10).to_string (), "(-10,10;-10,80;40,80;40,10)");
|
||||||
|
|
||||||
|
db::Region d;
|
||||||
|
d = r;
|
||||||
|
d.size_inside (inside, false, 0, 20, 10);
|
||||||
|
EXPECT_EQ (d.to_string (), "(-10,10;-10,80;30,80;30,10)");
|
||||||
|
d = r;
|
||||||
|
d.size_inside (inside, false, 1, 2, 0);
|
||||||
|
EXPECT_EQ (d.to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
||||||
|
d = r;
|
||||||
|
d.size_inside (inside, false, 10, 20, 10);
|
||||||
|
EXPECT_EQ (d.to_string (), "(-10,10;-10,80;40,80;40,10)");
|
||||||
|
|
||||||
EXPECT_EQ (r.sized_inside (db::Region (), false, 0, 40).to_string (), "");
|
EXPECT_EQ (r.sized_inside (db::Region (), false, 0, 40).to_string (), "");
|
||||||
EXPECT_EQ (r.sized_inside (db::Region (), false, 1, 0).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
EXPECT_EQ (r.sized_inside (db::Region (), false, 1, 0).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
||||||
EXPECT_EQ (r.sized_inside (db::Region (), false, 1, -1).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
EXPECT_EQ (r.sized_inside (db::Region (), false, 1, -1).to_string (), "(-10,20;-10,60;20,60;20,20);(20,20;20,60;30,60;30,20)");
|
||||||
|
|
|
||||||
|
|
@ -1911,3 +1911,14 @@ TEST(121_ShapesOfTerminal)
|
||||||
|
|
||||||
db::compare_layouts (_this, layout, au, db::NoNormalization);
|
db::compare_layouts (_this, layout, au, db::NoNormalization);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
TEST(130_size_inside_outside)
|
||||||
|
{
|
||||||
|
run_test (_this, "130", false);
|
||||||
|
}
|
||||||
|
|
||||||
|
TEST(130d_size_inside_outside)
|
||||||
|
{
|
||||||
|
run_test (_this, "130", true);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,54 @@
|
||||||
|
|
||||||
|
source $drc_test_source
|
||||||
|
target $drc_test_target
|
||||||
|
|
||||||
|
if $drc_test_deep
|
||||||
|
deep
|
||||||
|
end
|
||||||
|
|
||||||
|
l1 = input(1, 0)
|
||||||
|
l2 = input(2, 0)
|
||||||
|
|
||||||
|
l1.output(1, 0)
|
||||||
|
l2.output(2, 0)
|
||||||
|
|
||||||
|
l1.sized(0.0, steps(50), inside(l2)).output(100, 0)
|
||||||
|
l1.sized(20.0, steps(0), inside(l2)).output(101, 0)
|
||||||
|
|
||||||
|
l1.sized(20.0, steps(50), inside(l2)).output(110, 0)
|
||||||
|
l1.sized(50.0, steps(50), outside(l2)).output(111, 0)
|
||||||
|
|
||||||
|
l1d = l1.dup
|
||||||
|
l1d.size(20.0, steps(50), inside(l2))
|
||||||
|
l1d.output(120, 0)
|
||||||
|
|
||||||
|
l1d = l1.dup
|
||||||
|
l1d.size(50.0, steps(50), outside(l2))
|
||||||
|
l1d.output(121, 0)
|
||||||
|
|
||||||
|
l1.sized(10.0, 20.0, steps(50), inside(l2)).output(130, 0)
|
||||||
|
l1.sized(25.0, 50.0, steps(50), outside(l2)).output(131, 0)
|
||||||
|
|
||||||
|
error = nil
|
||||||
|
begin
|
||||||
|
l2.sized(-1.0, steps(50), outside(l2))
|
||||||
|
rescue
|
||||||
|
error = true
|
||||||
|
end
|
||||||
|
if !error
|
||||||
|
raise "error expected!"
|
||||||
|
end
|
||||||
|
|
||||||
|
error = nil
|
||||||
|
begin
|
||||||
|
l2.sized(-1.0, 2.0, steps(50), outside(l2))
|
||||||
|
rescue
|
||||||
|
error = true
|
||||||
|
end
|
||||||
|
if !error
|
||||||
|
raise "error expected!"
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Loading…
Reference in New Issue