Backed out changeset 186127d71076 (bug 1126295) because of test bustage on Windows on a CLOSED TREE
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 27 Jan 2015 13:47:44 -0500
changeset 239433 d0116a0ee30dff3a4cdeecbb2681a6d195692c2c
parent 239432 00afd1e64aa02f3ad8a5a74adba431060d633b48
child 239434 c261ba48dacbafa809c0614a0ef9c984f1e4ed46
child 239477 35f422e0053ccd5bb3d6096675222f0a97985be8
push id497
push usermleibovic@mozilla.com
push dateWed, 28 Jan 2015 16:43:37 +0000
bugs1126295
milestone38.0a1
backs out186127d710767bf094464a151d5f88b3157992f5
Backed out changeset 186127d71076 (bug 1126295) because of test bustage on Windows on a CLOSED TREE
xpcom/tests/TestAtoms.cpp
xpcom/tests/UTFStrings.h
xpcom/tests/gtest/TestAtoms.cpp
xpcom/tests/gtest/UTFStrings.h
xpcom/tests/gtest/moz.build
xpcom/tests/moz.build
rename from xpcom/tests/gtest/TestAtoms.cpp
rename to xpcom/tests/TestAtoms.cpp
--- a/xpcom/tests/gtest/TestAtoms.cpp
+++ b/xpcom/tests/TestAtoms.cpp
@@ -6,122 +6,140 @@
 #include "mozilla/ArrayUtils.h"
 
 #include "nsIAtom.h"
 #include "nsString.h"
 #include "UTFStrings.h"
 #include "nsIServiceManager.h"
 #include "nsStaticAtom.h"
 
