mirror of https://github.com/KLayout/klayout.git
WIP: bugfix, RBA tests.
This commit is contained in:
parent
3e249b0b54
commit
91de370901
|
|
@ -502,10 +502,10 @@ void
|
|||
LayerMap::mmap (const LayerProperties &f, unsigned int l)
|
||||
{
|
||||
if (f.name.empty () || is_static_ld (f.layer) || is_static_ld (f.datatype)) {
|
||||
map (db::LDPair (f.layer, f.datatype), l);
|
||||
mmap (db::LDPair (f.layer, f.datatype), l);
|
||||
}
|
||||
if (! f.name.empty ()) {
|
||||
map (f.name, l);
|
||||
mmap (f.name, l);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -525,10 +525,10 @@ void
|
|||
LayerMap::mmap (const LayerProperties &f, unsigned int l, const LayerProperties &t)
|
||||
{
|
||||
if (f.name.empty () || is_static_ld (f.layer) || is_static_ld (f.datatype)) {
|
||||
map (db::LDPair (f.layer, f.datatype), l, t);
|
||||
mmap (db::LDPair (f.layer, f.datatype), l, t);
|
||||
}
|
||||
if (! f.name.empty ()) {
|
||||
map (f.name, l, t);
|
||||
mmap (f.name, l, t);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -30,7 +30,11 @@ class DBLayout_TestClass < TestBase
|
|||
lmap = RBA::LayerMap::new
|
||||
|
||||
lmap.map( "1/0", 0 )
|
||||
assert_equal(lmap.is_mapped(RBA::LayerInfo::new(1, 0)), true)
|
||||
assert_equal(lmap.is_mapped(RBA::LayerInfo::new(1, 1)), false)
|
||||
assert_equal(lmap.is_mapped(RBA::LayerInfo::new(2, 2)), false)
|
||||
lmap.map( "2/2", 0 )
|
||||
assert_equal(lmap.is_mapped(RBA::LayerInfo::new(2, 2)), true)
|
||||
lmap.map( "10/2", 0 )
|
||||
assert_equal( lmap.mapping_str(0), "1/0;2/2;10/2" )
|
||||
|
||||
|
|
@ -86,6 +90,55 @@ class DBLayout_TestClass < TestBase
|
|||
assert_equal( lmap.mapping(0).to_s, "4/4" )
|
||||
assert_equal( lmap.mapping(2).to_s, "5/5" )
|
||||
|
||||
lmap = RBA::LayerMap::new
|
||||
|
||||
lmap.map("*/*", 0)
|
||||
lmap.unmap(RBA::LayerInfo::new(5, 10))
|
||||
assert_equal(lmap.mapping_str(0), "0-4/*;5/0-9,11-*;6-*/*")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.unmap(RBA::LayerInfo::new(5, 10), RBA::LayerInfo::new(16, 21))
|
||||
assert_equal(lmap.mapping_str(0), "0-4/*;5-16/0-9,22-*;17-*/*")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.unmap("5-16/10-21")
|
||||
assert_equal(lmap.mapping_str(0), "0-4/*;5-16/0-9,22-*;17-*/*")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.mmap(RBA::LayerInfo::new(5, 10), 1)
|
||||
assert_equal(lmap.mapping_str(0), "+0-4/*;5/0-9,10,11-*;6-*/*")
|
||||
assert_equal(lmap.mapping_str(1), "+5/10")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.mmap(RBA::LayerInfo::new(5, 10), 1, RBA::LayerInfo::new(100, 0))
|
||||
assert_equal(lmap.mapping_str(0), "+0-4/*;5/0-9,10,11-*;6-*/*")
|
||||
assert_equal(lmap.mapping_str(1), "+5/10 : 100/0")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.mmap(RBA::LayerInfo::new(5, 10), RBA::LayerInfo::new(16, 21), 1)
|
||||
assert_equal(lmap.mapping_str(0), "+0-4/*;5-16/0-9,10-21,22-*;17-*/*")
|
||||
assert_equal(lmap.mapping_str(1), "+5-16/10-21")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.mmap(RBA::LayerInfo::new(5, 10), RBA::LayerInfo::new(16, 21), 1, RBA::LayerInfo::new(100, 0))
|
||||
assert_equal(lmap.mapping_str(0), "+0-4/*;5-16/0-9,10-21,22-*;17-*/*")
|
||||
assert_equal(lmap.mapping_str(1), "+5-16/10-21 : 100/0")
|
||||
|
||||
lmap.clear
|
||||
lmap.map("*/*", 0)
|
||||
lmap.mmap("5-16/10-21", 1)
|
||||
assert_equal(lmap.mapping_str(0), "+0-4/*;5-16/0-9,10-21,22-*;17-*/*")
|
||||
assert_equal(lmap.mapping_str(1), "+5-16/10-21")
|
||||
|
||||
assert_equal(lmap.logicals(RBA::LayerInfo::new(5, 10)), [ 0, 1 ])
|
||||
assert_equal(lmap.logicals(RBA::LayerInfo::new(0, 10)), [ 0 ])
|
||||
|
||||
end
|
||||
|
||||
def test_2
|
||||
|
|
|
|||
Loading…
Reference in New Issue