Quick fix for a new test failure on real arm
authorchristian.plesner.hansen <christian.plesner.hansen@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Sat, 6 Sep 2008 13:42:50 +0000 (13:42 +0000)
committerchristian.plesner.hansen <christian.plesner.hansen@ce2b1a6d-e550-0410-aec6-3dcde31c8c00>
Sat, 6 Sep 2008 13:42:50 +0000 (13:42 +0000)
git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@184 ce2b1a6d-e550-0410-aec6-3dcde31c8c00

test/cctest/test-strings.cc

index ba0317569a016326cffce39ee60afbd85dd56551..67b13e1583bc4b5d6602a26e37215c748af61b72 100644 (file)
@@ -359,10 +359,11 @@ TEST(Utf8Conversion) {
   CHECK_EQ(10, mixed->Utf8Length());
   // Try encoding the string with all capacities
   char buffer[11];
+  const char kNoChar = static_cast<char>(-1);
   for (int i = 0; i <= 11; i++) {
     // Clear the buffer before reusing it
     for (int j = 0; j < 11; j++)
-      buffer[j] = static_cast<char>(-1);
+      buffer[j] = kNoChar;
     int written = mixed->WriteUtf8(buffer, i);
     CHECK_EQ(lengths[i], written);
     // Check that the contents are correct
@@ -370,6 +371,6 @@ TEST(Utf8Conversion) {
       CHECK_EQ(as_utf8[j], static_cast<unsigned char>(buffer[j]));
     // Check that the rest of the buffer hasn't been touched
     for (int j = lengths[i]; j < 11; j++)
-      CHECK_EQ(-1, buffer[j]);
+      CHECK_EQ(kNoChar, buffer[j]);
   }
 }