-#include "gtest/gtest.h"
-
 using namespace mozilla;
 
 namespace TestAtoms {
 
-TEST(Atoms, Basic)
+bool
+test_basic()
 {
   for (unsigned int i = 0; i < ArrayLength(ValidStrings); ++i) {
     nsDependentString str16(ValidStrings[i].m16);
     nsDependentCString str8(ValidStrings[i].m8);
 
     nsCOMPtr<nsIAtom> atom = do_GetAtom(str16);
-
-    EXPECT_TRUE(atom->Equals(str16));
-    EXPECT_TRUE(atom->EqualsUTF8(str8));
+    
+    if (!atom->Equals(str16) || !atom->EqualsUTF8(str8))
+      return false;
 
     nsString tmp16;
     nsCString tmp8;
     atom->ToString(tmp16);
     atom->ToUTF8String(tmp8);
-    EXPECT_TRUE(str16.Equals(tmp16));
-    EXPECT_TRUE(str8.Equals(tmp8));
+    if (!str16.Equals(tmp16) || !str8.Equals(tmp8))
+      return false;
 
-    EXPECT_TRUE(nsDependentString(atom->GetUTF16String()).Equals(str16));
+    if (!nsDependentString(atom->GetUTF16String()).Equals(str16))
+      return false;
 
-    EXPECT_TRUE(nsAtomString(atom).Equals(str16));
-    EXPECT_TRUE(nsDependentAtomString(atom).Equals(str16));
-    EXPECT_TRUE(nsAtomCString(atom).Equals(str8));
+    if (!nsAtomString(atom).Equals(str16) ||
+        !nsDependentAtomString(atom).Equals(str16) ||
+        !nsAtomCString(atom).Equals(str8))
+      return false;
   }
+  
+  return true;
 }
 
-TEST(Atoms, 16vs8)
+bool
+test_16vs8()
 {
   for (unsigned int i = 0; i < ArrayLength(ValidStrings); ++i) {
     nsCOMPtr<nsIAtom> atom16 = do_GetAtom(ValidStrings[i].m16);
     nsCOMPtr<nsIAtom> atom8 = do_GetAtom(ValidStrings[i].m8);
-    EXPECT_EQ(atom16, atom8);
+    if (atom16 != atom8)
+      return false;
   }
+  
+  return true;
 }
 
-TEST(Atoms, BufferSharing)
+bool
+test_buffersharing()
 {
   nsString unique;
   unique.AssignLiteral("this is a unique string !@#$");
-
+  
   nsCOMPtr<nsIAtom> atom = do_GetAtom(unique);
-
-  EXPECT_EQ(unique.get(), atom->GetUTF16String());
+  
+  return unique.get() == atom->GetUTF16String();
 }
 
-TEST(Atoms, NUll)
+bool
+test_null()
 {
   nsAutoString str(NS_LITERAL_STRING("string with a \0 char"));
   nsDependentString strCut(str.get());
 
-  EXPECT_FALSE(str.Equals(strCut));
-
+  if (str.Equals(strCut))
+    return false;
+  
   nsCOMPtr<nsIAtom> atomCut = do_GetAtom(strCut);
   nsCOMPtr<nsIAtom> atom = do_GetAtom(str);
-
-  EXPECT_EQ(atom->GetLength(), str.Length());
-  EXPECT_TRUE(atom->Equals(str));
-  EXPECT_TRUE(atom->EqualsUTF8(NS_ConvertUTF16toUTF8(str)));
-  EXPECT_NE(atom, atomCut);
-  EXPECT_TRUE(atomCut->Equals(strCut));
+  
+  return atom->GetLength() == str.Length() &&
+         atom->Equals(str) &&
+         atom->EqualsUTF8(NS_ConvertUTF16toUTF8(str)) &&
+         atom != atomCut &&
+         atomCut->Equals(strCut);
 }
 
-TEST(Atoms, Invalid)
+bool
+test_invalid()
 {
   for (unsigned int i = 0; i < ArrayLength(Invalid16Strings); ++i) {
     nsrefcnt count = NS_GetNumberOfAtoms();
 
     {
       nsCOMPtr<nsIAtom> atom16 = do_GetAtom(Invalid16Strings[i].m16);
-      EXPECT_TRUE(atom16->Equals(nsDependentString(Invalid16Strings[i].m16)));
+      if (!atom16->Equals(nsDependentString(Invalid16Strings[i].m16)))
+        return false;
     }
-
-    EXPECT_EQ(count, NS_GetNumberOfAtoms());
+    
+    if (count != NS_GetNumberOfAtoms())
+      return false;
   }
 
   for (unsigned int i = 0; i < ArrayLength(Invalid8Strings); ++i) {
     nsrefcnt count = NS_GetNumberOfAtoms();
 
     {
       nsCOMPtr<nsIAtom> atom8 = do_GetAtom(Invalid8Strings[i].m8);
       nsCOMPtr<nsIAtom> atom16 = do_GetAtom(Invalid8Strings[i].m16);
-      EXPECT_EQ(atom16, atom8);
-      EXPECT_TRUE(atom16->Equals(nsDependentString(Invalid8Strings[i].m16)));
+      if (atom16 != atom8 ||
+          !atom16->Equals(nsDependentString(Invalid8Strings[i].m16)))
+        return false;
     }
-
-    EXPECT_EQ(count, NS_GetNumberOfAtoms());
+    
+    if (count != NS_GetNumberOfAtoms())
+      return false;
   }
 
 // Don't run this test in debug builds as that intentionally asserts.
 #ifndef DEBUG
   nsCOMPtr<nsIAtom> emptyAtom = do_GetAtom("");
 
   for (unsigned int i = 0; i < ArrayLength(Malformed8Strings); ++i) {
     nsrefcnt count = NS_GetNumberOfAtoms();
 
     nsCOMPtr<nsIAtom> atom8 = do_GetAtom(Malformed8Strings[i]);
-    EXPECT_EQ(atom8, emptyAtom);
-    EXPECT_EQ(count, NS_GetNumberOfAtoms());
+    if (atom8 != emptyAtom ||
+        count != NS_GetNumberOfAtoms())
+      return false;
   }
 #endif
+
+  return true;
 }
 
 #define FIRST_ATOM_STR "first static atom. Hello!"
 #define SECOND_ATOM_STR "second static atom. @World!"
 #define THIRD_ATOM_STR "third static atom?!"
 
 static nsIAtom* sAtom1 = 0;
 static nsIAtom* sAtom2 = 0;
@@ -144,67 +162,117 @@ isStaticAtom(nsIAtom* atom)
   return (atom->AddRef() == 2) &
          (atom->AddRef() == 2) &
          (atom->AddRef() == 2) &
          (atom->Release() == 1) &
          (atom->Release() == 1) &
          (atom->Release() == 1);
 }
 
