From 154384b819442d8eb80aa9617fda43ee9e16507a Mon Sep 17 00:00:00 2001 From: "timeless%mozdev.org" Date: Thu, 2 Jan 2003 12:47:05 +0000 Subject: [PATCH] Bug 136919 TestColorNames is broken r=roc+moz sr=darin git-svn-id: svn://10.0.0.236/trunk@135765 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/gfx/tests/TestColorNames.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/mozilla/gfx/tests/TestColorNames.cpp b/mozilla/gfx/tests/TestColorNames.cpp index 85975220ae9..4cd04b2b729 100644 --- a/mozilla/gfx/tests/TestColorNames.cpp +++ b/mozilla/gfx/tests/TestColorNames.cpp @@ -59,6 +59,9 @@ int main(int argc, char** argv) nsColorName index; int rv = 0; + // Everything appears to assert if we don't do this first... + nsColorNames::AddRefTable(); + // First make sure we can find all of the tags that are supposed to // be in the table. Futz with the case to make sure any case will // work @@ -68,6 +71,11 @@ int main(int argc, char** argv) // Lookup color by name and make sure it has the right id index = nsColorName(PRInt32(index) + 1); nsCString tagName(nsColorNames::GetStringValue(index)); + if (tagName.IsEmpty()) { + printf("bug: tagName for nsColorNames::GetStringValue(%d) is ''\n", index); + rv = -1; + continue; + } id = nsColorNames::LookupName(NS_ConvertASCIItoUCS2(tagName)); if (id == eColorName_UNKNOWN) {