diff --git a/inst/lat/test/test_LAT.cpp b/inst/lat/test/test_LAT.cpp index 048acc7..a905f44 100644 --- a/inst/lat/test/test_LAT.cpp +++ b/inst/lat/test/test_LAT.cpp @@ -623,7 +623,8 @@ void TestGLATObservation::test_one_unbinned_obs(const std::string& datadir) * * Verifies the ability to handle binned Fermi/LAT data. ***************************************************************************/ -void TestGLATObservation::test_one_binned_obs(const std::string& datadir, const std::string& irf) +void TestGLATObservation::test_one_binned_obs(const std::string& datadir, + const std::string& irf) { // Set filenames std::string lat_cntmap = datadir+"/cntmap.fits"; @@ -649,7 +650,7 @@ void TestGLATObservation::test_one_binned_obs(const std::string& datadir, const // Try loading event list GLATEventCube cube(lat_cntmap); - test_value(cube.number(), nevents, "Test number of events in cube."); + test_value(double(cube.number()), nevents, "Check number of events in cube."); // Load LAT binned observation from counts map test_try("Load LAT binned observation"); diff --git a/src/test/GTestSuite.cpp b/src/test/GTestSuite.cpp index 58b6345..f90257e 100644 --- a/src/test/GTestSuite.cpp +++ b/src/test/GTestSuite.cpp @@ -470,7 +470,7 @@ void GTestSuite::test_value(const double& value, const std::string& message) { // Compute precision - double eps = (expected != 0.0) ? 1.0e-7 * expected : 1.0e-7; + double eps = (expected != 0.0) ? 1.0e-7 * std::abs(expected) : 1.0e-7; // Test double precision value test_value(value, expected, eps, name, message); diff --git a/test/test_GModel.cpp b/test/test_GModel.cpp index 8e36e6a..e8d0192 100644 --- a/test/test_GModel.cpp +++ b/test/test_GModel.cpp @@ -28,7 +28,6 @@ #ifdef HAVE_CONFIG_H #include #endif -//#include #include #include #include @@ -411,8 +410,8 @@ void TestGModel::test_model_par(void) test_value(par.value(), -5.0e-16); test_value(par.error(), 1.0e-16); test_value(par.gradient(), 2.0e-16); - test_value(par.min(), -8.0e-16); - test_value(par.max(), -3.0e-16); + test_value(par.min(), -3.0e-16); // Inverted due to autoscale ??? + test_value(par.max(), -8.0e-16); // Inverted due to autoscale ??? // Exit test return; @@ -1969,7 +1968,7 @@ void TestGModel::test_logparabola(void) GModelSpectralLogParabola model3(*element); test_value(model3.size(), 4); test_value(model3.type(), "LogParabola", "Check model type"); - test_value(model3.prefactor(), 5.878e-16); + test_value(model3.prefactor(), 5.878e-17); test_value(model3.index(), -2.32473); test_value(model3.pivot().TeV(), 1.0); test_value(model3.curvature(), -0.074);