-TEST(Atoms, Table)
+bool
+test_atomtable()
 {
   nsrefcnt count = NS_GetNumberOfAtoms();
-
+  
   nsCOMPtr<nsIAtom> thirdNonPerm = do_GetAtom(THIRD_ATOM_STR);
+  
+  if (isStaticAtom(thirdNonPerm))
+    return false;
 
-  EXPECT_FALSE(isStaticAtom(thirdNonPerm));
-
-  EXPECT_TRUE(thirdNonPerm);
-  EXPECT_EQ(NS_GetNumberOfAtoms(), count + 1);
+  if (!thirdNonPerm || NS_GetNumberOfAtoms() != count + 1)
+    return false;
 
   NS_RegisterStaticAtoms(sAtoms_info);
 
-  EXPECT_TRUE(sAtom1);
-  EXPECT_TRUE(sAtom1->Equals(NS_LITERAL_STRING(FIRST_ATOM_STR)));
-  EXPECT_TRUE(isStaticAtom(sAtom1));
-  EXPECT_TRUE(sAtom2);
-  EXPECT_TRUE(sAtom2->Equals(NS_LITERAL_STRING(SECOND_ATOM_STR)));
-  EXPECT_TRUE(isStaticAtom(sAtom2));
-  EXPECT_TRUE(sAtom3);
-  EXPECT_TRUE(sAtom3->Equals(NS_LITERAL_STRING(THIRD_ATOM_STR)));
-  EXPECT_TRUE(isStaticAtom(sAtom3));
-  EXPECT_EQ(NS_GetNumberOfAtoms(), count + 3);
-  EXPECT_EQ(thirdNonPerm, sAtom3);
+  return sAtom1 &&
+         sAtom1->Equals(NS_LITERAL_STRING(FIRST_ATOM_STR)) &&
+         isStaticAtom(sAtom1) &&
+         sAtom2 &&
+         sAtom2->Equals(NS_LITERAL_STRING(SECOND_ATOM_STR)) &&
+         isStaticAtom(sAtom2) &&
+         sAtom3 &&
+         sAtom3->Equals(NS_LITERAL_STRING(THIRD_ATOM_STR)) &&
+         isStaticAtom(sAtom3) &&
+         NS_GetNumberOfAtoms() == count + 3 &&
+         thirdNonPerm == sAtom3;
 }
 
 #define FIRST_PERM_ATOM_STR "first permanent atom. Hello!"
 #define SECOND_PERM_ATOM_STR "second permanent atom. @World!"
 
