Main   Namespaces   Classes   Hierarchy   Annotated   Files   Compound   Global   Pages  

BitsetIteratorTest.cpp

Go to the documentation of this file.
00001 //---------------------------------------------------------------------------
00002 /** @file
00003  */
00004 //---------------------------------------------------------------------------
00005 #include <boost/test/auto_unit_test.hpp>
00006 
00007 #include "BitsetIterator.hpp"
00008 
00009 using namespace benzene;
00010 
00011 //---------------------------------------------------------------------------
00012 
00013 namespace {
00014 
00015 BOOST_AUTO_TEST_CASE(BitsetIterator_Basic)
00016 {
00017     bitset_t bs1;
00018     BitsetIterator b1(bs1);
00019     BOOST_CHECK(!b1);
00020 
00021     bitset_t bs2;
00022     bs2.set(FIRST_EDGE);
00023     BitsetIterator b2(bs2);
00024     BOOST_CHECK(b2);
00025     BOOST_CHECK_EQUAL(*b2, FIRST_EDGE);
00026     ++b2;
00027     BOOST_CHECK(!b2);
00028     
00029     bitset_t bs3;
00030     bs3.set(FIRST_CELL);
00031     bs3.set(FIRST_CELL+1);
00032     bs3.set(FIRST_CELL+6);
00033     BitsetIterator b3(bs3);
00034     BOOST_CHECK(b3);
00035     BOOST_CHECK_EQUAL(*b3, FIRST_CELL);
00036     ++b3;
00037     BOOST_CHECK(b3);
00038     BOOST_CHECK_EQUAL(*b3, FIRST_CELL+1);
00039     ++b3;
00040     BOOST_CHECK(b3);
00041     BOOST_CHECK_EQUAL(*b3, FIRST_CELL+6);
00042     ++b3;
00043     BOOST_CHECK(!b3);
00044 }
00045 
00046 }
00047 
00048 //---------------------------------------------------------------------------


6 Jan 2011 Doxygen 1.6.3