Browse Source

Yay, all tests are green now! \o/

master
roker 4 years ago
parent
commit
39e8dd2d10
  1. 5
      test/unittest_stringpair.cc

5
test/unittest_stringpair.cc

@ -47,7 +47,7 @@ TEST( StringPair, Dynamic )
spl.push_back( pEp::StringPair{key, value} ); 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. // delete random elements.
for(unsigned u=0; u<NumberOfElements; ++u) 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 snprintf(key, 15, "k%u", (u*7) % NumberOfElements); // permutate keys order
auto q = std::find_if( spl.begin(), spl.end(), find_by_key ); 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); spl.erase(q);
q = std::find_if( spl.begin(), spl.end(), find_by_key ); q = std::find_if( spl.begin(), spl.end(), find_by_key );

Loading…
Cancel
Save