-TEST(Atoms, Permanent)
+bool
+test_permanent()
 {
   nsrefcnt count = NS_GetNumberOfAtoms();
 
   {
     nsCOMPtr<nsIAtom> first = do_GetAtom(FIRST_PERM_ATOM_STR);
-    EXPECT_TRUE(first->Equals(NS_LITERAL_STRING(FIRST_PERM_ATOM_STR)));
-    EXPECT_FALSE(isStaticAtom(first));
-
+    if (!first->Equals(NS_LITERAL_STRING(FIRST_PERM_ATOM_STR)) ||
+        isStaticAtom(first))
+      return false;
+  
     nsCOMPtr<nsIAtom> first_p =
       NS_NewPermanentAtom(NS_LITERAL_STRING(FIRST_PERM_ATOM_STR));
-    EXPECT_TRUE(first_p->Equals(NS_LITERAL_STRING(FIRST_PERM_ATOM_STR)));
-    EXPECT_TRUE(isStaticAtom(first_p));
-    EXPECT_EQ(first, first_p);
-
+    if (!first_p->Equals(NS_LITERAL_STRING(FIRST_PERM_ATOM_STR)) ||
+        !isStaticAtom(first_p) ||
+        first != first_p)
+      return false;
+  
     nsCOMPtr<nsIAtom> second_p =
       NS_NewPermanentAtom(NS_LITERAL_STRING(SECOND_PERM_ATOM_STR));
-    EXPECT_TRUE(second_p->Equals(NS_LITERAL_STRING(SECOND_PERM_ATOM_STR)));
-    EXPECT_TRUE(isStaticAtom(second_p));
-
+    if (!second_p->Equals(NS_LITERAL_STRING(SECOND_PERM_ATOM_STR)) ||
+        !isStaticAtom(second_p))
+      return false;
+  
     nsCOMPtr<nsIAtom> second = do_GetAtom(SECOND_PERM_ATOM_STR);
-    EXPECT_TRUE(second->Equals(NS_LITERAL_STRING(SECOND_PERM_ATOM_STR)));
-    EXPECT_TRUE(isStaticAtom(second));
-    EXPECT_EQ(second, second_p);
+    if (!second->Equals(NS_LITERAL_STRING(SECOND_PERM_ATOM_STR)) ||
+        !isStaticAtom(second) ||
+        second != second_p)
+      return false;
   }
 
-  EXPECT_EQ(NS_GetNumberOfAtoms(), count + 2);
+  return NS_GetNumberOfAtoms() == count + 2;
 }
 
+typedef bool (*TestFunc)();
+
+static const struct Test
+  {
+    const char* name;
+    TestFunc    func;
+  }
+tests[] =
+  {
+    { "test_basic", test_basic },
+    { "test_16vs8", test_16vs8 },
+    { "test_buffersharing", test_buffersharing },
+    { "test_null", test_null },
+    { "test_invalid", test_invalid },
+// FIXME: Bug 577500 TestAtoms fails when run in dist/bin due to
+// static atom table already being closed. TestStaticAtoms has similar
+// failure.
+#if 0
+    { "test_atomtable", test_atomtable },
+    { "test_permanent", test_permanent },
+#endif
+    { nullptr, nullptr }
+  };
+
 }
