cout << "locale setting for collation is "; DebugDump(localeStr, cout);
printf("locale setting for collation is "); DebugDump(localeStr);
int main(int argc, char** argv) {#ifdef XP_MAC  char *mac_argv[kMaxArgs];  argc = make_args(mac_argv);  argv = mac_argv;#endif//XP_MAC  nsCOMPtr<nsILocale> locale;  nsresult res; 	nsCOMPtr<nsILocaleFactory>	localeFactory;	res = nsComponentManager::FindFactory(kLocaleFactoryCID, getter_AddRefs(localeFactory));   if (NS_FAILED(res) || localeFactory == nsnull) cout << "FindFactory nsILocaleFactory failed\n";  res = localeFactory->GetApplicationLocale(getter_AddRefs(locale));  if (NS_FAILED(res) || locale == nsnull) cout << "GetApplicationLocale failed\n";    // --------------------------------------------    nsCollationStrength strength = kCollationCaseInSensitive;    FILE *fp = NULL;  if (argc == 1) {    TestCollation(locale);    TestSort(locale, kCollationCaseInSensitive, NULL);    TestDateTimeFormat(locale);  }  else {    char *s;    s = find_option(argc, argv, "-h");    if (s) {      cout << argv[0] << g_usage;      return 0;    }    s = find_option(argc, argv, "-v");    if (s) {      g_verbose = PR_TRUE;      //test for locale      Test_nsLocale();    }    s = get_option(argc, argv, "-f");    if (s) {      fp = fopen(s, "r");    }    s = get_option(argc, argv, "-o");    if (s) {      g_outfp = fopen(s, "w");    }    s = find_option(argc, argv, "-case");    if (s) {      strength = kCollationCaseSensitive;    }    s = get_option(argc, argv, "-locale");    if (s) {      nsString localeName(s);      res = NewLocale(localeName, getter_AddRefs(locale));  // reset the locale    }    // print locale string    nsAutoString localeStr;    locale->GetCategory(NS_LITERAL_STRING("NSILOCALE_COLLATE"), localeStr);    cout << "locale setting for collation is ";    DebugDump(localeStr, cout);    locale->GetCategory(NS_LITERAL_STRING("NSILOCALE_TIME"), localeStr);    cout << "locale setting for time is ";    DebugDump(localeStr, cout);    while (argc--) {      if (!strcmp(argv[argc], "-col"))        TestCollation(locale);      else if (!strcmp(argv[argc], "-sort"))        TestSort(locale, strength, fp);      else if (!strcmp(argv[argc], "-date"))        TestDateTimeFormat(locale);    }    if (fp != NULL) {      fclose(fp);    }    if (g_outfp != NULL) {      fclose(g_outfp);    }  }  // --------------------------------------------  cout << "Finish All The Test Cases\n";  res = nsComponentManager::FreeLibraries();  if(NS_FAILED(res))    cout << "nsComponentManager failed\n";  else    cout << "nsComponentManager FreeLibraries Done\n";    return 0;}