result = nsComponentManager::FindFactory(kLocaleFactoryCID, getter_AddRefs(localeFactory));
localeFactory = do_GetClassObject(kLocaleFactoryCID, &result);
factory_new_locale(void){	nsresult			result;	nsCOMPtr<nsILocaleFactory>	localeFactory;	nsCOMPtr<nsILocale>	locale;	nsString*			*category, *value;	int	i;	nsString**			categoryList, **valueList;	PRUnichar *lc_name_unichar;	result = nsComponentManager::FindFactory(kLocaleFactoryCID,										getter_AddRefs(localeFactory));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_create_interface failed");	//	// test NewLocale	//	nsAutoString localeName(NS_LITERALSTRING("ja-JP"));	result = localeFactory->NewLocale(localeName, getter_AddRefs(locale));	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_new_interface failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_new_interface failed");	for(i=0;i<6;i++)	{		category = new nsString(localeCategoryList[i]);		value = new nsString();		result = locale->GetCategory(category, &lc_name_unichar);		NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_new_interface failed");	    value->SetString(lc_name_unichar);		delete category;		delete value;	}	categoryList = new nsStringArray(6);	valueList = new nsStringArray(6);	for(i=0;i<6;i++)	{		categoryList.InsertStringAt(localeCategoryList[i], i);		valueList[i] = InsertStringAt(NS_LITERAL_STRING("x-netscape"), i);	}	result = localeFactory->NewLocale(categoryList,valueList,6,&locale);	NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_new_interface failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_new_interface failed");	for(i=0;i<6;i++)	{		value = new nsString();		result = locale->GetCategory(categoryList[i], &lc_name_unichar);		NS_ASSERTION(NS_SUCCEEDED(result),"nsLocaleTest: factory_new_interface failed");    value->SetString(lc_name_unichar);		delete value;	}	for(i=0;i<6;i++)	{		delete categoryList.RemoveStringAt(i);		delete valueList.RemoveStringAt(i);	}	delete  categoryList;	delete  valueList;}