+
+using namespace TestAtoms;
+
+int main()
+  {
+    {
+      nsCOMPtr<nsIServiceManager> servMan;
+      NS_InitXPCOM2(getter_AddRefs(servMan), nullptr, nullptr);
+  
+      for (const Test* t = tests; t->name != nullptr; ++t)
+        {
+          printf("%25s : %s\n", t->name, t->func() ? "SUCCESS" : "FAILURE <--");
+        }
+    }
+
+    NS_ShutdownXPCOM(nullptr);
+
+    return 0;
+  }
rename from xpcom/tests/gtest/UTFStrings.h
rename to xpcom/tests/UTFStrings.h
--- a/xpcom/tests/gtest/UTFStrings.h
+++ b/xpcom/tests/UTFStrings.h
@@ -13,98 +13,98 @@ struct UTFStringsStringPair
 
 static const UTFStringsStringPair ValidStrings[] =
   {
     { { 'a', 'b', 'c', 'd' },
       { 'a', 'b', 'c', 'd' } },
     { { '1', '2', '3', '4' },
       { '1', '2', '3', '4' } },
     { { 0x7F, 'A', 0x80, 'B', 0x101, 0x200 },
-      { 0x7F, 'A', char(0xC2), char(0x80), 'B', char(0xC4), char(0x81), char(0xC8), char(0x80) } },
+      { 0x7F, 'A', 0xC2, 0x80, 'B', 0xC4, 0x81, 0xC8, 0x80 } },
     { { 0x7FF, 0x800, 0x1000 },
-      { char(0xDF), char(0xBF), char(0xE0), char(0xA0), char(0x80), char(0xE1), char(0x80), char(0x80) } },
+      { 0xDF, 0xBF, 0xE0, 0xA0, 0x80, 0xE1, 0x80, 0x80 } },
     { { 0xD7FF, 0xE000, 0xF00F, 'A', 0xFFF0 },
-      { char(0xED), char(0x9F), char(0xBF), char(0xEE), char(0x80), char(0x80), char(0xEF), char(0x80), char(0x8F), 'A', char(0xEF), char(0xBF), char(0xB0) } },
+      { 0xED, 0x9F, 0xBF, 0xEE, 0x80, 0x80, 0xEF, 0x80, 0x8F, 'A', 0xEF, 0xBF, 0xB0 } },
     { { 0xFFF7, 0xFFFC, 0xFFFD, 0xFFFD },
-      { char(0xEF), char(0xBF), char(0xB7), char(0xEF), char(0xBF), char(0xBC), char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBD) } },
+      { 0xEF, 0xBF, 0xB7, 0xEF, 0xBF, 0xBC, 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD } },
     { { 0xD800, 0xDC00, 0xD800, 0xDCFF },
-      { char(0xF0), char(0x90), char(0x80), char(0x80), char(0xF0), char(0x90), char(0x83), char(0xBF) } },
+      { 0xF0, 0x90, 0x80, 0x80, 0xF0, 0x90, 0x83, 0xBF } },
     { { 0xDBFF, 0xDFFF, 0xDBB7, 0xDCBA },
-      { char(0xF4), char(0x8F), char(0xBF), char(0xBF), char(0xF3), char(0xBD), char(0xB2), char(0xBA) } },
+      { 0xF4, 0x8F, 0xBF, 0xBF, 0xF3, 0xBD, 0xB2, 0xBA } },
     { { 0xFFFD, 0xFFFF },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBF) } },
+      { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBF } },
     { { 0xFFFD, 0xFFFE, 0xFFFF },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBE), char(0xEF), char(0xBF), char(0xBF) } },
+      { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBE, 0xEF, 0xBF, 0xBF } },
   };
 
 static const UTFStringsStringPair Invalid16Strings[] =
   {
     { { 'a', 'b', 0xD800 },
-      { 'a', 'b', char(0xEF), char(0xBF), char(0xBD) } },
+      { 'a', 'b', 0xEF, 0xBF, 0xBD } },
     { { 0xD8FF, 'b' },
-      { char(0xEF), char(0xBF), char(0xBD), 'b' } },
+      { 0xEF, 0xBF, 0xBD, 'b' } },
     { { 0xD821 },
-      { char(0xEF), char(0xBF), char(0xBD) } },
+      { 0xEF, 0xBF, 0xBD } },
     { { 0xDC21 },
-      { char(0xEF), char(0xBF), char(0xBD) } },
+      { 0xEF, 0xBF, 0xBD } },
     { { 0xDC00, 0xD800, 'b' },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBD), 'b' } },
+      { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 'b' } },
     { { 'b', 0xDC00, 0xD800 },
-      { 'b', char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBD) } },
+      { 'b', 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD } },
     { { 0xDC00, 0xD800 },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBD) } },
+      { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD } },
     { { 0xDC00, 0xD800, 0xDC00, 0xD800 },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xF0), char(0x90), char(0x80), char(0x80), char(0xEF), char(0xBF), char(0xBD) } },
