From f4d52efe5b697b5debd717b6417536d9464c7c39 Mon Sep 17 00:00:00 2001 From: "ftang%netscape.com" Date: Wed, 30 Dec 1998 21:06:18 +0000 Subject: [PATCH] test the result for all the return vaule from nsRepository git-svn-id: svn://10.0.0.236/trunk@17007 18797224-902f-48f8-a5cc-f745e15eee43 --- .../unicharutil/tests/UnicharSelfTest.cpp | 22 +++++++++++++------ 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/mozilla/modules/unicharutil/tests/UnicharSelfTest.cpp b/mozilla/modules/unicharutil/tests/UnicharSelfTest.cpp index 84c6f610931..392c66927e9 100644 --- a/mozilla/modules/unicharutil/tests/UnicharSelfTest.cpp +++ b/mozilla/modules/unicharutil/tests/UnicharSelfTest.cpp @@ -236,24 +236,25 @@ void TestCaseConversion() cout << "Start nsICaseConversion Test \n"; cout << "==============================\n"; nsICaseConversion *t = NULL; - nsRepository::CreateInstance(kUnicharUtilCID, + nsresult res; + res = nsRepository::CreateInstance(kUnicharUtilCID, NULL, kCaseConversionIID, (void**) &t); cout << "Test 1 - CreateInstance():\n"; - if( t == NULL ) { + if(( NS_OK != res) || ( t == NULL ) ) { cout << "\t1st CreateInstance failed\n"; } else { t->Release(); } - nsRepository::CreateInstance(kUnicharUtilCID, + res = nsRepository::CreateInstance(kUnicharUtilCID, NULL, kCaseConversionIID, (void**) &t); - if( t == NULL ) { + if(( NS_OK != res) || ( t == NULL ) ) { cout << "\t2nd CreateInstance failed\n"; } else { int i; @@ -343,10 +344,13 @@ void TestCaseConversion() void RegisterFactories() { - nsRepository::RegisterFactory(kUnicharUtilCID, + nsresult res; + res = nsRepository::RegisterFactory(kUnicharUtilCID, UNICHARUTIL_DLL_NAME, PR_FALSE, PR_TRUE); + if(NS_OK != res) + cout << "RegisterFactory failed\n"; } int main(int argc, char** argv) { @@ -361,8 +365,12 @@ int main(int argc, char** argv) { // -------------------------------------------- cout << "Finish All The Test Cases\n"; - nsRepository::FreeLibraries(); + nsresult res; + res = nsRepository::FreeLibraries(); - cout << "nsRepository FreeLibraries Done\n"; + if(NS_OK != res) + cout << "nsRepository failed\n"; + else + cout << "nsRepository FreeLibraries Done\n"; return 0; }