Changeset 1292


Ignore:
Timestamp:
Feb 14, 2007, 11:20:11 PM (9 years ago)
Author:
chris
Message:

Use new constants for paths to executables, remove ifdefs.

Clean up comment formatting.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • box/chris/general/test/backupstore/testbackupstore.cpp

    r1100 r1292  
    15981598                                "testenc2", O_WRONLY | O_CREAT | O_EXCL);
    15991599                        f.Write(encfile + 2, FILE_SIZE_JUST_OVER);
    1600                         f.Close();
    16011600                        BackupStoreFilenameClear name("testenc2");
    16021601                        std::auto_ptr<IOStream> encoded(
     
    17461745
    17471746                // Create an account for the test client
    1748 #ifdef WIN32
    1749                 TEST_THAT_ABORTONFAIL(::system("..\\..\\bin\\bbstoreaccounts\\bbstoreaccounts -c testfiles/bbstored.conf create 01234567 0 10000B 20000B") == 0);
    1750 #else
    1751                 TEST_THAT_ABORTONFAIL(::system("../../bin/bbstoreaccounts/bbstoreaccounts -c testfiles/bbstored.conf create 01234567 0 10000B 20000B") == 0);
     1747                TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS
     1748                        " -c testfiles/bbstored.conf create 01234567 0 "
     1749                        "10000B 20000B") == 0);
     1750
    17521751                TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks");
    1753 #endif
    17541752
    17551753                TEST_THAT(TestDirExists("testfiles/0_0/backup/01234567"));
    17561754                TEST_THAT(TestDirExists("testfiles/0_1/backup/01234567"));
    17571755                TEST_THAT(TestDirExists("testfiles/0_2/backup/01234567"));
    1758                 TEST_THAT(TestGetFileSize("testfiles/accounts.txt") > 8);       // make sure something is written to it
     1756                TEST_THAT(TestGetFileSize("testfiles/accounts.txt") > 8);
     1757                // make sure something is written to it
    17591758
    17601759                TEST_THAT(ServerIsAlive(pid));
     
    17801779#endif
    17811780               
    1782                 // Set a new limit on the account -- leave the hard limit high to make sure the target for
    1783                 // freeing space is the soft limit.
    1784 
    1785 #ifdef WIN32
    1786                 TEST_THAT_ABORTONFAIL(::system("..\\..\\bin\\bbstoreaccounts\\bbstoreaccounts -c testfiles/bbstored.conf setlimit 01234567 10B 20000B") == 0);
    1787 #else
    1788                 TEST_THAT_ABORTONFAIL(::system("../../bin/bbstoreaccounts/bbstoreaccounts -c testfiles/bbstored.conf setlimit 01234567 10B 20000B") == 0);
     1781                // Set a new limit on the account -- leave the hard limit
     1782                // high to make sure the target for freeing space is the
     1783                // soft limit.
     1784                TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS
     1785                        " -c testfiles/bbstored.conf setlimit 01234567 "
     1786                        "10B 20000B") == 0);
    17891787                TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks");
    1790 #endif
    17911788
    17921789                // Start things up
    1793 #ifdef WIN32
    1794                 pid = LaunchServer("..\\..\\bin\\bbstored\\bbstored testfiles/bbstored.conf", "testfiles/bbstored.pid");
    1795 #else
    1796                 pid = LaunchServer("../../bin/bbstored/bbstored testfiles/bbstored.conf", "testfiles/bbstored.pid");
    1797 #endif
     1790                pid = LaunchServer(BBSTORED " testfiles/bbstored.conf",
     1791                        "testfiles/bbstored.pid");
    17981792
    17991793                ::sleep(1);
     
    18121806                // Count the objects again
    18131807                recursive_count_objects_results after = {0,0,0};
    1814                 recursive_count_objects("localhost", BackupProtocolClientListDirectory::RootDirectory, after);
    1815 printf("after.objectsNotDel=%i, deleted=%i, old=%i\n",after.objectsNotDel, after.deleted, after.old);
     1808                recursive_count_objects("localhost",
     1809                        BackupProtocolClientListDirectory::RootDirectory,
     1810                        after);
    18161811
    18171812                // If these tests fail then try increasing the timeout above
     
    18211816               
    18221817                // Set a really small hard limit
    1823 #ifdef WIN32
    1824                 TEST_THAT_ABORTONFAIL(::system("..\\..\\bin\\bbstoreaccounts\\bbstoreaccounts -c testfiles/bbstored.conf setlimit 01234567 10B 20B") == 0);
    1825 #else
    1826                 TEST_THAT_ABORTONFAIL(::system("../../bin/bbstoreaccounts/bbstoreaccounts -c testfiles/bbstored.conf setlimit 01234567 10B 20B") == 0);
     1818                TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS
     1819                        " -c testfiles/bbstored.conf setlimit 01234567 "
     1820                        "10B 20B") == 0);
    18271821                TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks");
    1828 #endif
    18291822
    18301823                // Try to upload a file and create a directory, and check an error is generated
     
    18891882
    18901883        // Create an account for the test client
    1891         TEST_THAT_ABORTONFAIL(::system("../../bin/bbstoreaccounts/bbstoreaccounts -c testfiles/bbstored.conf create 01234567 0 30000B 40000B") == 0);
    1892 
    1893 #ifndef WIN32
     1884        TEST_THAT_ABORTONFAIL(::system(BBSTOREACCOUNTS
     1885                " -c testfiles/bbstored.conf create 01234567 0 "
     1886                "30000B 40000B") == 0);
    18941887        TestRemoteProcessMemLeaks("bbstoreaccounts.memleaks");
    1895 #endif
    18961888
    18971889        // First, try logging in without an account having been created... just make sure login fails.
    18981890
    1899 #ifdef WIN32
    1900         int pid = LaunchServer("..\\..\\bin\\bbstored\\bbstored testfiles/bbstored_multi.conf", "testfiles/bbstored.pid");
    1901 #else
    1902         int pid = LaunchServer("../../bin/bbstored/bbstored testfiles/bbstored_multi.conf", "testfiles/bbstored.pid");
    1903 #endif
     1891        int pid = LaunchServer(BBSTORED " testfiles/bbstored_multi.conf",
     1892                "testfiles/bbstored.pid");
    19041893
    19051894        TEST_THAT(pid != -1 && pid != 0);
     
    19361925{
    19371926#ifdef WIN32
    1938         // Under win32 we must initialise the Winsock library
    1939         // before using sockets
    1940 
    1941         WSADATA info;
    1942         TEST_THAT(WSAStartup(0x0101, &info) != SOCKET_ERROR)
    1943 
    19441927        // this had better work, or bbstored will die when combining diffs
    19451928        char* file = "foo";
Note: See TracChangeset for help on using the changeset viewer.