mirror of https://github.com/KLayout/klayout.git
Bugfix, tests updated
This commit is contained in:
parent
a752257f52
commit
13874986b2
|
|
@ -1933,6 +1933,15 @@ DeepRegion::selected_interacting_generic (const Region &other, int mode, bool to
|
||||||
return std::make_pair (clone (), (RegionDelegate *) 0);
|
return std::make_pair (clone (), (RegionDelegate *) 0);
|
||||||
}
|
}
|
||||||
} else if (other.empty ()) {
|
} else if (other.empty ()) {
|
||||||
|
if (mode > 0 /*outside*/) {
|
||||||
|
if (output_mode == PositiveAndNegative) {
|
||||||
|
return std::make_pair (clone (), new DeepRegion (deep_layer ().derived ()));
|
||||||
|
} else if (output_mode == Negative) {
|
||||||
|
return std::make_pair (new DeepRegion (deep_layer ().derived ()), (RegionDelegate *) 0);
|
||||||
|
} else {
|
||||||
|
return std::make_pair (clone (), (RegionDelegate *) 0);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
if (output_mode == PositiveAndNegative) {
|
if (output_mode == PositiveAndNegative) {
|
||||||
return std::make_pair (new DeepRegion (deep_layer ().derived ()), clone ());
|
return std::make_pair (new DeepRegion (deep_layer ().derived ()), clone ());
|
||||||
} else if (output_mode == Negative) {
|
} else if (output_mode == Negative) {
|
||||||
|
|
@ -1941,6 +1950,7 @@ DeepRegion::selected_interacting_generic (const Region &other, int mode, bool to
|
||||||
return std::make_pair (new DeepRegion (deep_layer ().derived ()), (RegionDelegate *) 0);
|
return std::make_pair (new DeepRegion (deep_layer ().derived ()), (RegionDelegate *) 0);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
bool counting = !(min_count == 1 && max_count == std::numeric_limits<size_t>::max ());
|
bool counting = !(min_count == 1 && max_count == std::numeric_limits<size_t>::max ());
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1799,7 +1799,7 @@ TEST(30a_interact_with_count_region)
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
||||||
|
|
||||||
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(0,0;0,200;100,200;100,0);(-100,-100;-100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
|
|
@ -1890,7 +1890,7 @@ TEST(30b_interact_with_count_edge)
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
||||||
|
|
||||||
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(0,0;0,200;100,200;100,0);(-100,-100;-100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
|
|
@ -1980,7 +1980,7 @@ TEST(30c_interact_with_count_text)
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_interacting (rr2, 2, 5).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
EXPECT_EQ (r.selected_interacting (rr2, 4, 5).to_string (), "");
|
||||||
|
|
||||||
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (empty).to_string (), "(0,0;0,200;100,200;100,0);(-100,-100;-100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
EXPECT_EQ (r.selected_not_interacting (rr).to_string (), "");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 0, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
EXPECT_EQ (r.selected_not_interacting (rr, 1, 2).to_string (), "(-100,-100;-100,0;0,0;0,200;100,200;100,0;0,0;0,-100)");
|
||||||
|
|
|
||||||
Binary file not shown.
Loading…
Reference in New Issue