Changeset 2277


Ignore:
Timestamp:
Jun 25, 2010, 4:22:48 AM (11 years ago)
Author:
Peter
Message:

some test code for data_iterator (refs #633).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/iterator_test.cc

    r2202 r2277  
    6565void test_pair_second_iterator(test::Suite&);
    6666
     67void test_data_iterator(test::Suite& suite);
    6768void test_iterator_traits(test::Suite& suite);
    6869void test_stride_iterator(test::Suite& suite);
     
    8586  suite.out() << "testing weighted iterator\n";
    8687  test_weighted_iterator(suite);
     88  test_data_iterator(suite);
    8789  return suite.return_value();
    8890}
     
    293295
    294296
     297void test_data_iterator(test::Suite& suite)
     298{
     299  // do not run compile test
     300  return;
     301
     302  using utility::DataIterator;
     303  using boost::input_iterator_archetype;
     304  input_iterator_archetype<double> input_it;
     305  using boost::mutable_forward_iterator_archetype;
     306  mutable_forward_iterator_archetype<double> forward_it;
     307 
     308  using utility::data_iterator;
     309  std::copy(data_iterator(input_it),
     310            data_iterator(input_it),
     311            data_iterator(forward_it));
     312
     313#ifdef YAT_TICKET_633
     314  input_iterator_archetype<utility::DataWeight> input_it_w;
     315  mutable_forward_iterator_archetype<utility::DataWeight> forward_it_w;
     316  std::copy(data_iterator(input_it_w),
     317            data_iterator(input_it_w),
     318            data_iterator(forward_it_w));
     319#endif
     320}
     321
     322
    295323void test_iterator_traits(test::Suite& suite)
    296324{
Note: See TracChangeset for help on using the changeset viewer.