+      { 0xEF, 0xBF, 0xBD, 0xF0, 0x90, 0x80, 0x80, 0xEF, 0xBF, 0xBD } },
     { { 0xDC00, 0xD800, 0xD800, 0xDC00 },
-      { char(0xEF), char(0xBF), char(0xBD), char(0xEF), char(0xBF), char(0xBD), char(0xF0), char(0x90), char(0x80), char(0x80) } },
+      { 0xEF, 0xBF, 0xBD, 0xEF, 0xBF, 0xBD, 0xF0, 0x90, 0x80, 0x80 } },
   };
 
 static const UTFStringsStringPair Invalid8Strings[] =
   {
     { { 'a', 0xFFFD, 'b' },
-      { 'a', char(0xC0), char(0x80), 'b' } },
+      { 'a', 0xC0, 0x80, 'b' } },
     { { 0xFFFD, 0x80 },
-      { char(0xC1), char(0xBF), char(0xC2), char(0x80) } },
+      { 0xC1, 0xBF, 0xC2, 0x80 } },
     { { 0xFFFD },
-      { char(0xC1), char(0xBF) } },
+      { 0xC1, 0xBF } },
     { { 0xFFFD, 'x', 0x0800 },
-      { char(0xE0), char(0x80), char(0x80), 'x', char(0xE0), char(0xA0), char(0x80) } },
+      { 0xE0, 0x80, 0x80, 'x', 0xE0, 0xA0, 0x80 } },
     { { 0xFFFD, 'x', 0xFFFD },
-      { char(0xF0), char(0x80), char(0x80), char(0x80), 'x', char(0xF0), char(0x80), char(0x8F), char(0x80) } },
+      { 0xF0, 0x80, 0x80, 0x80, 'x', 0xF0, 0x80, 0x8F, 0x80 } },
     { { 0xFFFD, 0xFFFD },
-      { char(0xF4), char(0x90), char(0x80), char(0x80), char(0xF7), char(0xBF), char(0xBF), char(0xBF) } },
+      { 0xF4, 0x90, 0x80, 0x80, 0xF7, 0xBF, 0xBF, 0xBF } },
     { { 0xFFFD, 'x', 0xD800, 0xDC00, 0xFFFD },
-      { char(0xF0), char(0x8F), char(0xBF), char(0xBF), 'x', char(0xF0), char(0x90), char(0x80), char(0x80), char(0xF0), char(0x8F), char(0xBF), char(0xBF) } },
+      { 0xF0, 0x8F, 0xBF, 0xBF, 'x', 0xF0, 0x90, 0x80, 0x80, 0xF0, 0x8F, 0xBF, 0xBF } },
     { { 0xFFFD, 'x', 0xFFFD },
-      { char(0xF8), char(0x80), char(0x80), char(0x80), char(0x80), 'x', char(0xF8), char(0x88), char(0x80), char(0x80), char(0x80) } },
+      { 0xF8, 0x80, 0x80, 0x80, 0x80, 'x', 0xF8, 0x88, 0x80, 0x80, 0x80 } },
     { { 0xFFFD, 0xFFFD },
-      { char(0xFB), char(0xBF), char(0xBF), char(0xBF), char(0xBF), char(0xFC), char(0xA0), char(0x80), char(0x80), char(0x80), char(0x80) } },
+      { 0xFB, 0xBF, 0xBF, 0xBF, 0xBF, 0xFC, 0xA0, 0x80, 0x80, 0x80, 0x80 } },
     { { 0xFFFD, 0xFFFD },
-      { char(0xFC), char(0x80), char(0x80), char(0x80), char(0x80), char(0x80), char(0xFD), char(0xBF), char(0xBF), char(0xBF), char(0xBF), char(0xBF) } },
+      { 0xFC, 0x80, 0x80, 0x80, 0x80, 0x80, 0xFD, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF } },
   };
 
 // Don't use this array in debug builds as that intentionally asserts.
 #ifndef DEBUG
 static const char Malformed8Strings[][16] =
   {
-    { char(0x80) },
-    { 'a', char(0xC8), 'c' },
-    { 'a', char(0xC0) },
-    { 'a', char(0xE8), 'c' },
-    { 'a', char(0xE8), char(0x80), 'c' },
-    { 'a', char(0xE8), char(0x80) },
-    { char(0xE8), 0x7F, char(0x80) },
-    { 'a', char(0xE8), char(0xE8), char(0x80) },
-    { 'a', char(0xF4) },
-    { 'a', char(0xF4), char(0x80), char(0x80), 'c', 'c' },
-    { 'a', char(0xF4), char(0x80), 'x', char(0x80) },
-    { char(0xF4), char(0x80), char(0x80), char(0x80), char(0x80) },
-    { 'a', char(0xFA), 'c' },
-    { 'a', char(0xFA), char(0x80), char(0x80), 0x7F, char(0x80), 'c' },
-    { 'a', char(0xFA), char(0x80), char(0x80), char(0x80), char(0x80), char(0x80), 'c' },
-    { 'a', char(0xFD) },
-    { 'a', char(0xFD), char(0x80), char(0x80), char(0x80), char(0x80), 'c' },
-    { 'a', char(0xFD), char(0x80), char(0x80), char(0x80), char(0x80), char(0x80), char(0x80) },
-    { 'a', char(0xFC), char(0x80), char(0x80), 0x40, char(0x80), char(0x80), 'c' },
+    { 0x80 },
+    { 'a', 0xC8, 'c' },
+    { 'a', 0xC0 },
+    { 'a', 0xE8, 'c' },
+    { 'a', 0xE8, 0x80, 'c' },
+    { 'a', 0xE8, 0x80 },
+    { 0xE8, 0x7F, 0x80 },
+    { 'a', 0xE8, 0xE8, 0x80 },
+    { 'a', 0xF4 },
+    { 'a', 0xF4, 0x80, 0x80, 'c', 'c' },
+    { 'a', 0xF4, 0x80, 'x', 0x80 },
+    { 0xF4, 0x80, 0x80, 0x80, 0x80 },
+    { 'a', 0xFA, 'c' },
+    { 'a', 0xFA, 0x80, 0x80, 0x7F, 0x80, 'c' },
+    { 'a', 0xFA, 0x80, 0x80, 0x80, 0x80, 0x80, 'c' },
+    { 'a', 0xFD },
+    { 'a', 0xFD, 0x80, 0x80, 0x80, 0x80, 'c' },
+    { 'a', 0xFD, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80 },
+    { 'a', 0xFC, 0x80, 0x80, 0x40, 0x80, 0x80, 'c' },
   };
 #endif
 
 #endif
