(String[] args)
| 12 | public class JavaDelete { |
| 13 | |
| 14 | public static void main(String[] args) { |
| 15 | try { |
| 16 | vtkJavaTesting.Initialize(args, true); |
| 17 | |
| 18 | // Start working code |
| 19 | long timeout = System.currentTimeMillis() + 60000; // +1 minute |
| 20 | while (System.currentTimeMillis() < timeout) { |
| 21 | vtkDoubleArray arr = new vtkDoubleArray(); |
| 22 | arr.Delete(); |
| 23 | |
| 24 | vtkQuadric quadric = new vtkQuadric(); |
| 25 | vtkSampleFunction sample = new vtkSampleFunction(); |
| 26 | sample.SetSampleDimensions(30, 30, 30); |
| 27 | sample.SetImplicitFunction(quadric); |
| 28 | sample.GetImplicitFunction(); |
| 29 | sample.Delete(); |
| 30 | quadric.Delete(); |
| 31 | |
| 32 | // Make sure the Java VTK object map is empty |
| 33 | if (vtkObject.JAVA_OBJECT_MANAGER.getSize() > 1) { // vtkTesting |
| 34 | System.out.println(vtkObject.JAVA_OBJECT_MANAGER.gc(true).listKeptReferenceToString()); |
| 35 | throw new RuntimeException("There shouldn't have any VTK object inside the map as we are using Delete()."); |
| 36 | } |
| 37 | } |
| 38 | |
| 39 | vtkJavaTesting.Exit(vtkJavaTesting.PASSED); |
| 40 | } catch (Throwable e) { |
| 41 | e.printStackTrace(); |
| 42 | vtkJavaTesting.Exit(vtkJavaTesting.FAILED); |
| 43 | } |
| 44 | } |
| 45 | } |
nothing calls this directly
no test coverage detected