mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-08 12:13:41 +02:00
Fixed an internal error happening when a librrary isn't registered and destroyed by the GC
This commit is contained in:
Vendored
+14
-2
@@ -35,11 +35,19 @@ class DBLibrary_TestClass < TestBase
|
||||
lib.register("RBA-unit-test")
|
||||
|
||||
assert_equal(lib.name, "RBA-unit-test")
|
||||
assert_equal(lib.id != 0, true)
|
||||
lib_id = lib.id
|
||||
assert_equal(lib_id != 0, true)
|
||||
|
||||
assert_equal(RBA::Library::library_names.member?("RBA-unit-test"), true)
|
||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test").id, lib.id)
|
||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test").id, lib_id)
|
||||
|
||||
# destroy should not do anything as libraries are not to be removed through the destructor
|
||||
lib._destroy
|
||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test").id, lib_id)
|
||||
assert_equal(lib.destroyed?, true)
|
||||
|
||||
lib = RBA::Library::library_by_name("RBA-unit-test")
|
||||
assert_equal(lib.destroyed?, false)
|
||||
lib.delete
|
||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test"), nil)
|
||||
|
||||
@@ -85,6 +93,10 @@ class DBLibrary_TestClass < TestBase
|
||||
lib.layout.create_cell("X")
|
||||
assert_equal(lib.layout.top_cell.name, "X")
|
||||
|
||||
# this will actually destroy the library as it is not registered
|
||||
lib._destroy
|
||||
assert_equal(lib.destroyed?, true)
|
||||
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user