summaryrefslogtreecommitdiffstats
path: root/base/values_unittest.cc
diff options
context:
space:
mode:
authordeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 14:57:51 +0000
committerdeanm@google.com <deanm@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2008-08-13 14:57:51 +0000
commit836061bde615432d5dfcce8c26a23f217bfdbd29 (patch)
treee3ce26474403b1c8364ddaaeec4b55f1b46b162e /base/values_unittest.cc
parent954d58c4d2bd4499ed61da01ee22684669e12f28 (diff)
downloadchromium_src-836061bde615432d5dfcce8c26a23f217bfdbd29.zip
chromium_src-836061bde615432d5dfcce8c26a23f217bfdbd29.tar.gz
chromium_src-836061bde615432d5dfcce8c26a23f217bfdbd29.tar.bz2
Don't cast negative values to unsigned. This eliminates warnings in GCC.
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@799 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'base/values_unittest.cc')
-rw-r--r--base/values_unittest.cc5
1 files changed, 4 insertions, 1 deletions
diff --git a/base/values_unittest.cc b/base/values_unittest.cc
index 40422bb..2080d07 100644
--- a/base/values_unittest.cc
+++ b/base/values_unittest.cc
@@ -27,6 +27,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+#include <limits>
+
#include "base/values.h"
#include "testing/gtest/include/gtest/gtest.h"
@@ -174,7 +176,8 @@ TEST(ValuesTest, ListRemoval) {
list.Append(new DeletionTestValue(&deletion_flag));
EXPECT_FALSE(deletion_flag);
EXPECT_EQ(1, list.GetSize());
- EXPECT_FALSE(list.Remove(-1, &removed_item));
+ EXPECT_FALSE(list.Remove(std::numeric_limits<size_t>::max(),
+ &removed_item));
EXPECT_FALSE(list.Remove(1, &removed_item));
EXPECT_TRUE(list.Remove(0, &removed_item));
ASSERT_TRUE(removed_item);