From d4d27675a8417c837e09d1e32112814db2861a5b Mon Sep 17 00:00:00 2001 From: "hellner@google.com" Date: Thu, 23 Jun 2011 17:30:17 +0000 Subject: [PATCH] Minor update that fixes crash in system wrappers unittest. (the crash was in the test of map_wrapper). Review URL: http://webrtc-codereview.appspot.com/45007 git-svn-id: http://webrtc.googlecode.com/svn/trunk@124 4adac7df-926f-26a2-2b94-8c16560cd09d --- system_wrappers/source/map_unittest.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/system_wrappers/source/map_unittest.cc b/system_wrappers/source/map_unittest.cc index 0d112301a7..9e17637f57 100644 --- a/system_wrappers/source/map_unittest.cc +++ b/system_wrappers/source/map_unittest.cc @@ -210,6 +210,8 @@ TEST_F(MapWrapperTest, CopyTest) { ASSERT_TRUE(CreateAscendingMap(&compare_map)); const int map_size = compare_map.Size(); ASSERT_EQ(ascending_map_.Size(), map_size); + // CompareMaps compare the pointers not value of the pointers. + // (the values are the same since both are ascending maps). EXPECT_FALSE(CompareMaps(compare_map,ascending_map_)); int copy_count = 0; @@ -217,7 +219,7 @@ TEST_F(MapWrapperTest, CopyTest) { while (ascend_item != NULL) { MapItem* compare_item = compare_map.Find(ascend_item->GetId()); ASSERT_FALSE(compare_item == NULL); - DeleteItemContent(ascend_item); + DeleteItemContent(compare_item); compare_item->SetItem(ascend_item->GetItem()); ascend_item = ascending_map_.Next(ascend_item); ++copy_count;