VirtualBox

Ignore:
Timestamp:
Feb 19, 2024 5:00:08 PM (12 months ago)
Author:
vboxsync
svn:sync-xref-src-repo-rev:
161792
Message:

libs/xpcom: Remove some unused stuff, bugref:3409

Location:
trunk/src/libs/xpcom18a4/xpcom/tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/libs/xpcom18a4/xpcom/tests/TestCRT.cpp

    r103140 r103458  
    4141#include <stdlib.h>
    4242
     43#ifdef DEBUG
    4344// The return from strcmp etc is only defined to be postive, zero or
    4445// negative. The magnitude of a non-zero return is irrelevant.
     
    5354    }
    5455}
    55 
     56#endif
    5657
    5758// Verify that nsCRT versions of string comparison routines get the
  • trunk/src/libs/xpcom18a4/xpcom/tests/nsIFileTest.cpp

    r103140 r103458  
    1515#include "nsCOMPtr.h"
    1616
    17 static void Passed();
    1817static void Failed(const char* explanation = nsnull);
    19 static void Inspect();
    2018static void Banner(const char* bannerString);
    2119
     
    3836
    3937//----------------------------------------------------------------------------
    40 static void Passed()
    41 //----------------------------------------------------------------------------
    42 {
    43     printf("Test passed.");
    44 }
    45 
    46 //----------------------------------------------------------------------------
    4738static void Failed(const char* explanation)
    4839//----------------------------------------------------------------------------
     
    5041    printf("ERROR : Test failed.\n");
    5142    printf("REASON: %s.\n", explanation);
    52 }
    53 
    54 //----------------------------------------------------------------------------
    55 static void Inspect()
    56 //----------------------------------------------------------------------------
    57 {
    58     printf("^^^^^^^^^^ PLEASE INSPECT OUTPUT FOR ERRORS\n");
    5943}
    6044
     
    171155
    172156}
    173 
    174 static void CreateUniqueTest(const char* creationPath, const char* appendPath,
    175                              PRInt32 whatToCreate, PRInt32 perm)
    176 {
    177     nsresult rv;
    178     nsCOMPtr<nsILocalFile> file =
    179         do_CreateInstance(NS_LOCAL_FILE_CONTRACTID, &rv);
    180 
    181     if (NS_FAILED(rv) || (!file))
    182     {
    183         printf("create nsILocalFile failed\n");
    184         return;
    185     }
    186 
    187     Banner("Creation Test");
    188     printf("creationPath == %s\nappendPath == %s\n", creationPath, appendPath);
    189 
    190     rv = file->InitWithNativePath(nsDependentCString(creationPath));
    191     VerifyResult(rv);
    192 
    193     printf("Appending %s\n", appendPath);
    194     rv = file->AppendNative(nsDependentCString(appendPath));
    195     VerifyResult(rv);
    196 
    197     printf("Check For Existence\n");
    198 
    199     PRBool exists;
    200     file->Exists(&exists);
    201 
    202     if (exists)
    203         printf("Yup!\n");
    204     else
    205         printf("no.\n");
    206 
    207 
    208     rv = file->CreateUnique(whatToCreate, perm);
    209     VerifyResult(rv);
    210 
    211     rv = file->Exists(&exists);
    212     VerifyResult(rv);
    213 
    214 
    215     if (!exists)
    216     {
    217         Failed("Did not create file system object!");
    218         return;
    219     }
    220 
    221 }
    222 
    223157
    224158static void CopyTest(const char *testFile, const char *targetDir)
     
    423357    registrar->AutoRegister(nsnull);
    424358
    425 #if defined(XP_WIN) || defined(XP_OS2)
    426     InitTest("c:\\temp\\", "sub1/sub2/"); // expect failure
    427     InitTest("d:\\temp\\", "sub1\\sub2\\"); // expect failure
    428 
    429     CreationTest("c:\\temp\\", "file.txt", nsIFile::NORMAL_FILE_TYPE, 0644);
    430     DeletionTest("c:\\temp\\", "file.txt", PR_FALSE);
    431 
    432     MoveTest("c:\\newtemp\\", "d:");
    433 
    434     CreationTest("c:\\temp\\", "mumble\\a\\b\\c\\d\\e\\f\\g\\h\\i\\j\\k\\", nsIFile::DIRECTORY_TYPE, 0644);
    435     DeletionTest("c:\\temp\\", "mumble", PR_TRUE);
    436 
    437     CreateUniqueTest("c:\\temp\\", "foo", nsIFile::NORMAL_FILE_TYPE, 0644);
    438     CreateUniqueTest("c:\\temp\\", "foo", nsIFile::NORMAL_FILE_TYPE, 0644);
    439     CreateUniqueTest("c:\\temp\\", "bar.xx", nsIFile::DIRECTORY_TYPE, 0644);
    440     CreateUniqueTest("c:\\temp\\", "bar.xx", nsIFile::DIRECTORY_TYPE, 0644);
    441     DeletionTest("c:\\temp\\", "foo", PR_TRUE);
    442     DeletionTest("c:\\temp\\", "foo-1", PR_TRUE);
    443     DeletionTest("c:\\temp\\", "bar.xx", PR_TRUE);
    444     DeletionTest("c:\\temp\\", "bar-1.xx", PR_TRUE);
    445 
    446 #else
    447 #ifdef XP_UNIX
    448359    InitTest("/tmp/", "sub1/sub2/"); // expect failure
    449360
     
    465376    DeletionTest("/tmp", "foo", PR_TRUE);
    466377
    467 #endif /* XP_UNIX */
    468 #endif /* XP_WIN || XP_OS2 */
    469378    return 0;
    470379}
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette