Skip to content

Commit

Permalink
Fix broken 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 Dec 10, 2024
1 parent bb3728b commit 45dd1bb
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 16 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ namespace nx::core

namespace slice_triangle_geometry::constants
{
constexpr ChoicesParameter::ValueType k_FullRange = 0;
constexpr ChoicesParameter::ValueType k_UserDefinedRange = 1;
}
constexpr ChoicesParameter::ValueType k_FullRange = 0;
constexpr ChoicesParameter::ValueType k_UserDefinedRange = 1;
} // namespace slice_triangle_geometry::constants

struct SIMPLNXCORE_EXPORT SliceTriangleGeometryInputValues
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ IFilter::PreflightResult RegularGridSampleSurfaceMeshFilter::preflightImpl(const

float32 vol = (pDimensionsValue[0] * pSpacingValue[0]) * (pDimensionsValue[1] * pSpacingValue[1]) * (pDimensionsValue[2] * pSpacingValue[2]);

boxDimensions << "Volume: " << std::setprecision(8) << std::noshowpoint << vol << " " << lengthUnit << "s ^3" << "\n";
boxDimensions << "Volume: " << std::setprecision(8) << std::noshowpoint << vol << " " << lengthUnit << "s ^3"
<< "\n";

preflightUpdatedValues.push_back({"BoxDimensions", boxDimensions.str()});

Expand Down
3 changes: 3 additions & 0 deletions src/Plugins/SimplnxCore/test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,9 @@ if(EXISTS "${DREAM3D_DATA_DIR}" AND SIMPLNX_DOWNLOAD_TEST_FILES)
download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME volume_graphics_test.tar.gz SHA512 94d996fbf2b8b42cd715fb3adf33548f097970211e7a26eb9ccc5b073a78014eecbd10d40fc0451ff9cc7c92e23ed21582fc082d64e1f62b3714e4d9640c975f)
download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME vtk_rectilinear_grid_writer.tar.gz SHA512 9fef02b5269609503d03dd0126cc635cc1c1156894cff18b0184b334d705b850ca1a06ae0d1c66a352a32dd9ad9fb74f24255c7de1399b06bbec7d2e2b41941b)

download_test_data(DREAM3D_DATA_DIR ${DREAM3D_DATA_DIR} ARCHIVE_NAME scan_path_test_data_v2.tar.gz SHA512 79eb796b16c23d5094b7f65b3069c84118cc557be7e9115c518724c7f1f3e40c0e17599a8bd858fff4d0a45a91ab70a242876fcc14bde86c34df7afa94e8f748)


endif()

# -----------------------------------------------------------------------------
Expand Down
11 changes: 3 additions & 8 deletions src/Plugins/SimplnxCore/test/CreateAMScanPathsTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,9 @@ TEST_CASE("SimplnxCore::CreateAMScanPathsFilter: Valid Filter Execution", "[Simp
{
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, "scan_path_test_data.tar.gz", "scan_path_test_data");
const nx::core::UnitTest::TestFileSentinel testDataSentinel(nx::core::unit_test::k_CMakeExecutable, nx::core::unit_test::k_TestFilesDir, "scan_path_test_data_v2.tar.gz", "scan_path_test_data");
// Read the Small IN100 Data set
auto baseDataFilePath = fs::path(fmt::format("{}/scan_path_test_data/scan_path_test_data.dream3d", nx::core::unit_test::k_TestFilesDir));
auto baseDataFilePath = fs::path(fmt::format("{}/scan_path_test_data_v2/scan_path_test_data.dream3d", nx::core::unit_test::k_TestFilesDir));
DataStructure dataStructure = UnitTest::LoadDataStructure(baseDataFilePath);

// Instantiate the filter, a DataStructure object and an Arguments Object
Expand All @@ -42,7 +42,7 @@ TEST_CASE("SimplnxCore::CreateAMScanPathsFilter: Valid Filter Execution", "[Simp
Arguments args;

// Create default Parameters for the filter.
args.insertOrAssign(CreateAMScanPathsFilter::k_StripeWidth_Key, std::make_any<float32>(10.0f));
args.insertOrAssign(CreateAMScanPathsFilter::k_StripeWidth_Key, std::make_any<float32>(7.0f));
args.insertOrAssign(CreateAMScanPathsFilter::k_HatchSpacing_Key, std::make_any<float32>(0.33f));
args.insertOrAssign(CreateAMScanPathsFilter::k_Power_Key, std::make_any<float32>(100.0f));
args.insertOrAssign(CreateAMScanPathsFilter::k_Speed_Key, std::make_any<float32>(1000.0f));
Expand Down Expand Up @@ -92,8 +92,3 @@ TEST_CASE("SimplnxCore::CreateAMScanPathsFilter: Valid Filter Execution", "[Simp
UnitTest::CompareArrays<int32>(dataStructure, exemplarDataArray, computedDataArray);
}
}

// TEST_CASE("SimplnxCore::ScanVectorsGeneratorFilter: InValid Filter Execution")
//{
//
// }
12 changes: 8 additions & 4 deletions src/Plugins/SimplnxCore/test/SliceTriangleGeometryTest.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,15 @@ const DataObjectNameParameter::ValueType k_RegionIdsName("RegionIds");

TEST_CASE("SimplnxCore::SliceTriangleGeometryFilter: Valid Filter Execution", "[SimplnxCore][SliceTriangleGeometryFilter]")
{
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, "scan_path_test_data.tar.gz", "scan_path_test_data");
/// The test data set was reviewed manually by MAJ and found to be correct in output to the
/// the best of our abilities. This is needed because DREAM.3D did not have
/// this functionality and so we have nothing to compare against.

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, "scan_path_test_data_v2.tar.gz", "scan_path_test_data_v2");
// Read the Small IN100 Data set
auto baseDataFilePath = fs::path(fmt::format("{}/scan_path_test_data/scan_path_test_data.dream3d", nx::core::unit_test::k_TestFilesDir));
auto baseDataFilePath = fs::path(fmt::format("{}/scan_path_test_data_v2/scan_path_test_data.dream3d", nx::core::unit_test::k_TestFilesDir));
DataStructure dataStructure = UnitTest::LoadDataStructure(baseDataFilePath);

// Instantiate the filter, a DataStructure object and an Arguments Object
Expand All @@ -41,7 +45,7 @@ TEST_CASE("SimplnxCore::SliceTriangleGeometryFilter: Valid Filter Execution", "[
// Create default Parameters for the filter.
args.insertOrAssign(SliceTriangleGeometryFilter::k_Zstart_Key, std::make_any<float32>(0.0f));
args.insertOrAssign(SliceTriangleGeometryFilter::k_Zend_Key, std::make_any<float32>(0.0f));
args.insertOrAssign(SliceTriangleGeometryFilter::k_SliceResolution_Key, std::make_any<float32>(3.0f));
args.insertOrAssign(SliceTriangleGeometryFilter::k_SliceResolution_Key, std::make_any<float32>(0.075000003f));
args.insertOrAssign(SliceTriangleGeometryFilter::k_SliceRange_Key, std::make_any<ChoicesParameter::ValueType>(0));
args.insertOrAssign(SliceTriangleGeometryFilter::k_HaveRegionIds_Key, std::make_any<bool>(true));
args.insertOrAssign(SliceTriangleGeometryFilter::k_TriangleGeometryDataPath_Key, std::make_any<DataPath>(k_InputTriangleGeometryPath));
Expand Down

0 comments on commit 45dd1bb

Please sign in to comment.