MCPcopy Create free account
hub / github.com/KLayout/klayout / test_20

Method test_20

testdata/ruby/layLayoutView.rb:626–697  ·  view source on GitHub ↗

layout handles

Source from the content-addressed store, hash-verified

624
625 # layout handles
626 def test_20
627
628 name = "LayoutViewTest::test_20"
629
630 hh = RBA::LayoutHandle.find("DOESNOTEXIST???")
631 assert_equal(hh == nil, true)
632
633 h = RBA::LayoutHandle::new
634 assert_equal(h.is_valid?, false)
635
636 lv = RBA::LayoutView::new(true)
637
638 ly = RBA::Layout::new
639 hh = RBA::LayoutHandle.find(ly) # not yet
640 assert_equal(hh == nil, true)
641
642 ly.create_cell("TOPCELL")
643
644 h = RBA::LayoutHandle::new(ly)
645 assert_equal(h.is_valid?, true)
646 h.name = name
647 assert_equal(h.name, name)
648 assert_equal(RBA::LayoutHandle.names.member?(name), true)
649 hh = RBA::LayoutHandle.find(name)
650 assert_equal(hh.name, name)
651 hh._destroy
652 hh = RBA::LayoutHandle.find(ly)
653 assert_equal(hh.name, name)
654 hh._destroy
655 assert_equal(h.filename, "")
656 assert_equal(h.ref_count, 1)
657 assert_equal(h.is_dirty?, false)
658 assert_equal(h.layout.top_cell.name, "TOPCELL")
659
660 # smoke test
661 assert_equal(h.save_options, nil)
662 assert_equal(h.load_options.class, RBA::LoadLayoutOptions)
663
664 l1 = ly.layer(1, 0)
665 ly.top_cell.shapes(l1).insert(RBA::Box::new(0, 0, 1000, 2000))
666 assert_equal(h.is_dirty?, true)
667
668 hh = RBA::LayoutHandle::find(ly)
669 assert_equal(hh.name, name)
670 assert_equal(hh.layout.top_cell.name, "TOPCELL")
671 hh._destroy
672
673 lv.show_layout(h, true)
674 assert_equal(h.ref_count, 2)
675
676 hh = RBA::LayoutHandle::find(name)
677 assert_equal(hh.name, name)
678 assert_equal(hh.layout.top_cell.name, "TOPCELL")
679 hh._destroy
680
681 cv = lv.cellview(0)
682 hh = cv.layout_handle
683 assert_equal(hh.name, name)

Callers

nothing calls this directly

Calls 11

namesMethod · 0.80
cellviewMethod · 0.80
erase_cellviewMethod · 0.80
findMethod · 0.45
create_cellMethod · 0.45
nameMethod · 0.45
filenameMethod · 0.45
ref_countMethod · 0.45
layoutMethod · 0.45
layerMethod · 0.45
insertMethod · 0.45

Tested by

no test coverage detected