(msg, arrays1, arrays2, expected)
| 48 | return status |
| 49 | |
| 50 | def 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 | |
| 73 | ok = SumTableTest('columns of same type and signedness', |
| 74 | ( |
no test coverage detected