Skip to content
Snippets Groups Projects
Commit 89a1622f authored by Christos Tsolakis's avatar Christos Tsolakis
Browse files

vtkWebApplication Add test to expose memory leak

parent 63fe2ed8
No related branches found
No related tags found
No related merge requests found
......@@ -5,4 +5,5 @@ vtk_add_test_python(
vtk_add_test_python(
NO_DATA NO_VALID NO_OUTPUT
TestObjectIdMap.py
TestWebApplicationMemory.py
)
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')])
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment