MCPcopy Create free account
hub / github.com/Kitware/VTK / testMethods

Method testMethods

Common/Core/Testing/Python/TestOverloads.py:35–58  ·  view source on GitHub ↗

Test overloaded methods

(self)

Source from the content-addressed store, hash-verified

33class TestOverloads(Testing.vtkTest):
34
35 def testMethods(self):
36 """Test overloaded methods"""
37 # single-argument method vtkTransform::SetMatrix()
38 t = vtkTransform()
39 m = vtkMatrix4x4()
40 m.SetElement(0, 0, 2)
41 t.SetMatrix(m)
42 self.assertEqual(t.GetMatrix().GetElement(0, 0), 2)
43 t.SetMatrix([0,1,0,0, 1,0,0,0, 0,0,-1,0, 0,0,0,1])
44 self.assertEqual(t.GetMatrix().GetElement(0, 0), 0)
45 # mixed number of arguments
46 fd = vtkFieldData()
47 fa = vtkFloatArray()
48 fa.SetName("Real")
49 ia = vtkIntArray()
50 ia.SetName("Integer")
51 fd.AddArray(fa)
52 fd.AddArray(ia)
53 a = fd.GetArray("Real")
54 self.assertEqual(id(a), id(fa))
55 i = reference(0)
56 a = fd.GetArray("Integer", i)
57 self.assertEqual(id(a), id(ia))
58 self.assertEqual(i, 1)
59
60 def testConstructors(self):
61 """Test overloaded constructors"""

Callers

nothing calls this directly

Calls 13

idFunction · 0.85
referenceFunction · 0.85
vtkTransformClass · 0.50
vtkMatrix4x4Class · 0.50
vtkFieldDataClass · 0.50
vtkFloatArrayFunction · 0.50
vtkIntArrayFunction · 0.50
SetElementMethod · 0.45
SetMatrixMethod · 0.45
GetMatrixMethod · 0.45
SetNameMethod · 0.45
AddArrayMethod · 0.45

Tested by

no test coverage detected