mirror of https://github.com/KLayout/klayout.git
Bugfixes
This commit is contained in:
parent
ff2beaf32f
commit
5045287712
|
|
@ -37,14 +37,6 @@ namespace gsi
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// db::Library binding
|
// db::Library binding
|
||||||
|
|
||||||
/**
|
|
||||||
* @brief A basic implementation of the library
|
|
||||||
*/
|
|
||||||
static db::Library *new_lib ()
|
|
||||||
{
|
|
||||||
return new db::Library ();
|
|
||||||
}
|
|
||||||
|
|
||||||
static db::Library *library_by_name (const std::string &name, const std::string &for_technology)
|
static db::Library *library_by_name (const std::string &name, const std::string &for_technology)
|
||||||
{
|
{
|
||||||
return db::LibraryManager::instance ().lib_ptr_by_name (name, for_technology);
|
return db::LibraryManager::instance ().lib_ptr_by_name (name, for_technology);
|
||||||
|
|
@ -135,7 +127,10 @@ class LibraryImpl
|
||||||
: public db::Library
|
: public db::Library
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
LibraryImpl () : db::Library () { }
|
LibraryImpl () : db::Library ()
|
||||||
|
{
|
||||||
|
// .. nothing yet ..
|
||||||
|
}
|
||||||
|
|
||||||
virtual std::string reload ()
|
virtual std::string reload ()
|
||||||
{
|
{
|
||||||
|
|
@ -151,6 +146,15 @@ public:
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static LibraryImpl *new_lib ()
|
||||||
|
{
|
||||||
|
return new LibraryImpl ();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief A basic implementation of the library
|
||||||
|
*/
|
||||||
|
|
||||||
LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
||||||
gsi::method ("library_by_name", &library_by_name, gsi::arg ("name"), gsi::arg ("for_technology", std::string (), "unspecific"),
|
gsi::method ("library_by_name", &library_by_name, gsi::arg ("name"), gsi::arg ("for_technology", std::string (), "unspecific"),
|
||||||
"@brief Gets a library by name\n"
|
"@brief Gets a library by name\n"
|
||||||
|
|
@ -289,6 +293,10 @@ LibraryClass<db::Library> decl_Library ("db", "LibraryBase",
|
||||||
"@hide"
|
"@hide"
|
||||||
);
|
);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @brief The reimplementation stub
|
||||||
|
*/
|
||||||
|
|
||||||
LibraryClass<LibraryImpl> decl_LibraryImpl (decl_Library, "db", "Library",
|
LibraryClass<LibraryImpl> decl_LibraryImpl (decl_Library, "db", "Library",
|
||||||
gsi::constructor ("new", &new_lib,
|
gsi::constructor ("new", &new_lib,
|
||||||
"@brief Creates a new, empty library"
|
"@brief Creates a new, empty library"
|
||||||
|
|
|
||||||
|
|
@ -45,14 +45,17 @@ class DBLibrary_TestClass < TestBase
|
||||||
assert_equal(RBA::Library::library_names.member?("RBA-unit-test"), 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
|
# The library reference is kept internally
|
||||||
lib._destroy
|
lib = nil
|
||||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test").id, lib_id)
|
GC.start
|
||||||
assert_equal(lib.destroyed?, true)
|
GC.start
|
||||||
|
|
||||||
lib = RBA::Library::library_by_name("RBA-unit-test")
|
lib = RBA::Library::library_by_name("RBA-unit-test")
|
||||||
assert_equal(lib.destroyed?, false)
|
assert_equal(lib.name, "RBA-unit-test")
|
||||||
lib.delete
|
|
||||||
|
lib._destroy
|
||||||
|
assert_equal(lib.destroyed?, true)
|
||||||
|
|
||||||
assert_equal(RBA::Library::library_by_name("RBA-unit-test"), nil)
|
assert_equal(RBA::Library::library_by_name("RBA-unit-test"), nil)
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
@ -101,6 +104,13 @@ class DBLibrary_TestClass < TestBase
|
||||||
lib._destroy
|
lib._destroy
|
||||||
assert_equal(lib.destroyed?, true)
|
assert_equal(lib.destroyed?, true)
|
||||||
|
|
||||||
|
end
|
||||||
|
|
||||||
|
def test_4_library_registration
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue