Boost logo

Boost-Commit :

Subject: [Boost-commit] svn:boost r76873 - trunk/libs/geometry/test/util
From: barend.gehrels_at_[hidden]
Date: 2012-02-04 07:15:46


Author: barendgehrels
Date: 2012-02-04 07:15:45 EST (Sat, 04 Feb 2012)
New Revision: 76873
URL: http://svn.boost.org/trac/boost/changeset/76873

Log:
Simplified select_most_precise unit test
Text files modified:
   trunk/libs/geometry/test/util/select_most_precise.cpp | 27 ++++-----------------------
   1 files changed, 4 insertions(+), 23 deletions(-)

Modified: trunk/libs/geometry/test/util/select_most_precise.cpp
==============================================================================
--- trunk/libs/geometry/test/util/select_most_precise.cpp (original)
+++ trunk/libs/geometry/test/util/select_most_precise.cpp 2012-02-04 07:15:45 EST (Sat, 04 Feb 2012)
@@ -18,33 +18,14 @@
 #include <boost/geometry/util/select_most_precise.hpp>
 
 
-#include <boost/mpl/int.hpp>
+struct user_defined {};
 
-
-using namespace boost::geometry;
-
-struct user_defined
-{
-};
-
-template <typename T> struct check_selection : public boost::mpl::int_<0> {};
-
-template <> struct check_selection<short int> : public boost::mpl::int_<1> {};
-template <> struct check_selection<int> : public boost::mpl::int_<2> {};
-template <> struct check_selection<float> : public boost::mpl::int_<11> {};
-template <> struct check_selection<double> : public boost::mpl::int_<12> {};
-template <> struct check_selection<long double> : public boost::mpl::int_<13> {};
-template <> struct check_selection<user_defined> : public boost::mpl::int_<99> {};
-
-template <> struct check_selection<void> : public boost::mpl::int_<98> {};
-
-
-template <typename T1, typename T2, typename TypeToBeSelected>
+template <typename T1, typename T2, typename ExpectedType>
 void test()
 {
     typedef typename bg::select_most_precise<T1, T2>::type type;
- BOOST_CHECK_EQUAL(check_selection<type>::type::value,
- check_selection<TypeToBeSelected>::type::value);
+
+ BOOST_CHECK((boost::is_same<type, ExpectedType>::type::value));
 }
 
 int test_main(int, char* [])


Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk