Skip to content
Snippets Groups Projects
Commit 6ae8cdbb authored by ilor's avatar ilor
Browse files

Make Position's default value be Nowhere

parent 13d507fd
No related merge requests found
......@@ -14,17 +14,17 @@ class Position : public Value
public:
WCCL_VALUE_PREAMBLE
explicit Position(int v = 0)
: val_(v)
{
}
typedef int value_type;
static const int Nowhere = boost::integer_traits<int>::const_min;
static const int Begin = boost::integer_traits<int>::const_min + 1;
static const int End = boost::integer_traits<int>::const_max;
explicit Position(int v = Nowhere)
: val_(v)
{
}
const int& get_value() const {
return val_;
}
......
......@@ -170,9 +170,9 @@ BOOST_FIXTURE_TEST_CASE(reset_values, Vfix)
v.reset_values();
BOOST_CHECK_EQUAL(v.get_value<Bool>("b1"), false);
BOOST_CHECK_EQUAL(v.get_value<Bool>("b2"), false);
BOOST_CHECK_EQUAL(v.get_value<Position>("p1"), 0);
BOOST_CHECK_EQUAL(v.get_value<Position>("p2"), 0);
BOOST_CHECK_EQUAL(v.get_value<Position>("p3"), 0);
BOOST_CHECK_EQUAL(v.get_value<Position>("p1"), Position::Nowhere);
BOOST_CHECK_EQUAL(v.get_value<Position>("p2"), Position::Nowhere);
BOOST_CHECK_EQUAL(v.get_value<Position>("p3"), Position::Nowhere);
}
BOOST_FIXTURE_TEST_CASE(clone, Vfix)
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment