Welcome to mirror list, hosted at ThFree Co, Russian Federation.

sized_iterator_test.cc « util - github.com/moses-smt/mosesdecoder.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: c36bcb2d2f323fc0fa18de2c4eb29b2ecd3ed9a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#include "util/sized_iterator.hh"

#define BOOST_TEST_MODULE SizedIteratorTest
#include <boost/test/unit_test.hpp>

namespace util { namespace {

BOOST_AUTO_TEST_CASE(swap_works) {
  char str[2] = { 0, 1 };
  SizedProxy first(str, 1), second(str + 1, 1);
  swap(first, second);
  BOOST_CHECK_EQUAL(1, str[0]);
  BOOST_CHECK_EQUAL(0, str[1]);
}

}} // namespace anonymous util