00001 #include "util/sized_iterator.hh" 00002 00003 #define BOOST_TEST_MODULE SizedIteratorTest 00004 #include <boost/test/unit_test.hpp> 00005 00006 namespace util { namespace { 00007 00008 BOOST_AUTO_TEST_CASE(swap_works) { 00009 char str[2] = { 0, 1 }; 00010 SizedProxy first(str, 1), second(str + 1, 1); 00011 swap(first, second); 00012 BOOST_CHECK_EQUAL(1, str[0]); 00013 BOOST_CHECK_EQUAL(0, str[1]); 00014 } 00015 00016 }} // namespace anonymous util