cout << "\tFailed!! memory allocation failed.\n";
printf("\tFailed!! memory allocation failed.\n");
static nsresult CreateCollationKey(nsICollation *t, nsCollationStrength strength,                                    nsString& stringIn, PRUint8 **aKey, PRUint32 *keyLength){  nsresult res;    // create a raw collation key  res = t->GetSortKeyLen(strength, stringIn, keyLength);  if(NS_FAILED(res)) {    cout << "\tFailed!! return value != NS_OK\n";  }  *aKey = (PRUint8 *) new PRUint8[*keyLength];  if (NULL == *aKey) {    cout << "\tFailed!! memory allocation failed.\n";  }  res = t->CreateRawSortKey(strength, stringIn, *aKey, keyLength);  if(NS_FAILED(res)) {    cout << "\tFailed!! return value != NS_OK\n";  }  // create a key in nsString  nsString aKeyString;  res = t->CreateSortKey(strength, stringIn, aKeyString);  if(NS_FAILED(res)) {    cout << "\tFailed!! return value != NS_OK\n";  }  // compare the generated key  nsString tempString;  tempString.SetString((PRUnichar *) *aKey, *keyLength / sizeof(PRUnichar));  NS_ASSERTION(aKeyString == tempString, "created key mismatch");  return res;}