Changeset 103140 in vbox for trunk/src/libs/xpcom18a4/xpcom/tests
- Timestamp:
- Jan 31, 2024 3:01:57 PM (13 months ago)
- svn:sync-xref-src-repo-rev:
- 161388
- Location:
- trunk/src/libs/xpcom18a4/xpcom/tests
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/libs/xpcom18a4/xpcom/tests/TestArray.cpp
r1 r103140 94 94 NS_IMPL_ISUPPORTS1(Foo, IFoo) 95 95 96 const char* AssertEqual(PRInt32 aValue1, PRInt32 aValue2)96 static const char* AssertEqual(PRInt32 aValue1, PRInt32 aValue2) 97 97 { 98 98 if (aValue1 == aValue2) { … … 105 105 } 106 106 107 void DumpArray(nsISupportsArray* aArray, PRInt32 aExpectedCount, PRInt32 aElementIDs[], PRInt32 aExpectedTotal)107 static void DumpArray(nsISupportsArray* aArray, PRInt32 aExpectedCount, PRInt32 aElementIDs[], PRInt32 aExpectedTotal) 108 108 { 109 109 PRUint32 cnt = 0; … … 127 127 } 128 128 129 void FillArray(nsISupportsArray* aArray, PRInt32 aCount)129 static void FillArray(nsISupportsArray* aArray, PRInt32 aCount) 130 130 { 131 131 PRInt32 index; -
trunk/src/libs/xpcom18a4/xpcom/tests/TestCRT.cpp
r102458 r103140 43 43 // The return from strcmp etc is only defined to be postive, zero or 44 44 // negative. The magnitude of a non-zero return is irrelevant. 45 PRIntn sign(PRIntn val) {45 static PRIntn sign(PRIntn val) { 46 46 if (val == 0) 47 47 return 0; -
trunk/src/libs/xpcom18a4/xpcom/tests/TestHashtables.cpp
r102996 r103140 114 114 }; 115 115 116 PLDHashOperator 117 nsTEnumGo(EntityToUnicodeEntry* aEntry, void* userArg) { 116 static PLDHashOperator nsTEnumGo(EntityToUnicodeEntry* aEntry, void* userArg) { 118 117 printf(" enumerated \"%s\" = %u\n", 119 118 aEntry->mNode->mStr, aEntry->mNode->mUnicode); … … 122 121 } 123 122 124 PLDHashOperator 125 nsTEnumStop(EntityToUnicodeEntry* aEntry, void* userArg) { 123 static PLDHashOperator nsTEnumStop(EntityToUnicodeEntry* aEntry, void* userArg) { 126 124 printf(" enumerated \"%s\" = %u\n", 127 125 aEntry->mNode->mStr, aEntry->mNode->mUnicode); … … 130 128 } 131 129 132 void 133 testTHashtable(nsTHashtable<EntityToUnicodeEntry>& hash, PRUint32 numEntries) { 130 static void testTHashtable(nsTHashtable<EntityToUnicodeEntry>& hash, PRUint32 numEntries) { 134 131 printf("Filling hash with %d entries.\n", numEntries); 135 132 … … 190 187 } 191 188 192 PLDHashOperator 193 nsDEnumRead(const PRUint32& aKey, const char* aData, void* userArg) { 189 static PLDHashOperator nsDEnumRead(const PRUint32& aKey, const char* aData, void* userArg) { 194 190 printf(" enumerated %u = \"%s\"\n", aKey, aData); 195 191 return PL_DHASH_NEXT; 196 192 } 197 193 198 PLDHashOperator 199 nsDEnum(const PRUint32& aKey, const char*& aData, void* userArg) { 194 static PLDHashOperator nsDEnum(const PRUint32& aKey, const char*& aData, void* userArg) { 200 195 printf(" enumerated %u = \"%s\"\n", aKey, aData); 201 196 return PL_DHASH_NEXT; 202 197 } 203 198 204 PLDHashOperator 205 nsCEnumRead(const nsACString& aKey, TestUniChar* aData, void* userArg) { 199 static PLDHashOperator nsCEnumRead(const nsACString& aKey, TestUniChar* aData, void* userArg) { 206 200 printf(" enumerated \"%s\" = %u\n", 207 201 PromiseFlatCString(aKey).get(), aData->GetChar()); … … 209 203 } 210 204 211 PLDHashOperator 212 nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) { 205 static PLDHashOperator nsCEnum(const nsACString& aKey, nsAutoPtr<TestUniChar>& aData, void* userArg) { 213 206 printf(" enumerated \"%s\" = %u\n", 214 207 PromiseFlatCString(aKey).get(), aData->GetChar()); … … 346 339 } 347 340 348 nsresult 349 CreateIFoo( IFoo** result ) 341 static nsresult CreateIFoo( IFoo** result ) 350 342 // a typical factory function (that calls AddRef) 351 343 { … … 361 353 } 362 354 363 PLDHashOperator 364 nsIEnumRead(const PRUint32& aKey, IFoo* aFoo, void* userArg) { 355 static PLDHashOperator nsIEnumRead(const PRUint32& aKey, IFoo* aFoo, void* userArg) { 365 356 nsCAutoString str; 366 357 aFoo->GetString(str); … … 370 361 } 371 362 372 PLDHashOperator 373 nsIEnum(const PRUint32& aKey, nsCOMPtr<IFoo>& aData, void* userArg) { 363 static PLDHashOperator nsIEnum(const PRUint32& aKey, nsCOMPtr<IFoo>& aData, void* userArg) { 374 364 nsCAutoString str; 375 365 aData->GetString(str); … … 379 369 } 380 370 381 PLDHashOperator 382 nsIEnum2Read(nsISupports* aKey, PRUint32 aData, void* userArg) { 371 static PLDHashOperator nsIEnum2Read(nsISupports* aKey, PRUint32 aData, void* userArg) { 383 372 nsCAutoString str; 384 373 nsCOMPtr<IFoo> foo = do_QueryInterface(aKey); … … 390 379 } 391 380 392 PLDHashOperator 393 nsIEnum2(nsISupports* aKey, PRUint32& aData, void* userArg) { 381 static PLDHashOperator nsIEnum2(nsISupports* aKey, PRUint32& aData, void* userArg) { 394 382 nsCAutoString str; 395 383 nsCOMPtr<IFoo> foo = do_QueryInterface(aKey); -
trunk/src/libs/xpcom18a4/xpcom/tests/TestObserverService.cpp
r102348 r103140 68 68 #endif 69 69 70 void printString(nsString &str) {70 static void printString(nsString &str) { 71 71 #ifdef VBOX /* asan complains about mixing different allocators */ 72 72 char *cstr = ToNewCString(str); -
trunk/src/libs/xpcom18a4/xpcom/tests/TestStrings.cpp
r40300 r103140 41 41 #include "nsCRT.h" 42 42 43 void test_assign_helper(const nsACString& in, nsACString &_retval)43 static void test_assign_helper(const nsACString& in, nsACString &_retval) 44 44 { 45 45 _retval = in; 46 46 } 47 47 48 PRBool test_assign()48 static PRBool test_assign() 49 49 { 50 50 nsCString result; … … 56 56 } 57 57 58 PRBool test_assign_c()58 static PRBool test_assign_c() 59 59 { 60 60 nsCString c; c.Assign('c'); … … 65 65 } 66 66 67 PRBool test1()67 static PRBool test1() 68 68 { 69 69 NS_NAMED_LITERAL_STRING(empty, ""); … … 85 85 } 86 86 87 PRBool test2()87 static PRBool test2() 88 88 { 89 89 nsCString data("hello world"); … … 99 99 } 100 100 101 PRBool test_find()101 static PRBool test_find() 102 102 { 103 103 nsCString src("<!DOCTYPE blah blah blah>"); … … 111 111 } 112 112 113 PRBool test_rfind()113 static PRBool test_rfind() 114 114 { 115 115 const char text[] = "<!DOCTYPE blah blah blah>"; … … 149 149 } 150 150 151 PRBool test_rfind_2()151 static PRBool test_rfind_2() 152 152 { 153 153 const char text[] = "<!DOCTYPE blah blah blah>"; … … 161 161 } 162 162 163 PRBool test_rfind_3()163 static PRBool test_rfind_3() 164 164 { 165 165 const char text[] = "urn:mozilla:locale:en-US:necko"; … … 173 173 } 174 174 175 PRBool test_rfind_4()175 static PRBool test_rfind_4() 176 176 { 177 177 nsCString value("a.msf"); … … 186 186 } 187 187 188 PRBool test_distance()188 static PRBool test_distance() 189 189 { 190 190 const char text[] = "abc-xyz"; … … 200 200 } 201 201 202 PRBool test_length()202 static PRBool test_length() 203 203 { 204 204 const char text[] = "abc-xyz"; … … 211 211 } 212 212 213 PRBool test_trim()213 static PRBool test_trim() 214 214 { 215 215 const char text[] = " a\t $ "; … … 224 224 } 225 225 226 PRBool test_replace_substr()226 static PRBool test_replace_substr() 227 227 { 228 228 const char text[] = "abc-ppp-qqq-ppp-xyz"; … … 267 267 } 268 268 269 PRBool test_replace_substr_2()269 static PRBool test_replace_substr_2() 270 270 { 271 271 const char *oldName = nsnull; … … 288 288 } 289 289 290 PRBool test_strip_ws()290 static PRBool test_strip_ws() 291 291 { 292 292 const char text[] = " a $ "; … … 299 299 } 300 300 301 PRBool test_equals_ic()301 static PRBool test_equals_ic() 302 302 { 303 303 nsCString s; … … 308 308 } 309 309 310 PRBool test_fixed_string()310 static PRBool test_fixed_string() 311 311 { 312 312 char buf[256] = "hello world"; … … 327 327 } 328 328 329 PRBool test_concat()329 static PRBool test_concat() 330 330 { 331 331 nsCString bar("bar"); … … 343 343 } 344 344 345 PRBool test_concat_2()345 static PRBool test_concat_2() 346 346 { 347 347 nsCString fieldTextStr("xyz"); … … 370 370 #endif 371 371 372 PRBool test_xpidl_string()372 static PRBool test_xpidl_string() 373 373 { 374 374 nsXPIDLCString a, b; … … 422 422 } 423 423 424 PRBool test_empty_assign()424 static PRBool test_empty_assign() 425 425 { 426 426 nsCString a; … … 434 434 } 435 435 436 PRBool test_set_length()436 static PRBool test_set_length() 437 437 { 438 438 const char kText[] = "Default Plugin"; … … 446 446 } 447 447 448 PRBool test_substring()448 static PRBool test_substring() 449 449 { 450 450 nsCString super("hello world"), sub("hello"); … … 465 465 } 466 466 467 PRBool test_appendint64()467 static PRBool test_appendint64() 468 468 { 469 469 nsCString str; … … 516 516 } 517 517 518 PRBool test_findcharinset()518 static PRBool test_findcharinset() 519 519 { 520 520 nsCString buf("hello, how are you?"); … … 535 535 } 536 536 537 PRBool test_rfindcharinset()537 static PRBool test_rfindcharinset() 538 538 { 539 539 nsCString buf("hello, how are you?"); -
trunk/src/libs/xpcom18a4/xpcom/tests/nsIFileTest.cpp
r101856 r103140 15 15 #include "nsCOMPtr.h" 16 16 17 void Passed();18 void Failed(const char* explanation = nsnull);19 void Inspect();20 void Banner(const char* bannerString);21 22 void VerifyResult(nsresult rv)17 static void Passed(); 18 static void Failed(const char* explanation = nsnull); 19 static void Inspect(); 20 static void Banner(const char* bannerString); 21 22 static void VerifyResult(nsresult rv) 23 23 { 24 24 if (NS_FAILED(rv)) … … 29 29 } 30 30 //---------------------------------------------------------------------------- 31 void Banner(const char* bannerString)31 static void Banner(const char* bannerString) 32 32 //---------------------------------------------------------------------------- 33 33 { … … 38 38 39 39 //---------------------------------------------------------------------------- 40 void Passed()40 static void Passed() 41 41 //---------------------------------------------------------------------------- 42 42 { … … 45 45 46 46 //---------------------------------------------------------------------------- 47 void Failed(const char* explanation)47 static void Failed(const char* explanation) 48 48 //---------------------------------------------------------------------------- 49 49 { … … 53 53 54 54 //---------------------------------------------------------------------------- 55 void Inspect()55 static void Inspect() 56 56 //---------------------------------------------------------------------------- 57 57 { … … 59 59 } 60 60 61 void GetPaths(nsILocalFile* file)61 static void GetPaths(nsILocalFile* file) 62 62 { 63 63 nsresult rv; … … 72 72 } 73 73 74 void InitTest(const char* creationPath, const char* appendPath)74 static void InitTest(const char* creationPath, const char* appendPath) 75 75 { 76 76 nsILocalFile* file = nsnull; … … 123 123 124 124 125 void CreationTest(const char* creationPath, const char* appendPath,126 PRInt32 whatToCreate, PRInt32 perm)125 static void CreationTest(const char* creationPath, const char* appendPath, 126 PRInt32 whatToCreate, PRInt32 perm) 127 127 { 128 128 nsresult rv; … … 172 172 } 173 173 174 void CreateUniqueTest(const char* creationPath, const char* appendPath,175 PRInt32 whatToCreate, PRInt32 perm)174 static void CreateUniqueTest(const char* creationPath, const char* appendPath, 175 PRInt32 whatToCreate, PRInt32 perm) 176 176 { 177 177 nsresult rv; … … 222 222 223 223 224 void 225 CopyTest(const char *testFile, const char *targetDir) 224 static void CopyTest(const char *testFile, const char *targetDir) 226 225 { 227 226 printf("start copy test\n"); … … 258 257 } 259 258 260 void 261 DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive) 259 static void DeletionTest(const char* creationPath, const char* appendPath, PRBool recursive) 262 260 { 263 261 nsresult rv; … … 305 303 } 306 304 307 void 308 MoveTest(const char *testFile, const char *targetDir) 305 static void MoveTest(const char *testFile, const char *targetDir) 309 306 { 310 307 Banner("Move Test"); … … 345 342 346 343 // move up the number of directories in moveUpCount, then append "foo/bar" 347 void 348 NormalizeTest(const char *testPath, int moveUpCount, 349 const char *expected) 344 static void NormalizeTest(const char *testPath, int moveUpCount, 345 const char *expected) 350 346 { 351 347 Banner("Normalize Test");
Note:
See TracChangeset
for help on using the changeset viewer.