Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorMartin Hořeňovský2020-02-03 15:07:59 +0100
committerMartin Hořeňovský2020-02-03 15:14:59 +0100
commitc3a5e21648ba4cde517ed17682b1d61833c27679 (patch)
tree3f5bc83ca207ca5de42c4a96aa5f3e9f1e9712c3 /src
parentbd9520c0f99f06202bd939cd947480259d4afffb (diff)
downloadcatch3-c3a5e21648ba4cde517ed17682b1d61833c27679.tar.gz
Move Approx out of the Detail namespace
Diffstat (limited to 'src')
-rw-r--r--src/catch2/catch.hpp2
-rw-r--r--src/catch2/catch_approx.cpp13
-rw-r--r--src/catch2/catch_approx.h10
-rw-r--r--src/catch2/catch_matchers_vector.h2
4 files changed, 10 insertions, 17 deletions
diff --git a/src/catch2/catch.hpp b/src/catch2/catch.hpp
index a26cb080..3ecbdf69 100644
--- a/src/catch2/catch.hpp
+++ b/src/catch2/catch.hpp
@@ -60,6 +60,4 @@
#include <catch2/catch_reenable_warnings.h>
-using Catch::Detail::Approx;
-
#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED
diff --git a/src/catch2/catch_approx.cpp b/src/catch2/catch_approx.cpp
index c1a9170f..4296e8d5 100644
--- a/src/catch2/catch_approx.cpp
+++ b/src/catch2/catch_approx.cpp
@@ -23,7 +23,6 @@ bool marginComparison(double lhs, double rhs, double margin) {
}
namespace Catch {
-namespace Detail {
Approx::Approx ( double value )
: m_epsilon( std::numeric_limits<float>::epsilon()*100 ),
@@ -70,18 +69,16 @@ namespace Detail {
m_epsilon = newEpsilon;
}
-} // end namespace Detail
-
namespace literals {
- Detail::Approx operator "" _a(long double val) {
- return Detail::Approx(val);
+ Approx operator "" _a(long double val) {
+ return Approx(val);
}
- Detail::Approx operator "" _a(unsigned long long val) {
- return Detail::Approx(val);
+ Approx operator "" _a(unsigned long long val) {
+ return Approx(val);
}
} // end namespace literals
-std::string StringMaker<Catch::Detail::Approx>::convert(Catch::Detail::Approx const& value) {
+std::string StringMaker<Catch::Approx>::convert(Catch::Approx const& value) {
return value.toString();
}
diff --git a/src/catch2/catch_approx.h b/src/catch2/catch_approx.h
index e6a846b7..9dc9f292 100644
--- a/src/catch2/catch_approx.h
+++ b/src/catch2/catch_approx.h
@@ -13,7 +13,6 @@
#include <type_traits>
namespace Catch {
-namespace Detail {
class Approx {
private:
@@ -115,16 +114,15 @@ namespace Detail {
double m_scale;
double m_value;
};
-} // end namespace Detail
namespace literals {
- Detail::Approx operator "" _a(long double val);
- Detail::Approx operator "" _a(unsigned long long val);
+ Approx operator "" _a(long double val);
+ Approx operator "" _a(unsigned long long val);
} // end namespace literals
template<>
-struct StringMaker<Catch::Detail::Approx> {
- static std::string convert(Catch::Detail::Approx const& value);
+struct StringMaker<Catch::Approx> {
+ static std::string convert(Catch::Approx const& value);
};
} // end namespace Catch
diff --git a/src/catch2/catch_matchers_vector.h b/src/catch2/catch_matchers_vector.h
index f41e7fcc..86fb2214 100644
--- a/src/catch2/catch_matchers_vector.h
+++ b/src/catch2/catch_matchers_vector.h
@@ -124,7 +124,7 @@ namespace Matchers {
}
std::vector<T> const& m_comparator;
- mutable Catch::Detail::Approx approx = Catch::Detail::Approx::custom();
+ mutable Catch::Approx approx = Catch::Approx::custom();
};
template<typename T>