diff --git a/Web/Core/Testing/Python/CMakeLists.txt b/Web/Core/Testing/Python/CMakeLists.txt index 17e827d3439c2217c098069fb559f91a008ca778..4856fd5dc0d6a118e8ce2745a8fa2eb6661f5135 100644 --- a/Web/Core/Testing/Python/CMakeLists.txt +++ b/Web/Core/Testing/Python/CMakeLists.txt @@ -5,4 +5,5 @@ vtk_add_test_python( vtk_add_test_python( NO_DATA NO_VALID NO_OUTPUT TestObjectIdMap.py + TestWebApplicationMemory.py ) diff --git a/Web/Core/Testing/Python/TestWebApplicationMemory.py b/Web/Core/Testing/Python/TestWebApplicationMemory.py new file mode 100644 index 0000000000000000000000000000000000000000..bafb6b6c025c42779692f256e1a1bd46e4d863a4 --- /dev/null +++ b/Web/Core/Testing/Python/TestWebApplicationMemory.py @@ -0,0 +1,33 @@ +import vtk +from vtk.test import Testing +from vtk.vtkWebCore import vtkWebApplication + +class TestWebApplicationMemory(Testing.vtkTest): + def testWebApplicationMemory(self): + cylinder = vtk.vtkCylinderSource() + cylinder.SetResolution(8) + + cylinderMapper = vtk.vtkPolyDataMapper() + cylinderMapper.SetInputConnection(cylinder.GetOutputPort()) + + cylinderActor = vtk.vtkActor() + cylinderActor.SetMapper(cylinderMapper) + cylinderActor.RotateX(30.0) + cylinderActor.RotateY(-45.0) + + ren = vtk.vtkRenderer() + renWin = vtk.vtkRenderWindow() + renWin.AddRenderer(ren) + ren.AddActor(cylinderActor) + renWin.SetSize(200, 200) + + ren.ResetCamera() + ren.GetActiveCamera().Zoom(1.5) + renWin.Render() + + webApp = vtk.vtkWebApplication() + # no memory leaks sould be reported when compiling with VTK_DEBUG_LEAKS + webApp.StillRender(renWin) + +if __name__ == "__main__": + Testing.main([(TestWebApplicationMemory, 'test')])