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

Method main

Wrapping/Java/Testing/Java/vtk/test/JavaDelete.java:14–44  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

12public 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}

Callers

nothing calls this directly

Calls 7

SetSampleDimensionsMethod · 0.95
ExitMethod · 0.80
DeleteMethod · 0.65
getSizeMethod · 0.65
gcMethod · 0.65
InitializeMethod · 0.45

Tested by

no test coverage detected