Commit 3f83fd54 authored by David Doria's avatar David Doria
Browse files

ENH: added Test prefix to most of the Common tests

parent 8d8e5d65
SET(KIT Common)
CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx
ObjectFactory.cxx
TestObjectFactory.cxx
otherArrays.cxx
otherTimerLog.cxx
otherLookupTable.cxx
......@@ -25,7 +25,7 @@ CREATE_TEST_SOURCELIST(Tests ${KIT}CxxTests.cxx
TestUnicodeStringArrayAPI.cxx
TestVariantComparison.cxx
TestWeakPointer.cxx
SystemInformation.cxx
TestSystemInformation.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......@@ -81,17 +81,17 @@ ENDIF(CYGWIN)
IF(VTK_USE_N_WAY_ARRAYS)
CREATE_TEST_SOURCELIST(ArrayTests ArrayCxxTests.cxx
ArrayAPI.cxx
ArrayAPIConvenience.cxx
ArrayAPIDense.cxx
ArrayAPISparse.cxx
ArrayBool.cxx
ArrayInterpolationDense.cxx
ArrayNullValues.cxx
ArrayExtents.cxx
ArrayUserTypes.cxx
ArrayVariants.cxx
SparseArrayValidation.cxx
TestArrayAPI.cxx
TestArrayAPIConvenience.cxx
TestArrayAPIDense.cxx
TestArrayAPISparse.cxx
TestArrayBool.cxx
TestArrayInterpolationDense.cxx
TestArrayNullValues.cxx
TestArrayExtents.cxx
TestArrayUserTypes.cxx
TestArrayVariants.cxx
TestSparseArrayValidation.cxx
EXTRA_INCLUDE vtkTestDriver.h
)
......@@ -107,9 +107,9 @@ IF(VTK_USE_N_WAY_ARRAYS)
ENDFOREACH(test)
IF(VTK_USE_BOOST)
ADD_EXECUTABLE(ArrayCasting ArrayCasting.cxx)
TARGET_LINK_LIBRARIES(ArrayCasting vtkCommon)
ADD_TEST(Array-ArrayCasting ${CXX_TEST_PATH}/ArrayCasting)
ADD_EXECUTABLE(TestArrayCasting TestArrayCasting.cxx)
TARGET_LINK_LIBRARIES(TestArrayCasting vtkCommon)
ADD_TEST(Array-TestArrayCasting ${CXX_TEST_PATH}/TestArrayCasting)
ENDIF()
ENDIF(VTK_USE_N_WAY_ARRAYS)
......
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayAPI.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -37,7 +37,7 @@
} \
}
int ArrayAPI(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayAPI(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -95,14 +95,14 @@ int ArrayAPI(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
test_expression(array->GetVariantValue(5) == sample_values[value_type]);
}
}
// Do some spot-checking to see that the actual type matches what we expect ...
// Do some spot-checking to see that the actual type matches what we expect ...
array.TakeReference(vtkArray::CreateArray(vtkArray::DENSE, VTK_DOUBLE));
test_expression(vtkDenseArray<double>::SafeDownCast(array));
array.TakeReference(vtkArray::CreateArray(vtkArray::SPARSE, VTK_STRING));
test_expression(vtkSparseArray<vtkStdString>::SafeDownCast(array));
return 0;
}
catch(vtkstd::exception& e)
......@@ -111,4 +111,3 @@ int ArrayAPI(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayAPIConvenience.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -36,7 +36,7 @@
} \
}
int ArrayAPIConvenience(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayAPIConvenience(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -46,27 +46,27 @@ int ArrayAPIConvenience(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
a->Resize(5);
b->Resize(vtkArrayExtents(5));
test_expression(a->GetExtents() == b->GetExtents());
a->SetValue(2, 3);
b->SetValue(vtkArrayCoordinates(2), 3);
test_expression(a->GetValue(2) == b->GetValue(vtkArrayCoordinates(2)));
test_expression(a->GetValue(2) == b->GetValue(vtkArrayCoordinates(2)));
a->Resize(5, 6);
b->Resize(vtkArrayExtents(5, 6));
test_expression(a->GetExtents() == b->GetExtents());
test_expression(a->GetExtents() == b->GetExtents());
a->SetValue(2, 3, 4);
b->SetValue(vtkArrayCoordinates(2, 3), 4);
test_expression(a->GetValue(2, 3) == b->GetValue(vtkArrayCoordinates(2, 3)));
test_expression(a->GetValue(2, 3) == b->GetValue(vtkArrayCoordinates(2, 3)));
a->Resize(5, 6, 7);
b->Resize(vtkArrayExtents(5, 6, 7));
test_expression(a->GetExtents() == b->GetExtents());
test_expression(a->GetExtents() == b->GetExtents());
a->SetValue(2, 3, 4, 5);
b->SetValue(vtkArrayCoordinates(2, 3, 4), 5);
test_expression(a->GetValue(2, 3, 4) == b->GetValue(vtkArrayCoordinates(2, 3, 4)));
test_expression(a->GetValue(2, 3, 4) == b->GetValue(vtkArrayCoordinates(2, 3, 4)));
return 0;
}
catch(vtkstd::exception& e)
......@@ -75,4 +75,3 @@ int ArrayAPIConvenience(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayAPIDense.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -36,7 +36,7 @@
} \
}
int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -44,7 +44,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
vtkSmartPointer<vtkDenseArray<double> > array = vtkSmartPointer<vtkDenseArray<double> >::New();
array->Resize(vtkArrayExtents::Uniform(3, 0));
test_expression(array);
// Test to ensure that casting works correctly ...
test_expression(vtkTypedArray<double>::SafeDownCast(array));
test_expression(vtkArray::SafeDownCast(array));
......@@ -126,7 +126,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
// Test unordered access ...
for(vtkIdType n = 0; n != array->GetNonNullSize(); ++n)
test_expression(array->GetValueN(n) == 19700827);
// Verify that deep-copy works correctly ...
vtkSmartPointer<vtkDenseArray<double> > deep_copy;
deep_copy.TakeReference(vtkDenseArray<double>::SafeDownCast(array->DeepCopy()));
......@@ -156,7 +156,7 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
array->ExternalStorage(vtkArrayExtents(2, 2), new vtkDenseArray<double>::StaticMemoryBlock(b));
test_expression(array->GetValue(0, 0) == 5);
test_expression(array->GetValue(1, 0) == 6);
return 0;
}
catch(vtkstd::exception& e)
......@@ -165,4 +165,3 @@ int ArrayAPIDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayAPISparse.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -31,7 +31,7 @@
throw vtkstd::runtime_error("Expression failed: " #expression); \
}
int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -39,7 +39,7 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
vtkSmartPointer<vtkSparseArray<double> > array = vtkSmartPointer<vtkSparseArray<double> >::New();
array->Resize(vtkArrayExtents::Uniform(3, 0));
test_expression(array);
// Test to ensure that casting works correctly ...
test_expression(vtkTypedArray<double>::SafeDownCast(array));
test_expression(vtkArray::SafeDownCast(array));
......@@ -123,7 +123,7 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
// Verify that deep-copy works correctly ...
array->SetNullValue(1.0);
vtkSmartPointer<vtkSparseArray<double> > deep_copy;
deep_copy.TakeReference(vtkSparseArray<double>::SafeDownCast(array->DeepCopy()));
test_expression(deep_copy->GetDimensions() == array->GetDimensions());
......@@ -146,7 +146,7 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
array->SetValue(vtkArrayCoordinates(0, 1, 2), 1.1);
array->SetValue(vtkArrayCoordinates(1, 2, 3), 2.2);
array->SetValue(vtkArrayCoordinates(0, 1, 1), 3.3);
test_expression(array->GetSize() == 24);
test_expression(array->GetNonNullSize() == 3);
test_expression(array->GetValue(vtkArrayCoordinates(0, 1, 2)) == 1.1);
......@@ -161,4 +161,3 @@ int ArrayAPISparse(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayBool.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -37,7 +37,7 @@
} \
}
int ArrayBool(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayBool(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -50,7 +50,7 @@ int ArrayBool(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
test_expression(dense->GetValue(1, 1) == 0);
dense->SetValue(1, 1, 1);
test_expression(dense->GetValue(1, 1) == 1);
test_expression(dense->GetValue(0, 1) == 0);
test_expression(dense_ref[vtkArrayCoordinates(0, 1)] == 0);
dense_ref[vtkArrayCoordinates(0, 1)] = 1;
......@@ -64,7 +64,7 @@ int ArrayBool(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
test_expression(sparse->GetValue(1, 1) == 0);
sparse->SetValue(1, 1, 1);
test_expression(sparse->GetValue(1, 1) == 1);
return 0;
}
catch(vtkstd::exception& e)
......@@ -73,4 +73,3 @@ int ArrayBool(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayExtents.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -37,7 +37,7 @@
} \
}
int ArrayExtents(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayExtents(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -79,4 +79,3 @@ int ArrayExtents(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayInterpolationDense.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -32,7 +32,7 @@ void test_expression(const bool expression, const vtkstd::string& message)
throw vtkstd::runtime_error(message);
}
int ArrayInterpolationDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayInterpolationDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -82,4 +82,3 @@ int ArrayInterpolationDense(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayNullValues.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -37,20 +37,20 @@ void VerifyType(const T& DefaultNull, const T& AlternateNull)
{
throw vtkstd::runtime_error("Incorrect default NULL value for " + vtkstd::string(array->GetClassName()));
}
// Verify that GetValue() returns the default NULL value for NULL elements ...
if(array->GetValue(1) != DefaultNull)
{
throw vtkstd::runtime_error("Empty value did not return default NULL for " + vtkstd::string(array->GetClassName()));
}
// Verify that we can override the default NULL value ...
array->SetNullValue(AlternateNull);
if(array->GetNullValue() != AlternateNull)
{
throw vtkstd::runtime_error("Error overriding NULL value for " + vtkstd::string(array->GetClassName()));
}
// Verify that GetValue() returns the alternate NULL value forr NULL elements ...
if(array->GetValue(1) != AlternateNull)
{
......@@ -58,7 +58,7 @@ void VerifyType(const T& DefaultNull, const T& AlternateNull)
}
}
int ArrayNullValues(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayNullValues(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -72,7 +72,7 @@ int ArrayNullValues(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
VerifyType<vtkTypeFloat64>(0.0, 1);
VerifyType<vtkIdType>(0, 1);
VerifyType<vtkStdString>(vtkStdString(""), vtkStdString("foo"));
return 0;
}
catch(vtkstd::exception& e)
......@@ -81,4 +81,3 @@ int ArrayNullValues(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayUserTypes.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -72,7 +72,7 @@ inline vtkVariant vtkVariantCreate<UserType>(const UserType& value)
return vtkVariant(value.Value);
}
int ArrayUserTypes(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayUserTypes(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -113,4 +113,3 @@ int ArrayUserTypes(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: ArrayVariants.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -36,7 +36,7 @@
} \
}
int ArrayVariants(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestArrayVariants(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -75,4 +75,3 @@ int ArrayVariants(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -102,7 +102,7 @@ void TestNewPoints(vtkPoints* v, const char* expectedClassName)
}
int ObjectFactory(int, char *[])
int TestObjectFactory(int, char *[])
{
vtkOutputWindow::GetInstance()->PromptUserOff();
vtkGenericWarningMacro("Test Generic Warning");
......
......@@ -2,7 +2,7 @@
Program: Visualization Toolkit
Module: SparseArrayValidation.cxx
-------------------------------------------------------------------------
Copyright 2008 Sandia Corporation.
Under the terms of Contract DE-AC04-94AL85000 with Sandia Corporation,
......@@ -32,7 +32,7 @@
throw vtkstd::runtime_error("Expression failed: " #expression); \
}
int SparseArrayValidation(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
int TestSparseArrayValidation(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
{
try
{
......@@ -68,4 +68,3 @@ int SparseArrayValidation(int vtkNotUsed(argc), char *vtkNotUsed(argv)[])
return 1;
}
}
......@@ -64,15 +64,15 @@ void vtkSystemInformationPrintFile(const char* name, ostream& os)
}
}
int SystemInformation(int,char *[])
int TestSystemInformation(int,char *[])
{
const char* files[] =
{
CMAKE_BINARY_DIR "/CMakeCache.txt",
CMAKE_BINARY_DIR "/CMakeCache.txt",
VTK_BINARY_DIR "/vtkConfigure.h",
VTK_BINARY_DIR "/vtkToolkits.h",
CMAKE_BINARY_DIR "/CMakeFiles/CMakeError.log",
VTK_BINARY_DIR "/CMake/CMakeCache.txt",
VTK_BINARY_DIR "/CMake/CMakeCache.txt",
VTK_BINARY_DIR "/VTKBuildSettings.cmake",
VTK_BINARY_DIR "/VTKLibraryDepends.cmake",
VTK_BINARY_DIR "/VTKConfig.cmake",
......@@ -92,4 +92,4 @@ int SystemInformation(int,char *[])
#endif
return 0;
}
}
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