Changeset 1774


Ignore:
Timestamp:
Feb 5, 2009, 4:48:18 PM (12 years ago)
Author:
Peter
Message:

refs #478 - fixed bugs in test code... the test still fails though.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/test/normalization_test.cc

    r1773 r1774  
    178178  // test with unweighted target and source
    179179  std::vector<double> target;
     180  target.reserve(1000);
    180181  while (target.size()<1000)
    181182    target.push_back(target.size());
     
    184185  while (source.size()<10)
    185186    source.push_back(source.size()*10);
    186   qQN(source.begin(), source.end(), source.begin());
    187  
     187  std::vector<double> result(source.size());
     188 
     189  qQN(source.begin(), source.end(), result.begin());
     190 
     191  using utility::DataWeight;
    188192  // test with unweighted target and weighted source
    189   std::vector<utility::DataWeight> src_w(source.size());
     193  std::vector<utility::DataWeight> src_w(source.size(), DataWeight(0, 1));
    190194  std::copy(source.begin(), source.end(),
    191195            utility::data_iterator(src_w.begin()));
    192   std::fill(utility::weight_iterator(src_w.begin()),
    193             utility::weight_iterator(src_w.end()), 1.0);
    194 
    195   qQN(src_w.begin(), src_w.end(), src_w.begin());
     196
     197  std::vector<utility::DataWeight> result_w(src_w.size());
     198  qQN(src_w.begin(), src_w.end(), result_w.begin());
    196199  // FIXME: this test fails
    197   suite.xadd(suite.equal_range(source.begin(), source.end(),
    198                               utility::data_iterator(src_w.begin())));
     200  suite.xadd(suite.equal_range(result.begin(), result.end(),
     201                              utility::data_iterator(result_w.begin())));
    199202}
    200203
Note: See TracChangeset for help on using the changeset viewer.