delete localeName;
factory_new_locale(void){	nsresult			result;	nsILocaleFactory*	localeFactory;	nsILocale*			locale;	nsString*			localeName, *catagory, *value;	int	i;	nsString**			catagoryList, **valueList;	result = nsComponentManager::FindFactory(kLocaleFactoryCID,										(nsIFactory**)&localeFactory);	NS_ASSERTION(localeFactory!=NULL,"nsLocaleTest: factory_create_interface failed.");	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_create_interface failed");	//	// test NewLocale	//	localeName = new nsString("ja-JP");	result = localeFactory->NewLocale(localeName,&locale);	NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_new_interface failed");	NS_ASSERTION(locale!=NULL,"nsLocaleTest: factory_new_interface failed");	for(i=0;i<6;i++)	{		catagory = new nsString(localeCatagoryList[i]);		value = new nsString();		result = locale->GetCatagory(catagory,value);		NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_new_interface failed");		NS_ASSERTION(value->Equals(*localeName)==PR_TRUE,"nsLocaleTest: factory_new_interface failed");			delete catagory;		delete value;	}	locale->Release();	catagoryList = new nsString*[6];	valueList = new nsString*[6];	for(i=0;i<6;i++)	{		catagoryList[i] = new nsString(localeCatagoryList[i]);		valueList[i] = new nsString("x-netscape");	}	result = localeFactory->NewLocale(catagoryList,valueList,6,&locale);	NS_ASSERTION(result==NS_OK,"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->GetCatagory(catagoryList[i],value);		NS_ASSERTION(result==NS_OK,"nsLocaleTest: factory_new_interface failed");		NS_ASSERTION(value->Equals(*(valueList[i]))==PR_TRUE,"nsLocaleTest: factory_new_interface failed");		delete value;	}	for(i=0;i<6;i++)	{		delete catagoryList[i];		delete valueList[i];	}	delete [] catagoryList;	delete [] valueList;	locale->Release();	localeFactory->Release();}