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

Function SumTableTest

Filters/General/Testing/Python/TestSumTables.py:50–71  ·  view source on GitHub ↗
(msg, arrays1, arrays2, expected)

Source from the content-addressed store, hash-verified

48 return status
49
50def SumTableTest(msg, arrays1, arrays2, expected):
51 print(f'Testing {msg}.')
52 table1 = vtkTable()
53 table2 = vtkTable()
54 [table1.AddColumn(array) for array in arrays1]
55 [table2.AddColumn(array) for array in arrays2]
56 sumTables = vtkSumTables()
57 sumTables.SetInputDataObject(0, table1)
58 sumTables.SetInputDataObject(1, table2)
59 sumTables.Update()
60 result = sumTables.GetOutputDataObject(0)
61 for colName in ('int', 'ush'):
62 col = result.GetColumnByName(colName)
63 print(f' Column {colName} is of type {col.GetClassName()}')
64 result.Dump(10, -1, 4)
65 expectedTable = vtkTable()
66 [expectedTable.AddColumn(array) for array in expected]
67 if not CompareTables(result, expectedTable):
68 result.Dump(10, 10)
69 print(f'ERROR: Failed {msg} test.')
70 return False
71 return True
72
73ok = SumTableTest('columns of same type and signedness',
74 (

Callers 1

TestSumTables.pyFile · 0.85

Calls 10

GetColumnByNameMethod · 0.80
CompareTablesFunction · 0.70
printFunction · 0.50
vtkTableClass · 0.50
AddColumnMethod · 0.45
SetInputDataObjectMethod · 0.45
UpdateMethod · 0.45
GetOutputDataObjectMethod · 0.45
GetClassNameMethod · 0.45
DumpMethod · 0.45

Tested by

no test coverage detected