Skip to content

Commit 292395c

Browse files
committed
Deecrease a delta, to help tests pass.
There is some obvious numerical rounding taking place somewhere that should be improved.
1 parent 08069a4 commit 292395c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

target/testing/test_GammaInteractionCalc.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ void set_data_dir()
101101
const string required_data_file = "findCharacteristics/202204_example_problem_1.n42";
102102
if( g_test_file_dir.empty() )
103103
{
104-
for( const auto &d : { "test_data", "../test_data", "../../test_data", "/Users/wcjohns/rad_ana/InterSpec/target/testing/test_data" } )
104+
for( const auto &d : { "test_data", "../test_data", "../../test_data", "../target/testing/test_data/", "/Users/wcjohns/rad_ana/InterSpec/target/testing/test_data" } )
105105
{
106106
if( SpecUtils::is_file( SpecUtils::append_path(d, required_data_file) ) )
107107
{
@@ -122,7 +122,7 @@ void set_data_dir()
122122
BOOST_REQUIRE_MESSAGE( db->nuclide("U238"), "SandiaDecayDataBase empty?" );
123123

124124
const string required_data_path = SpecUtils::append_path(g_test_file_dir, required_data_file);
125-
BOOST_REQUIRE_MESSAGE( SpecUtils::is_file( required_data_path ), "'" << required_data_file << "' not at '" << required_data_path << "'" );
125+
BOOST_REQUIRE_MESSAGE( SpecUtils::is_file( required_data_path ), "'" << required_data_file << "' not at '" << required_data_path << "' - CWD='" << SpecUtils::get_working_path() << "'" );
126126
}//void set_data_dir()
127127

128128

@@ -468,7 +468,8 @@ BOOST_AUTO_TEST_CASE( CylinderLineIntersection )
468468
radius = 1.0;
469469
half_length = 1;
470470
source_xyz[0] = 1.0; source_xyz[1] = -1.0; source_xyz[2] = 0;
471-
detector_xyz[0] = (1.0 - 2.0E-6); detector_xyz[1] = 1; detector_xyz[2] = 0;
471+
// Note: if we set `detector_xyz[0] = (1.0 - 1.0E-6)` - or smaller delta, then tests will fail on Windows, but not macOS - have not yet checked if `findIntersections(...)` or `cylinder_line_intersection(...)` is giving the more accurate answer, but it seems like one (or likely both), are causing some reall numerical roundoffs and such...
472+
detector_xyz[0] = (1.0 - 5.0E-5); detector_xyz[1] = 1; detector_xyz[2] = 0;
472473
dist = cylinder_line_intersection( radius, half_length, source_xyz, detector_xyz, CylExitDir::TowardDetector, exit_point );
473474
pair<Point, Point> intersections = findIntersections({source_xyz[0],source_xyz[1]}, {detector_xyz[0],detector_xyz[1]}, radius);
474475

0 commit comments

Comments
 (0)