Commit 70df7894 authored by Ken Martin's avatar Ken Martin
Browse files

rename java helper until Andy can clean up

parent e01cee79
......@@ -81,7 +81,7 @@ IF(JAVA_COMPILE)
ADD_DEPENDENCIES(VTKJavaImaging VTKJavaFiltering)
ADD_DEPENDENCIES(VTKJavaGraphics VTKJavaFiltering)
ADD_DEPENDENCIES(VTKJavaIO VTKJavaFiltering)
SET(VTK_JAVA_DEPENDENCIES vtkTesting vtkSettings)
SET(VTK_JAVA_DEPENDENCIES vtkTesting2 vtkSettings)
IF(VTK_USE_RENDERING)
SET(VTK_JAVA_DEPENDENCIES ${VTK_JAVA_DEPENDENCIES} vtkPanel)
ADD_DEPENDENCIES(VTKJavaRendering VTKJavaGraphics VTKJavaIO VTKJavaImaging)
......
......@@ -18,7 +18,7 @@ public class Regression
{
public static void main (String []args)
{
vtkTesting.Initialize(args);
vtkTesting2.Initialize(args);
vtkShortArray array = new vtkShortArray();
......@@ -92,7 +92,7 @@ public class Regression
vtkUnsignedCharArray nida = (vtkUnsignedCharArray)nimage.GetPointData().GetScalars();
nida.SetJavaArray(barray);
int retVal0 = vtkTesting.PASSED;
int retVal0 = vtkTesting2.PASSED;
for ( cc = 0; cc <= da.GetMaxId(); cc ++ )
{
......@@ -105,7 +105,7 @@ public class Regression
else
{
System.out.println("Cannot find point " + cc + " in nda");
retVal0 = vtkTesting.FAILED;
retVal0 = vtkTesting2.FAILED;
}
if ( cc <= nida.GetMaxId() )
{
......@@ -114,12 +114,12 @@ public class Regression
else
{
System.out.println("Cannot find point " + cc + " in nida");
retVal0 = vtkTesting.FAILED;
retVal0 = vtkTesting2.FAILED;
}
if ( v1 != v2 || v1 != v3 )
{
System.out.println("Wrong point: " + v1 + " <> " + v2 + " <> " + v3);
retVal0 = vtkTesting.FAILED;
retVal0 = vtkTesting2.FAILED;
}
}
......@@ -128,7 +128,7 @@ public class Regression
imgDiff.SetImage(image);
imgDiff.Update();
int retVal1 = vtkTesting.PASSED;
int retVal1 = vtkTesting2.PASSED;
if ( imgDiff.GetThresholdedError() != 0 )
{
System.out.println("Problem with array conversion. Image difference is: " + imgDiff.GetThresholdedError());
......@@ -142,23 +142,23 @@ public class Regression
wr.SetInput(imgDiff.GetOutput());
wr.SetFileName("diff.png");
wr.Write();
retVal1 = vtkTesting.FAILED;
retVal1 = vtkTesting2.FAILED;
}
int retVal2 = vtkTesting.RegressionTestImage(renWin, args, 10);
if ( retVal2 == vtkTesting.DO_INTERACTOR )
int retVal2 = vtkTesting2.RegressionTestImage(renWin, args, 10);
if ( retVal2 == vtkTesting2.DO_INTERACTOR )
{
iren.Start();
}
if ( retVal0 != vtkTesting.PASSED )
if ( retVal0 != vtkTesting2.PASSED )
{
vtkTesting.Exit(retVal0);
vtkTesting2.Exit(retVal0);
}
if ( retVal1 != vtkTesting.PASSED )
if ( retVal1 != vtkTesting2.PASSED )
{
vtkTesting.Exit(retVal1);
vtkTesting2.Exit(retVal1);
}
vtkTesting.Exit(retVal2);
vtkTesting2.Exit(retVal2);
}
}
......@@ -3,7 +3,7 @@ import java.io.File;
import java.util.Properties;
public class vtkTesting
public class vtkTesting2
{
public static final int FAILED = 0;
public static final int PASSED = 1;
......@@ -42,13 +42,13 @@ public class vtkTesting
int cc;
for ( cc = 0; cc < kits.length; cc ++ )
{
vtkTesting.LoadLibrary(lpath, "vtk" + kits[cc] + "Java");
vtkTesting2.LoadLibrary(lpath, "vtk" + kits[cc] + "Java");
}
}
public static void Exit(int retVal)
{
if ( retVal == vtkTesting.FAILED || retVal == vtkTesting.NOT_RUN )
if ( retVal == vtkTesting2.FAILED || retVal == vtkTesting2.NOT_RUN )
{
System.out.println("Test failed or was not run");
System.exit(1);
......@@ -59,12 +59,12 @@ public class vtkTesting
public static String ExpandDataFileName(String[] args, String path)
{
return vtkTesting.ExpandDataFileName(args, path, false);
return vtkTesting2.ExpandDataFileName(args, path, false);
}
public static String ExpandDataFileName(String[] args, String path, boolean slash)
{
return vtkTesting.ExpandFileNameWithArgOrDefault(
return vtkTesting2.ExpandFileNameWithArgOrDefault(
"-D", args,
"../../../../VTKData",
path, slash);
......@@ -100,7 +100,7 @@ public class vtkTesting
boolean slash)
{
String fullName = null;
String value = vtkTesting.GetArgOrDefault(arg, args, def);
String value = vtkTesting2.GetArgOrDefault(arg, args, def);
if (value != null)
{
fullName = value;
......@@ -136,7 +136,7 @@ public class vtkTesting
if ( args[cc].equals("-I") )
{
System.out.println("Interactive mode");
return vtkTesting.DO_INTERACTOR;
return vtkTesting2.DO_INTERACTOR;
}
if ( args[cc].equals("-D") )
{
......@@ -163,7 +163,7 @@ public class vtkTesting
else
{
System.err.println("Image path not specified");
return vtkTesting.NOT_RUN;
return vtkTesting2.NOT_RUN;
}
}
}
......@@ -172,7 +172,7 @@ public class vtkTesting
if ( !file.exists() )
{
System.err.println("File " + file.getName() + " does not exists");
return vtkTesting.NOT_RUN;
return vtkTesting2.NOT_RUN;
}
renWin.Render();
......@@ -192,7 +192,7 @@ public class vtkTesting
if (imgDiff.GetThresholdedError() <= threshold)
{
System.out.println("Java smoke test passed.");
return vtkTesting.PASSED;
return vtkTesting2.PASSED;
}
System.out.println("Java smoke test error!");
System.out.println("Image difference: " + imgDiff.GetThresholdedError());
......@@ -202,6 +202,6 @@ public class vtkTesting
wr.Write();
wr.SetFileName(data_path + "/" + image_path + ".diff.jpg");
wr.SetInput(imgDiff.GetOutput());
return vtkTesting.FAILED;
return vtkTesting2.FAILED;
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment