Bug 556559: Fix unsigned/signed comparison warnings in TestTArray.cpp. r=bsmedberg
authorDaniel Holbert <dholbert@cs.stanford.edu>
Fri, 02 Apr 2010 09:34:31 -0700
changeset 40149 ccce7bebe7d98a1795857f821ff2e221e14b43c4
parent 40148 70ba4f81236ffa2614ed5cf2ed7fd7eedd1478d8
child 40150 008e74cf781b0d9d45e696171288bfd46a5cba82
push idunknown
push userunknown
push dateunknown
reviewersbsmedberg
bugs556559
milestone1.9.3a4pre
Bug 556559: Fix unsigned/signed comparison warnings in TestTArray.cpp. r=bsmedberg
xpcom/tests/TestTArray.cpp
--- a/xpcom/tests/TestTArray.cpp
+++ b/xpcom/tests/TestTArray.cpp
@@ -97,17 +97,17 @@ static PRBool test_basic_array(ElementTy
       return PR_FALSE;
     if (ary[i] == ary[i - 1])
       ary.RemoveElementAt(i);
   }
   for (i = 0; i < ary.Length(); ++i) {
     if (ary.BinaryIndexOf(ary[i]) != i)
       return PR_FALSE;
   }
-  if (ary.BinaryIndexOf(extra) != -1)
+  if (ary.BinaryIndexOf(extra) != ary.NoIndex)
     return PR_FALSE;
   PRUint32 oldLen = ary.Length();
   ary.RemoveElement(data[dataLen / 2]);
   if (ary.Length() != (oldLen - 1))
     return PR_FALSE;
 
   PRUint32 index = ary.Length() / 2;
   if (!ary.InsertElementAt(index, extra))
@@ -310,17 +310,17 @@ static PRBool test_string_array() {
       return PR_FALSE;
     if (i > 0 && strArray[i] == strArray[i - 1])
       strArray.RemoveElementAt(i);
   }
   for (i = 0; i < strArray.Length(); ++i) {
     if (strArray.BinaryIndexOf(strArray[i]) != i)
       return PR_FALSE;
   }
-  if (strArray.BinaryIndexOf(EmptyCString()) != -1)
+  if (strArray.BinaryIndexOf(EmptyCString()) != strArray.NoIndex)
     return PR_FALSE;
 
   nsCString rawArray[NS_ARRAY_LENGTH(kdata)-1];
   for (i = 0; i < NS_ARRAY_LENGTH(rawArray); ++i)
     rawArray[i].Assign(kdata + i);  // substrings of kdata
   return test_basic_array(rawArray, NS_ARRAY_LENGTH(rawArray),
                           nsCString("foopy"));
 }
@@ -513,17 +513,17 @@ static PRBool test_autoarray() {
 // if IndexOf finds it.
 static PRBool test_indexof() {
   nsTArray<int> array;
   array.AppendElement(0);
   // add and remove the 5
   array.AppendElement(5);
   array.RemoveElementAt(1);
   // we should not find the 5!
-  return array.IndexOf(5, 1) == -1;
+  return array.IndexOf(5, 1) == array.NoIndex;
 }
 
 //----
 
 typedef PRBool (*TestFunc)();
 #define DECL_TEST(name) { #name, name }
 
 static const struct Test {