ikarus-project / ikarus

Ikarus is a C++-based library that uses DUNE modules to solve partial differential equations with the finite element method and more.
https://ikarus-project.github.io/
Other
5 stars 3 forks source link

refactor isApproxSame and checkScalars interface #212

Open tarun-mitruka opened 8 months ago

tarun-mitruka commented 8 months ago

Currently, there is an implementation of checkScalars from #193 and there is an existing isApproxSame functionality in testhelpers.hh.

Refactoring of the interface is needed which includes only one check function that is able to switch between checkScalars and isApproxSame and perform the correct check irrespective of the type (int, double, Eigen::VectorXd,...).

Moreover, the TestSuiteType can be also be passed as the error message is most of the time of the following format in the whole test suite.

t.check(val == expectedVal) << std::setprecision(16) << "Incorrect -> Expected:\t" << expectedVal << " Actual:\t" << val << messageIfFailed;