Add find_with tests for nonintrusive and k/v lists.
authorMike Krinkin <krinkin.m.u@gmail.com>
Sat, 28 Mar 2015 12:07:20 +0000 (15:07 +0300)
committerMike Krinkin <krinkin.m.u@gmail.com>
Sat, 28 Mar 2015 12:23:48 +0000 (15:23 +0300)
It is just a fixed version of tests for ordered nonintrusive and
key/value lists.

tests/test-hdr/unordered_list/hdr_lazy.h
tests/test-hdr/unordered_list/hdr_lazy_kv.h

index 2c6ae89effdcbdc4deda7d323db24cc47f879667..7321c08d56870fbde9081042cd26566380db9bc1 100644 (file)
@@ -161,6 +161,11 @@ namespace unordlist {
             CPPUNIT_ASSERT( it->nKey == 100 );
             CPPUNIT_ASSERT( it->nVal == 33 );
 
+            it = l.find_with( 150, equal_to<value_type>() );
+            CPPUNIT_ASSERT( it != l.end() );
+            CPPUNIT_ASSERT( it->nKey == 150 );
+            CPPUNIT_ASSERT( it->nVal == it->nKey * 2 );
+
             CPPUNIT_ASSERT( !l.empty() );
             l.clear();
             CPPUNIT_ASSERT( l.empty() );
index cf3c4d203f8b6aa7f459c2a10417c2b85999b292..ab37f57f53f3be296afe4c0bed08de54d7ce19cc 100644 (file)
@@ -83,6 +83,7 @@ namespace unordlist {
                 CPPUNIT_ASSERT( it.key() == 100 );
                 CPPUNIT_ASSERT( it.val().m_val == 0 );
 
+                CPPUNIT_ASSERT( l.find_with( 50, eq<key_type>() ) == l.end() );
                 CPPUNIT_ASSERT( l.insert( 50, 500 ) != l.end());
                 it = l.find( 50 );
                 CPPUNIT_ASSERT( it != l.end() );