Changeset 2124 for box/trunk/test


Ignore:
Timestamp:
04/04/2008 22:59:29 (4 years ago)
Author:
chris
Message:

Tailorization
Import of the upstream sources from

Repository:  http://localhost:8000/

Kind: hg

Revision: 7807b7768163f1c2537756abe5416063989cebb1

Original author: tailor@…
Date: 2008-03-16 19:44:36+00:00

Location:
box/trunk/test
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • box/trunk/test/backupdiff/testbackupdiff.cpp

    r2123 r2124  
    111111        // number of blocks 
    112112        int64_t nblocks = box_ntoh64(hdr.mNumBlocks); 
    113         BOX_TRACE("Reading index from '" << filename << "', has " << 
    114                 nblocks << " blocks"); 
    115         BOX_TRACE("======== ===== ========== ======== ========"); 
    116         BOX_TRACE("   Index Where  EncSz/Idx     Size  WChcksm"); 
     113        TRACE2("Reading index from '%s', has %lld blocks\n", filename, nblocks); 
     114        TRACE0("======== ===== ========== ======== ========\n   Index Where  EncSz/Idx     Size  WChcksm\n"); 
    117115        // Read them all in 
    118116        int64_t nnew = 0, nold = 0; 
     
    122120                TEST_THAT(enc.ReadFullBuffer(&en, sizeof(en), 0)); 
    123121                int64_t s = box_ntoh64(en.mEncodedSize); 
    124  
     122                if(s > 0) 
     123                { 
     124                        nnew++; 
     125                        #ifdef WIN32 
     126                        TRACE2("%8I64d this  s=%8I64d", b, s); 
     127                        #else 
     128                        TRACE2("%8lld this  s=%8lld", b, s); 
     129                        #endif 
     130                } 
     131                else 
     132                { 
     133                        nold++; 
     134                        #ifdef WIN32 
     135                        TRACE2("%8I64d other i=%8I64d", b, 0 - s);               
     136                        #else 
     137                        TRACE2("%8lld other i=%8lld", b, 0 - s);                 
     138                        #endif 
     139                } 
    125140                // Decode the rest 
    126141                uint64_t iv = box_ntoh64(hdr.mEntryIVBase); 
    127142                iv += b; 
    128                 sBlowfishDecryptBlockEntry.SetIV(&iv); 
     143                sBlowfishDecryptBlockEntry.SetIV(&iv);                   
    129144                file_BlockIndexEntryEnc entryEnc; 
    130                 sBlowfishDecryptBlockEntry.TransformBlock(&entryEnc, 
    131                         sizeof(entryEnc), en.mEnEnc, sizeof(en.mEnEnc)); 
    132  
    133  
    134                 if(s > 0) 
    135                 { 
    136                         nnew++; 
    137                         BOX_TRACE(std::setw(8) << b << " this  s=" <<  
    138                                 std::setw(8) << s << " " << 
    139                                 std::setw(8) << ntohl(entryEnc.mSize) << " " << 
    140                                 std::setw(8) << std::setfill('0') << 
    141                                 std::hex << ntohl(entryEnc.mWeakChecksum)); 
    142                 } 
    143                 else 
    144                 { 
    145                         nold++; 
    146                         BOX_TRACE(std::setw(8) << b << " other i=" <<  
    147                                 std::setw(8) << (0-s) << " " << 
    148                                 std::setw(8) << ntohl(entryEnc.mSize) << " " << 
    149                                 std::setw(8) << std::setfill('0') << 
    150                                 std::hex << ntohl(entryEnc.mWeakChecksum)); 
    151                 } 
    152         } 
    153         BOX_TRACE("======== ===== ========== ======== ========"); 
     145                sBlowfishDecryptBlockEntry.TransformBlock(&entryEnc, sizeof(entryEnc), 
     146                                en.mEnEnc, sizeof(en.mEnEnc)); 
     147                TRACE2(" %8d %08x\n", ntohl(entryEnc.mSize), ntohl(entryEnc.mWeakChecksum)); 
     148                 
     149        } 
     150        TRACE0("======== ===== ========== ======== ========\n"); 
    154151        TEST_THAT(new_blocks_expected == nnew); 
    155152        TEST_THAT(old_blocks_expected == nold); 
  • box/trunk/test/basicserver/testbasicserver.cpp

    r2116 r2124  
    186186        static ConfigurationVerifyKey verifyserverkeys[] =  
    187187        { 
    188                 SERVERSTREAM_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses 
     188                SERVERSTREAM_VERIFY_SERVER_KEYS(0)      // no default addresses 
    189189        }; 
    190190 
     
    259259        static ConfigurationVerifyKey verifyserverkeys[] =  
    260260        { 
    261                 SERVERTLS_VERIFY_SERVER_KEYS(ConfigurationVerifyKey::NoDefaultValue) // no default listen addresses 
     261                SERVERTLS_VERIFY_SERVER_KEYS(0) // no default listen addresses 
    262262        }; 
    263263 
  • box/trunk/test/bbackupd/testbbackupd.cpp

    r2116 r2124  
    515515                        // connect and log in 
    516516                        SocketStreamTLS conn; 
    517                         conn.Open(context, Socket::TypeINET, "localhost", 
    518                                 22011); 
     517                        conn.Open(context, Socket::TypeINET, "localhost", BOX_PORT_BBSTORED); 
    519518                        BackupProtocolClient protocol(conn); 
    520519                        protocol.QueryVersion(BACKUP_STORE_SERVER_VERSION); 
     
    609608{ 
    610609        sSocket.Open(rContext, Socket::TypeINET,  
    611                 "localhost", 22011); 
     610                "localhost", BOX_PORT_BBSTORED); 
    612611        std::auto_ptr<BackupProtocolClient> connection; 
    613612        connection.reset(new BackupProtocolClient(sSocket)); 
     
    25612560                                == Restore_TargetExists); 
    25622561                         
     2562                        // Make sure you can't restore to a nonexistant path 
     2563                        printf("Try to restore to a path that doesn't exist\n"); 
     2564                        TEST_THAT(BackupClientRestore(*client, restoredirid,  
     2565                                "testfiles/no-such-path/subdir",  
     2566                                true /* print progress dots */)  
     2567                                == Restore_TargetPathNotFound); 
     2568                         
    25632569                        // Find ID of the deleted directory 
    25642570                        deldirid = GetDirID(*client, "x1", restoredirid); 
     
    25722578                                true /* deleted files */)  
    25732579                                == Restore_Complete); 
    2574  
    2575                         // Make sure you can't restore to a nonexistant path 
    2576                         printf("\n\n==== Try to restore to a path " 
    2577                                 "that doesn't exist\n"); 
    2578                         fflush(stdout); 
    2579                         TEST_THAT(BackupClientRestore(*client, restoredirid,  
    2580                                 "testfiles/no-such-path/subdir",  
    2581                                 true /* print progress dots */)  
    2582                                 == Restore_TargetPathNotFound); 
    25832580 
    25842581                        // Log out 
  • box/trunk/test/bbackupd/testfiles/bbackupd-temploc.conf

    r2116 r2124  
    99 
    1010StoreHostname = localhost 
    11 StorePort = 22011 
    1211AccountNumber = 0x01234567 
    1312 
  • box/trunk/test/bbackupd/testfiles/bbackupd.conf.in

    r2116 r2124  
    99 
    1010StoreHostname = localhost 
    11 StorePort = 22011 
    1211AccountNumber = 0x01234567 
    1312 
  • box/trunk/test/bbackupd/testfiles/bbstored.conf

    r2116 r2124  
    1010{ 
    1111        PidFile = testfiles/bbstored.pid 
    12         ListenAddresses = inet:localhost:22011 
     12        ListenAddresses = inet:localhost 
    1313        CertificateFile = testfiles/serverCerts.pem 
    1414        PrivateKeyFile = testfiles/serverPrivKey.pem 
  • box/trunk/test/common/testcommon.cpp

    r2116 r2124  
    5858ConfigurationVerifyKey verifykeys1_1_1[] = 
    5959{ 
    60         ConfigurationVerifyKey("bing", ConfigTest_Exists), 
    61         ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), 
    62         ConfigurationVerifyKey("terrible", ConfigTest_Exists | ConfigTest_LastEntry) 
     60        {"bing", 0, ConfigTest_Exists, 0}, 
     61        {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
     62        {"terrible", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
    6363}; 
    6464 
    6565ConfigurationVerifyKey verifykeys1_1_2[] = 
    6666{ 
    67         ConfigurationVerifyKey("fish", ConfigTest_Exists | ConfigTest_IsInt), 
    68         ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) 
     67        {"fish", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
     68        {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
    6969}; 
    7070 
     
    9090ConfigurationVerifyKey verifykeys1_1[] = 
    9191{ 
    92         ConfigurationVerifyKey("value", ConfigTest_Exists | ConfigTest_IsInt), 
    93         ConfigurationVerifyKey("string1", ConfigTest_Exists), 
    94         ConfigurationVerifyKey("string2", ConfigTest_Exists | ConfigTest_LastEntry) 
     92        {"value", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
     93        {"string1", 0, ConfigTest_Exists, 0}, 
     94        {"string2", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
    9595}; 
    9696 
    9797ConfigurationVerifyKey verifykeys1_2[] =  
    9898{ 
    99         ConfigurationVerifyKey("carrots", ConfigTest_Exists | ConfigTest_IsInt), 
    100         ConfigurationVerifyKey("string", ConfigTest_Exists | ConfigTest_LastEntry) 
     99        {"carrots", 0, ConfigTest_Exists | ConfigTest_IsInt, 0}, 
     100        {"string", 0, ConfigTest_Exists | ConfigTest_LastEntry, 0} 
    101101}; 
    102102 
     
    121121ConfigurationVerifyKey verifykeys1[] = 
    122122{ 
    123                 ConfigurationVerifyKey("notExpected", 0), 
    124                 ConfigurationVerifyKey("HasDefaultValue", 0, "Lovely default value"), 
    125                 ConfigurationVerifyKey("MultiValue", ConfigTest_MultiValueAllowed), 
    126                 ConfigurationVerifyKey("BoolTrue1", ConfigTest_IsBool), 
    127                 ConfigurationVerifyKey("BoolTrue2", ConfigTest_IsBool), 
    128                 ConfigurationVerifyKey("BoolFalse1", ConfigTest_IsBool), 
    129                 ConfigurationVerifyKey("BoolFalse2", ConfigTest_IsBool), 
    130                 ConfigurationVerifyKey("TOPlevel",  
    131                         ConfigTest_LastEntry | ConfigTest_Exists) 
     123                {"notExpected", 0, 0, 0}, 
     124                {"HasDefaultValue", "Lovely default value", 0, 0}, 
     125                {"MultiValue", 0, ConfigTest_MultiValueAllowed, 0}, 
     126                {"BoolTrue1", 0, ConfigTest_IsBool, 0}, 
     127                {"BoolTrue2", 0, ConfigTest_IsBool, 0}, 
     128                {"BoolFalse1", 0, ConfigTest_IsBool, 0}, 
     129                {"BoolFalse2", 0, ConfigTest_IsBool, 0}, 
     130                {"TOPlevel", 0, ConfigTest_LastEntry | ConfigTest_Exists, 0} 
    132131}; 
    133132 
  • box/trunk/test/compress/testcompress.cpp

    r2122 r2124  
    9191                // Check sizes 
    9292                TEST_THAT(poutput->GetSize() < source.GetSize()); 
    93                 BOX_TRACE("compressed size = " << poutput->GetSize() << 
    94                         ", source size = " << source.GetSize()); 
     93                TRACE2("compressed size = %d, source size = %d\n", poutput->GetSize(), source.GetSize()); 
    9594                 
    9695                // Decompress the data 
  • box/trunk/test/raidfile/testraidfile.cpp

    r2122 r2124  
    623623                TEST_THAT(n1 != n3); 
    624624                TEST_THAT(n1 == n4);            // ie wraps around 
    625                 BOX_TRACE("Gen paths = '" << n1 << "', '" << n2 <<  
    626                         "', '" << n3); 
     625                TRACE3("Gen paths= '%s','%s',%s'\n", n1.c_str(), n2.c_str(), n3.c_str()); 
    627626        } 
    628627 
Note: See TracChangeset for help on using the changeset viewer.