X-Git-Url: http://demsky.eecs.uci.edu/git/?a=blobdiff_plain;f=test%2Funit%2Flist%2Ftest_kv_iterable_list.h;h=87c533fc6d3d5740ffd81eeb89329ba7cd64fa6c;hb=744211978eaf0cbcd9139d07b8dfd6f72651b39f;hp=4bb5769641d8e93af1b0822096c3d047e22572aa;hpb=eed2aaece9fe9383c3988c4804c3f8262ed9d6db;p=libcds.git diff --git a/test/unit/list/test_kv_iterable_list.h b/test/unit/list/test_kv_iterable_list.h index 4bb57696..87c533fc 100644 --- a/test/unit/list/test_kv_iterable_list.h +++ b/test/unit/list/test_kv_iterable_list.h @@ -5,7 +5,7 @@ Source code repo: http://github.com/khizmax/libcds/ Download: http://sourceforge.net/projects/libcds/files/ - + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: @@ -237,7 +237,7 @@ namespace cds_test { case 4: { - auto pair = l.update( i.key, []( list_value_type& n, list_value_type* old ) { + auto pair = l.update( i.key, []( list_value_type&, list_value_type* ) { ASSERT_TRUE( false ); }, false ); EXPECT_FALSE( pair.first ); @@ -278,7 +278,7 @@ namespace cds_test { EXPECT_TRUE( ret.second ); EXPECT_TRUE( l.contains( i.key ) ); - ret = l.upsert( i.key, i.val * 12 ); + ret = l.upsert( i.key, i.key * 12 ); EXPECT_TRUE( ret.first ); EXPECT_FALSE( ret.second ); EXPECT_TRUE( l.find( i.key, []( list_value_type& n ) { @@ -303,8 +303,8 @@ namespace cds_test { } )); auto pair = l.update( i.key, []( list_value_type& n, list_value_type* old ) { - EXPECT_FALSE( old == nullptr ); - EXPECT_EQ( n.first.nKey * 5, n.second.val ); + ASSERT_FALSE( old == nullptr ); + EXPECT_EQ( n.first.nKey * 5, old->second.val ); n.second.val = n.first.nKey * 3; }, false ); EXPECT_TRUE( pair.first );