mirror of
https://github.com/KLayout/klayout.git
synced 2026-09-03 08:26:27 +02:00
Enabled Windows build on Qt5.
This commit is contained in:
Vendored
+13
-4
@@ -88,6 +88,15 @@ def find_layer(ly, lp):
|
||||
return None
|
||||
|
||||
|
||||
def nh(h):
|
||||
"""
|
||||
Returns a normalized hash representation
|
||||
"""
|
||||
v = []
|
||||
for k in sorted(h):
|
||||
v.append(repr(k) + ": " + repr(h[k]))
|
||||
return "{" + (", ".join(v)) + "}"
|
||||
|
||||
class DBPCellTests(unittest.TestCase):
|
||||
|
||||
def test_1(self):
|
||||
@@ -132,12 +141,12 @@ class DBPCellTests(unittest.TestCase):
|
||||
self.assertEqual(pcell_var.pcell_id(), pcell_decl_id)
|
||||
self.assertEqual(pcell_var.pcell_library().__repr__(), lib.__repr__())
|
||||
self.assertEqual(pcell_var.pcell_parameters().__repr__(), "[<1/0>, 1.0, 1.0]")
|
||||
self.assertEqual(pcell_var.pcell_parameters_by_name().__repr__(), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(nh(pcell_var.pcell_parameters_by_name()), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(pcell_var.pcell_parameter("h").__repr__(), "1.0")
|
||||
self.assertEqual(c1.pcell_parameters(pcell_inst).__repr__(), "[<1/0>, 1.0, 1.0]")
|
||||
self.assertEqual(c1.pcell_parameters_by_name(pcell_inst).__repr__(), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(nh(c1.pcell_parameters_by_name(pcell_inst)), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(c1.pcell_parameter(pcell_inst, "h").__repr__(), "1.0")
|
||||
self.assertEqual(pcell_inst.pcell_parameters_by_name().__repr__(), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(nh(pcell_inst.pcell_parameters_by_name()), "{'h': 1.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(pcell_inst["h"].__repr__(), "1.0")
|
||||
self.assertEqual(pcell_inst["i"].__repr__(), "None")
|
||||
self.assertEqual(pcell_inst.pcell_parameter("h").__repr__(), "1.0")
|
||||
@@ -146,7 +155,7 @@ class DBPCellTests(unittest.TestCase):
|
||||
self.assertEqual(pcell_inst.pcell_declaration().__repr__(), pcell_decl.__repr__())
|
||||
|
||||
pcell_inst.change_pcell_parameter("h", 2.0)
|
||||
self.assertEqual(pcell_inst.pcell_parameters_by_name().__repr__(), "{'h': 2.0, 'l': <1/0>, 'w': 1.0}")
|
||||
self.assertEqual(nh(pcell_inst.pcell_parameters_by_name()), "{'h': 2.0, 'l': <1/0>, 'w': 1.0}")
|
||||
pcell_inst.set_property("abc", "a property")
|
||||
self.assertEqual(pcell_inst.property("abc").__repr__(), "'a property'")
|
||||
|
||||
|
||||
Vendored
+7
-7
@@ -156,8 +156,8 @@ class QtBinding_TestClass < TestBase
|
||||
|
||||
# destroying a will also destroy aa
|
||||
a.destroy
|
||||
assert_equal(a.destroyed?, true)
|
||||
assert_equal(aa.destroyed?, true)
|
||||
assert_equal(a._destroyed?, true)
|
||||
assert_equal(aa._destroyed?, true)
|
||||
|
||||
end
|
||||
|
||||
@@ -174,7 +174,7 @@ class QtBinding_TestClass < TestBase
|
||||
a = nil
|
||||
GC.start
|
||||
|
||||
assert_equal(aa.destroyed?, true)
|
||||
assert_equal(aa._destroyed?, true)
|
||||
|
||||
end
|
||||
|
||||
@@ -207,7 +207,7 @@ class QtBinding_TestClass < TestBase
|
||||
assert_equal(aa != nil, true)
|
||||
assert_equal(aa.class.to_s, "RBA::QAction")
|
||||
assert_equal(aa.text, "aatext")
|
||||
assert_equal(aa.destroyed?, false)
|
||||
assert_equal(aa._destroyed?, false)
|
||||
|
||||
end
|
||||
|
||||
@@ -569,7 +569,7 @@ class QtBinding_TestClass < TestBase
|
||||
child = parent.viewport
|
||||
|
||||
# ensure parent and child are working
|
||||
assert_equal(child.destroyed?, false)
|
||||
assert_equal(child._destroyed?, false)
|
||||
|
||||
parent.resize(200, 200)
|
||||
assert_equal(child.width() > 100, true)
|
||||
@@ -582,8 +582,8 @@ class QtBinding_TestClass < TestBase
|
||||
# now if we delete the parent, the child needs to become disconnected
|
||||
|
||||
parent._destroy()
|
||||
assert_equal(parent.destroyed?, true)
|
||||
assert_equal(child.destroyed?, true)
|
||||
assert_equal(parent._destroyed?, true)
|
||||
assert_equal(child._destroyed?, true)
|
||||
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user