changed: pass basenames as std::string

to unify code with the other comparison classes
This commit is contained in:
Arne Morten Kvarving
2018-09-07 13:22:40 +02:00
parent 44f3b86547
commit 0b6d36658d
4 changed files with 12 additions and 7 deletions

View File

@@ -25,9 +25,11 @@
#include <cmath>
#include <numeric>
SummaryComparator::SummaryComparator(const char* basename1, const char* basename2, double absoluteTol, double relativeTol){
ecl_sum1 = ecl_sum_fread_alloc_case(basename1, ":");
ecl_sum2 = ecl_sum_fread_alloc_case(basename2, ":");
SummaryComparator::SummaryComparator(const std::string& basename1,
const std::string& basename2,
double absoluteTol, double relativeTol){
ecl_sum1 = ecl_sum_fread_alloc_case(basename1.c_str(), ":");
ecl_sum2 = ecl_sum_fread_alloc_case(basename2.c_str(), ":");
if (ecl_sum1 == nullptr || ecl_sum2 == nullptr) {
OPM_THROW(std::runtime_error, "Not able to open files");
}

View File

@@ -145,7 +145,9 @@ class SummaryComparator {
//! \param[in] absoluteTolerance The absolute tolerance which is to be used in the test.
//! \param[in] relativeTolerance The relative tolerance which is to be used in the test.
//! \details The constructor creates an object of the class, and openes the files, an exception is thrown if the opening of the files fails. \n It creates stringlists, in which keywords are to be stored, and figures out which keylist that contains the more/less keywords. \n Also the private member variables aboluteTolerance and relativeTolerance are set.
SummaryComparator(const char* basename1, const char* basename2, double absoluteTolerance, double relativeTolerance);
SummaryComparator(const std::string& basename1,
const std::string& basename2,
double absoluteTolerance, double relativeTolerance);
//! \brief Destructor
//! \details The destructor takes care of the allocated memory in which data has been stored.

View File

@@ -124,7 +124,8 @@ class SummaryIntegrationTest: public SummaryComparator {
//! \param[in] atol The absolute tolerance which is to be used in the test.
//! \param[in] rtol The relative tolerance which is to be used in the test.
//! \details The constructor calls the constructor of the super class.
SummaryIntegrationTest(const char* basename1, const char* basename2,
SummaryIntegrationTest(const std::string& basename1,
const std::string& basename2,
double atol, double rtol) :
SummaryComparator(basename1, basename2, atol, rtol) {}

View File

@@ -55,8 +55,8 @@ class SummaryRegressionTest: public SummaryComparator {
//! \param[in] relativeTol The relative tolerance which is to be used in the test.
//! \param[in] absoluteTol The absolute tolerance which is to be used in the test.
//! \details The constructor calls the constructor of the super class.
SummaryRegressionTest(const char* basename1,
const char* basename2,
SummaryRegressionTest(const std::string& basename1,
const std::string& basename2,
double relativeTol, double absoluteTol) :
SummaryComparator(basename1, basename2, relativeTol, absoluteTol) {}