Skip to content

Commit afb2935

Browse files
committed
TEST: DirectionalStats + Avg Orientation Testing Implemented
Signed-off-by: Michael Jackson <mike.jackson@bluequartz.net>
1 parent 01ff301 commit afb2935

4 files changed

Lines changed: 5 additions & 10 deletions

File tree

Source/Test/CMakeLists.txt

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,9 +76,8 @@ if(EBSDLIB_DOWNLOAD_TEST_FILES)
7676
file(MAKE_DIRECTORY "${EBSDLIB_DATA_DIR}/TestFiles/")
7777
endif()
7878

79-
ebsdlib_download_test_data(EBSDLIB_DATA_DIR ${EBSDLIB_DATA_DIR} ARCHIVE_NAME Laue_Orientation_Clusters_v5.tar.gz SHA512 1be0876dbb77e8ca032b371b16c3f642bbfcbac78adb7b3dfb0ad14ec43ec170cf793dab61873b27974a7aa0e0200d27fca07cd51f6620d23dbcc0c7134f60e6)
79+
ebsdlib_download_test_data(EBSDLIB_DATA_DIR ${EBSDLIB_DATA_DIR} ARCHIVE_NAME Laue_Orientation_Clusters_v6.tar.gz SHA512 f327d3d2a86d539b3c1f3fc755d8f5741d8eb68aab45fc1ab54d9e5db48643903f9a37898366203e6eb2e7585ce57c6e186cca2107acb1a53318b813345cb10a)
8080

81-
8281
endif()
8382

8483

Source/Test/DirectionalStatsTest.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -121,8 +121,7 @@ void TestDistribution(const std::string& phaseName, LaueOps::Pointer op, const s
121121
QuatD refMu = QuatD(refMuhat[sampleId * 4 + 1], refMuhat[sampleId * 4 + 2], refMuhat[sampleId * 4 + 3], refMuhat[sampleId * 4]).normalize();
122122
double refKappa = refKappahat[sampleId];
123123

124-
std::printf(" %s group %zu: kappa EbsdLib=%12.6f EMsoft=%12.6f muW EbsdLib=%10.7f EMsoft=%10.7f\n",
125-
distributionType.c_str(), sampleId, kappahat, refKappa, muhat.w(), refMu.w());
124+
std::printf(" %s group %zu: kappa EbsdLib=%12.6f EMsoft=%12.6f muW EbsdLib=%10.7f EMsoft=%10.7f\n", distributionType.c_str(), sampleId, kappahat, refKappa, muhat.w(), refMu.w());
126125

127126
REQUIRE(muhat.w() == Approx(refMu.w()).margin(1e-6));
128127
REQUIRE(muhat.x() == Approx(refMu.x()).margin(1e-6));
@@ -134,7 +133,7 @@ void TestDistribution(const std::string& phaseName, LaueOps::Pointer op, const s
134133

135134
TEST_CASE("DirectionalStatsTest:AverageOrientation", "[DirectionalStatsTest]")
136135
{
137-
const ebsdlib::unit_test::TestFileSentinel testDataSentinel(ebsdlib::unit_test::k_TestFilesDir, "Laue_Orientation_Clusters_v6.tar.gz", "Laue_Orientation_Clusters_v6", false, false);
136+
const ebsdlib::unit_test::TestFileSentinel testDataSentinel(ebsdlib::unit_test::k_TestFilesDir, "Laue_Orientation_Clusters_v6.tar.gz", "Laue_Orientation_Clusters_v6", true, true);
138137
std::vector<LaueOps::Pointer> ops = LaueOps::GetAllOrientationOps();
139138

140139
std::set<std::string> tested;
@@ -475,4 +474,3 @@ TEST_CASE("DirectionalStatsTest:Watson_FromTXT", "[DirectionalStatsTest]")
475474
std::printf(" kappa : %20.16f\n", kappahat);
476475
std::printf(" eq. deg. : %20.16f\n", eqDeg);
477476
}
478-

Source/Test/UnitTestCommon.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ TestFileSentinel::~TestFileSentinel()
4343
}
4444
}
4545

46-
4746
namespace
4847
{
4948
// Parse an octal field from a tar header, returning 0 on empty/null fields
@@ -262,5 +261,4 @@ std::error_code TestFileSentinel::decompress()
262261
return {};
263262
}
264263

265-
266-
}
264+
} // namespace ebsdlib::unit_test

Source/Test/UnitTestCommon.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,4 +66,4 @@ class TestFileSentinel
6666
bool m_RemoveTemp;
6767
};
6868

69-
}
69+
} // namespace ebsdlib::unit_test

0 commit comments

Comments
 (0)