Browse Source

Yay, all tests are green now! \o/

master
roker 4 months ago
parent
commit
39e8dd2d10
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      test/unittest_stringpair.cc

+ 3
- 2
test/unittest_stringpair.cc View File

@ -47,7 +47,7 @@ TEST( StringPair, Dynamic )
spl.push_back( pEp::StringPair{key, value} );
}
auto find_by_key = [key](const ::stringpair_t* sp){ return strcmp(sp->key, key)==0; };
auto find_by_key = [&key](const ::stringpair_t* sp){ return strcmp(sp->key, key)==0; };
// delete random elements.
for(unsigned u=0; u<NumberOfElements; ++u)
@ -56,7 +56,8 @@ TEST( StringPair, Dynamic )
snprintf(key, 15, "k%u", (u*7) % NumberOfElements); // permutate keys order
auto q = std::find_if( spl.begin(), spl.end(), find_by_key );
EXPECT_NE( q, spl.end() ); // element with key is found
ASSERT_NE( q, spl.end() ); // element with key is found
EXPECT_STREQ( q->key, key);
spl.erase(q);
q = std::find_if( spl.begin(), spl.end(), find_by_key );


Loading…
Cancel
Save