Changeset 3616


Ignore:
Timestamp:
Feb 6, 2017, 6:31:02 AM (6 years ago)
Author:
Peter
Message:

merge r3612 to 0.14.x branch. refs #884

Location:
branches/0.14-stable
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/0.14-stable

    • Property svn:mergeinfo changed
      /trunk (added)merged: 3612
  • branches/0.14-stable/test/vector.cc

    r3550 r3616  
    5454void test_sort(test::Suite&);
    5555void test_vector_mutable_assignment(test::Suite&);
     56void test_aliasing(test::Suite&);
    5657
    5758int main(int argc,char* argv[])
     
    358359  // test for ticket 840
    359360  test_vector_mutable_assignment(suite);
     361  test_aliasing(suite);
    360362
    361363  return suite.return_value();
     
    430432  test_assign4(view, vec);
    431433}
     434
     435void test_aliasing(test::Suite& suite)
     436{
     437  utility::Vector vec(10, 1);
     438  utility::VectorView view(vec, 0, 5, 2);
     439  utility::VectorConstView const_view(vec, 0, 5, 1);
     440  view += const_view;
     441  suite.out() << "result: " << view << "\n";
     442  for (size_t i=0; i<view.size(); ++i) {
     443    if (i==2 || i==4)
     444      suite.xadd(suite.equal(view(i), 2));
     445    else
     446      suite.add(suite.equal(view(i), 2));
     447  }
     448}
Note: See TracChangeset for help on using the changeset viewer.