Skip to content

Commit

Permalink
Fix most failing unit tests
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Jackson <[email protected]>
  • Loading branch information
imikejackson committed May 25, 2024
1 parent 0394860 commit 21360d9
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
"DataContainer/Cell Data/Mask",
"DataContainer/Cell Data/Quats",
"DataContainer/Cell Feature Data",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Data/FeatureIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/NewGrain Data",
"DataContainer/Cell Data/ParentIds",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Data/IPFColors",
"DataContainer/Cell Feature Data/Centroids",
Expand Down Expand Up @@ -71,15 +69,12 @@
"DataContainer/Cell Data/Mask",
"DataContainer/Cell Data/Quats",
"DataContainer/Cell Feature Data",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Data/FeatureIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/Cell Feature Data/AvgQuats",
"DataContainer/Cell Feature Data/AvgEulerAngles",

"DataContainer/Cell Feature Data/AvgEulerAngles",
"DataContainer/NewGrain Data",
"DataContainer/Cell Data/ParentIds",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Data/IPFColors"
],
Expand Down Expand Up @@ -683,7 +678,7 @@
"avg_quats_array_path": "DataContainer/Cell Feature Data/AvgQuats",
"crystal_structures_array_path": "DataContainer/Cell Ensemble Data/CrystalStructures",
"feature_phases_array_path": "DataContainer/Cell Feature Data/Phases",
"find_avg_misors": false,
"compute_avg_misors": false,
"misorientation_list_array_name": "MisorientationList",
"neighbor_list_array_path": "DataContainer/Cell Feature Data/NeighborhoodList"
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,10 @@
"DataContainer/Cell Data/Mask",
"DataContainer/Cell Data/Quats",
"DataContainer/Cell Feature Data",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Data/FeatureIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/NewGrain Data",
"DataContainer/Cell Data/ParentIds",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Data/IPFColors",
"DataContainer/Cell Feature Data/Centroids",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
"DataContainer/Cell Ensemble Data/LatticeConstants",
"DataContainer/NewGrain Data",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Feature Data/AspectRatios",
"DataContainer/Cell Feature Data/AvgEulerAngles",
"DataContainer/Cell Feature Data/AvgQuats",
Expand All @@ -44,7 +43,6 @@
"DataContainer/Cell Feature Data/NumElements",
"DataContainer/Cell Feature Data/NumNeighbors",
"DataContainer/Cell Feature Data/Omega3s",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/Cell Feature Data/Poles",
"DataContainer/Cell Feature Data/Schmids",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1120,7 +1120,6 @@
"DataContainer/Cell Ensemble Data/LatticeConstants",
"DataContainer/NewGrain Data",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Feature Data/AspectRatios",
"DataContainer/Cell Feature Data/AvgEulerAngles",
"DataContainer/Cell Feature Data/AvgQuats",
Expand All @@ -1133,7 +1132,6 @@
"DataContainer/Cell Feature Data/NumElements",
"DataContainer/Cell Feature Data/NumNeighbors",
"DataContainer/Cell Feature Data/Omega3s",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/Cell Feature Data/Poles",
"DataContainer/Cell Feature Data/Schmids",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,6 @@
"DataContainer/Cell Ensemble Data/LatticeConstants",
"DataContainer/NewGrain Data",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Feature Data/AspectRatios",
"DataContainer/Cell Feature Data/AvgEulerAngles",
"DataContainer/Cell Feature Data/AvgQuats",
Expand All @@ -1304,7 +1303,6 @@
"DataContainer/Cell Feature Data/NumElements",
"DataContainer/Cell Feature Data/NumNeighbors",
"DataContainer/Cell Feature Data/Omega3s",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/Cell Feature Data/Poles",
"DataContainer/Cell Feature Data/Schmids",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1291,7 +1291,6 @@
"DataContainer/Cell Ensemble Data/LatticeConstants",
"DataContainer/NewGrain Data",
"DataContainer/NewGrain Data/Active",
"DataContainer/Cell Feature Data/Active",
"DataContainer/Cell Feature Data/AspectRatios",
"DataContainer/Cell Feature Data/AvgEulerAngles",
"DataContainer/Cell Feature Data/AvgQuats",
Expand All @@ -1304,7 +1303,6 @@
"DataContainer/Cell Feature Data/NumElements",
"DataContainer/Cell Feature Data/NumNeighbors",
"DataContainer/Cell Feature Data/Omega3s",
"DataContainer/Cell Feature Data/ParentIds",
"DataContainer/Cell Feature Data/Phases",
"DataContainer/Cell Feature Data/Poles",
"DataContainer/Cell Feature Data/Schmids",
Expand Down
18 changes: 9 additions & 9 deletions src/Plugins/SimplnxCore/test/ComputeSurfaceFeaturesTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -86,10 +86,10 @@ void test_impl(const std::vector<uint64>& geometryDims, const std::string& featu
auto executeResult = filter.execute(dataStructure, args);
SIMPLNX_RESULT_REQUIRE_VALID(executeResult.result)

REQUIRE_NOTHROW(dataStructure.getDataRefAs<BoolArray>(k_SurfaceFeaturesArrayPath));
REQUIRE_NOTHROW(dataStructure.getDataRefAs<UInt8Array>(k_SurfaceFeaturesArrayPath));
REQUIRE_NOTHROW(dataStructure.getDataRefAs<Int8Array>(k_SurfaceFeaturesExemplaryPath));

BoolArray& surfaceFeatures = dataStructure.getDataRefAs<BoolArray>(k_SurfaceFeaturesArrayPath);
UInt8Array& surfaceFeatures = dataStructure.getDataRefAs<UInt8Array>(k_SurfaceFeaturesArrayPath);
Int8Array& surfaceFeaturesExemplary = dataStructure.getDataRefAs<Int8Array>(k_SurfaceFeaturesExemplaryPath);
REQUIRE(surfaceFeatures.getSize() == surfaceFeaturesExemplary.getSize());
REQUIRE(surfaceFeatures.getSize() == 796);
Expand All @@ -106,7 +106,7 @@ void test_impl(const std::vector<uint64>& geometryDims, const std::string& featu
}
} // namespace

TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in 3D", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: 3D", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
{
Application::GetOrCreateInstance()->loadPlugins(unit_test::k_BuildDir.view(), true);
const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "6_5_test_data_1.tar.gz", "6_5_test_data_1");
Expand Down Expand Up @@ -137,12 +137,12 @@ TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in
}

{
REQUIRE_NOTHROW(dataStructure.getDataRefAs<BoolArray>(computedSurfaceFeaturesPath));
REQUIRE_NOTHROW(dataStructure.getDataRefAs<UInt8Array>(computedSurfaceFeaturesPath));

DataPath exemplaryDataPath = Constants::k_CellFeatureDataPath.createChildPath(k_SurfaceFeaturesExemplar);
const DataArray<bool>& featureArrayExemplary = dataStructure.getDataRefAs<DataArray<bool>>(exemplaryDataPath);
const BoolArray& featureArrayExemplary = dataStructure.getDataRefAs<BoolArray>(exemplaryDataPath);

const DataArray<bool>& createdFeatureArray = dataStructure.getDataRefAs<DataArray<bool>>(computedSurfaceFeaturesPath);
const UInt8Array& createdFeatureArray = dataStructure.getDataRefAs<UInt8Array>(computedSurfaceFeaturesPath);
REQUIRE(createdFeatureArray.getNumberOfTuples() == featureArrayExemplary.getNumberOfTuples());

for(usize i = 0; i < featureArrayExemplary.getSize(); i++)
Expand All @@ -152,17 +152,17 @@ TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in
}
}

TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in 2D - XY Plane", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: 2D(XY Plane)", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
{
test_impl(std::vector<uint64>({100, 100, 1}), k_FeatureIds2DFileName, 10000, k_SurfaceFeatures2DExemplaryFileName);
}

TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in 2D - XZ Plane", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: 2D(XZ Plane)", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
{
test_impl(std::vector<uint64>({100, 1, 100}), k_FeatureIds2DFileName, 10000, k_SurfaceFeatures2DExemplaryFileName);
}

TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: Valid filter execution in 2D - YZ Plane", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
TEST_CASE("SimplnxCore::ComputeSurfaceFeaturesFilter: 2D(YZ Plane)", "[SimplnxCore][ComputeSurfaceFeaturesFilter]")
{
test_impl(std::vector<uint64>({1, 100, 100}), k_FeatureIds2DFileName, 10000, k_SurfaceFeatures2DExemplaryFileName);
}

0 comments on commit 21360d9

Please sign in to comment.