return 0;
return rv;
int main(int argc, char** argv){  PRInt32 id;  int rv = 0;  // 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  const nsColorNames::NameTableEntry* et = &nsColorNames::kNameTable[0];  const nsColorNames::NameTableEntry* end = &nsColorNames::kNameTable[COLOR_MAX];  while (et < end) {    // Lookup color by name and make sure it has the right id    char tagName[100];    id = nsColorNames::LookupName(et->name);    if (id < 0) {      printf("bug: can't find '%s'\n", et->name);      rv = -1;    }    if (et->id != id) {      printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id);      rv = -1;    }    // fiddle with the case to make sure we can still find it    strcpy(tagName, et->name);    tagName[0] = tagName[0] - 32;    id = nsColorNames::LookupName(tagName);    if (id < 0) {      printf("bug: can't find '%s'\n", tagName);      rv = -1;    }    if (et->id != id) {      printf("bug: name='%s' et->id=%d id=%d\n", et->name, et->id, id);      rv = -1;    }    // Check that color lookup by name gets the right rgb value    nscolor rgb;    if (!NS_ColorNameToRGB(et->name, &rgb)) {      printf("bug: name='%s' didn't NS_ColorNameToRGB\n", et->name);      rv = -1;    }    if (nsColorNames::kColors[et->id] != rgb) {      printf("bug: name='%s' ColorNameToRGB=%x kColors[%d]=%x\n",             et->name, rgb, nsColorNames::kColors[et->id]);      rv = -1;    }    // Check that parsing an RGB value in hex gets the right values    PRUint8 r = NS_GET_R(rgb);    PRUint8 g = NS_GET_G(rgb);    PRUint8 b = NS_GET_B(rgb);    char cbuf[50];    PR_snprintf(cbuf, sizeof(cbuf), "#%02x%02x%02x", r, g, b);    nscolor hexrgb;    if (!NS_HexToRGB(cbuf, &hexrgb)) {      printf("bug: hex conversion to color of '%s' failed\n", cbuf);      rv = -1;    }    if (!NS_HexToRGB(cbuf + 1, &hexrgb)) {      printf("bug: hex conversion to color of '%s' failed\n", cbuf);      rv = -1;    }    if (hexrgb != rgb) {      printf("bug: rgb=%x hexrgb=%x\n", rgb, hexrgb);      rv = -1;    }    et++;  }  // Now make sure we don't find some garbage  for (int i = 0; i < sizeof(kJunkNames) / sizeof(const char*); i++) {    const char* tag = kJunkNames[i];    id = nsColorNames::LookupName(tag);    if (id >= 0) {      printf("bug: found '%s'\n", tag ? tag : "(null)");      rv = -1;    }  }  return 0;}