Skip to content

Commit

Permalink
- Fix Unit test failure
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed Nov 23, 2024
1 parent 677b71f commit a7565c0
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/Plugins/SimplnxCore/test/ComputeTriangleGeomVolumesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,20 @@ TEST_CASE("SimplnxCore::ComputeTriangleGeomSizes", "[SimplnxCore][ComputeTriangl
const DataPath kNxArrayPath = k_FeatureAttributeMatrixPath.createChildPath(k_VolumesArrayName);

const auto& kExemplarsArray = dataStructure.getDataRefAs<IDataArray>(kExemplarArrayPath);

// The corrected version of the filter ensures there are no negative values. instead of
// uploading a new test file, we can just safely ensure the same applies to the
// exemplar data.
auto& exemplarData = dataStructure.getDataRefAs<Float32Array>(kExemplarArrayPath);
auto& resultStore = exemplarData.getIDataStoreRefAs<AbstractDataStore<float32>>();
for(auto& value : resultStore)
{
if(value < 0)
{
value = value * -1.0;
}
}

const auto& kNxArray = dataStructure.getDataRefAs<IDataArray>(kNxArrayPath);

CompareDataArrays<float32>(kExemplarsArray, kNxArray);
Expand Down

0 comments on commit a7565c0

Please sign in to comment.