BoardIteratorTest.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005 #include <boost/test/auto_unit_test.hpp>
00006
00007 #include "BoardIterator.hpp"
00008
00009 using namespace benzene;
00010
00011
00012
00013 namespace {
00014
00015 BOOST_AUTO_TEST_CASE(BoardIterator_Basic)
00016 {
00017 std::vector<HexPoint> empty, simple;
00018
00019 empty.push_back(INVALID_POINT);
00020 simple.push_back(FIRST_EDGE);
00021 simple.push_back(FIRST_CELL);
00022 simple.push_back(INVALID_POINT);
00023
00024 {
00025 BoardIterator b(&empty[0]);
00026 BOOST_CHECK(!b);
00027 }
00028
00029 {
00030 BoardIterator b(simple);
00031 BOOST_CHECK(b);
00032 BOOST_CHECK_EQUAL(*b, FIRST_EDGE);
00033 ++b;
00034 BOOST_CHECK(b);
00035 BOOST_CHECK_EQUAL(*b, FIRST_CELL);
00036 ++b;
00037 BOOST_CHECK(!b);
00038 }
00039 }
00040
00041 }
00042
00043