Commit 229579c3 authored by Kenneth Moreland's avatar Kenneth Moreland

Compare with tolerance in UnitTestArrayHandlePermutation

The UnitTestArrayHandlePermutation test was failing when compiled with
icc. I believe the issue is that the icc optimization takes some
liberties when computing literal floating point values versus computing
them at run time that makes the two slightly different. I changed all
the applicable comparisons in this test from using the == operator to
using the test_equal function, which adds a tolerance to the comparison.
I expect this to fix the test failure.
parent 1f7ed431
......@@ -124,7 +124,7 @@ void CheckInPlaceResult(PortalType portal)
// This index was part of the permuted array; has a value changed
T expectedValue = TestValue(permutedIndex, T()) + T(1000);
T retrievedValue = portal.Get(permutedIndex);
VTKM_TEST_ASSERT(expectedValue == retrievedValue,
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"Permuted set unexpected value.");
}
else
......@@ -132,7 +132,7 @@ void CheckInPlaceResult(PortalType portal)
// This index was not part of the permuted array; has original value
T expectedValue = TestValue(permutedIndex, T());
T retrievedValue = portal.Get(permutedIndex);
VTKM_TEST_ASSERT(expectedValue == retrievedValue,
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"Permuted array modified value it should not have.");
}
}
......@@ -179,7 +179,7 @@ void CheckOutputResult(PortalType portal)
vtkm::Id originalIndex = permutedIndex/2;
T expectedValue = TestValue(originalIndex, T());
T retrievedValue = portal.Get(permutedIndex);
VTKM_TEST_ASSERT(expectedValue == retrievedValue,
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"Permuted set unexpected value.");
}
else
......@@ -187,7 +187,7 @@ void CheckOutputResult(PortalType portal)
// This index was not part of the permuted array; has original value
T expectedValue = TestValue(permutedIndex, T());
T retrievedValue = portal.Get(permutedIndex);
VTKM_TEST_ASSERT(expectedValue == retrievedValue,
VTKM_TEST_ASSERT(test_equal(expectedValue, retrievedValue),
"Permuted array modified value it should not have.");
}
}
......
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