--- a/xpcom/tests/gtest/moz.build
+++ b/xpcom/tests/gtest/moz.build
@@ -1,16 +1,15 @@
 # -*- Mode: python; c-basic-offset: 4; indent-tabs-mode: nil; tab-width: 40 -*-
 # vim: set filetype=python:
 # This Source Code Form is subject to the terms of the Mozilla Public
 # License, v. 2.0. If a copy of the MPL was not distributed with this
 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
 
 UNIFIED_SOURCES += [
-    'TestAtoms.cpp',
     'TestCRT.cpp',
     'TestEncoding.cpp',
     'TestExpirationTracker.cpp',
     'TestPipes.cpp',
     'TestPriorityQueue.cpp',
     'TestSnappyStreams.cpp',
     'TestStorageStream.cpp',
     'TestStrings.cpp',
--- a/xpcom/tests/moz.build
+++ b/xpcom/tests/moz.build
@@ -78,16 +78,17 @@ if CONFIG['MOZ_MEMORY']:
         'TestJemalloc',
     ])
 
 # XXX Make these tests work in libxul builds.
 #CPP_UNIT_TESTS += [
 #    'TestThreads',
 #    'TestXPIDLString',
 #    'TestUTF',
+#    'TestAtoms',
 #]
 
 # FIXME: bug 577500 TestStaticAtoms fails when run in dist/bin
 #CPP_UNIT_TESTS += [
 #    'TestStaticAtoms',
 #]
 
 if CONFIG['MOZ_DEBUG'] and CONFIG['OS_ARCH'] not in ('WINNT'):