summaryrefslogtreecommitdiff
path: root/test/backupdiff
diff options
context:
space:
mode:
authorChris Wilson <chris+github@qwirx.com>2008-04-04 21:59:29 +0000
committerChris Wilson <chris+github@qwirx.com>2008-04-04 21:59:29 +0000
commit3661f3624acc46590d5504fda4f8714255fb2c8e (patch)
treee2cd17e19718d3f46944979a23e4c93dcf92584b /test/backupdiff
parent2f8d0c29536cdb306b525b78638727da4ead0022 (diff)
Tailorization
Import of the upstream sources from Repository: http://localhost:8000/ Kind: hg Revision: 7807b7768163f1c2537756abe5416063989cebb1 Original author: tailor@rocio.int.aidworld.org Date: 2008-03-16 19:44:36+00:00
Diffstat (limited to 'test/backupdiff')
-rw-r--r--test/backupdiff/testbackupdiff.cpp47
1 files changed, 22 insertions, 25 deletions
diff --git a/test/backupdiff/testbackupdiff.cpp b/test/backupdiff/testbackupdiff.cpp
index fb972b2b..a91d6dfe 100644
--- a/test/backupdiff/testbackupdiff.cpp
+++ b/test/backupdiff/testbackupdiff.cpp
@@ -110,10 +110,8 @@ void check_encoded_file(const char *filename, int64_t OtherFileID, int new_block
TEST_THAT((uint64_t)box_ntoh64(hdr.mOtherFileID) == (uint64_t)OtherFileID);
// number of blocks
int64_t nblocks = box_ntoh64(hdr.mNumBlocks);
- BOX_TRACE("Reading index from '" << filename << "', has " <<
- nblocks << " blocks");
- BOX_TRACE("======== ===== ========== ======== ========");
- BOX_TRACE(" Index Where EncSz/Idx Size WChcksm");
+ TRACE2("Reading index from '%s', has %lld blocks\n", filename, nblocks);
+ TRACE0("======== ===== ========== ======== ========\n Index Where EncSz/Idx Size WChcksm\n");
// Read them all in
int64_t nnew = 0, nold = 0;
for(int64_t b = 0; b < nblocks; ++b)
@@ -121,36 +119,35 @@ void check_encoded_file(const char *filename, int64_t OtherFileID, int new_block
file_BlockIndexEntry en;
TEST_THAT(enc.ReadFullBuffer(&en, sizeof(en), 0));
int64_t s = box_ntoh64(en.mEncodedSize);
-
- // Decode the rest
- uint64_t iv = box_ntoh64(hdr.mEntryIVBase);
- iv += b;
- sBlowfishDecryptBlockEntry.SetIV(&iv);
- file_BlockIndexEntryEnc entryEnc;
- sBlowfishDecryptBlockEntry.TransformBlock(&entryEnc,
- sizeof(entryEnc), en.mEnEnc, sizeof(en.mEnEnc));
-
-
if(s > 0)
{
nnew++;
- BOX_TRACE(std::setw(8) << b << " this s=" <<
- std::setw(8) << s << " " <<
- std::setw(8) << ntohl(entryEnc.mSize) << " " <<
- std::setw(8) << std::setfill('0') <<
- std::hex << ntohl(entryEnc.mWeakChecksum));
+ #ifdef WIN32
+ TRACE2("%8I64d this s=%8I64d", b, s);
+ #else
+ TRACE2("%8lld this s=%8lld", b, s);
+ #endif
}
else
{
nold++;
- BOX_TRACE(std::setw(8) << b << " other i=" <<
- std::setw(8) << (0-s) << " " <<
- std::setw(8) << ntohl(entryEnc.mSize) << " " <<
- std::setw(8) << std::setfill('0') <<
- std::hex << ntohl(entryEnc.mWeakChecksum));
+ #ifdef WIN32
+ TRACE2("%8I64d other i=%8I64d", b, 0 - s);
+ #else
+ TRACE2("%8lld other i=%8lld", b, 0 - s);
+ #endif
}
+ // Decode the rest
+ uint64_t iv = box_ntoh64(hdr.mEntryIVBase);
+ iv += b;
+ sBlowfishDecryptBlockEntry.SetIV(&iv);
+ file_BlockIndexEntryEnc entryEnc;
+ sBlowfishDecryptBlockEntry.TransformBlock(&entryEnc, sizeof(entryEnc),
+ en.mEnEnc, sizeof(en.mEnEnc));
+ TRACE2(" %8d %08x\n", ntohl(entryEnc.mSize), ntohl(entryEnc.mWeakChecksum));
+
}
- BOX_TRACE("======== ===== ========== ======== ========");
+ TRACE0("======== ===== ========== ======== ========\n");
TEST_THAT(new_blocks_expected == nnew);
TEST_THAT(old_blocks_expected == nold);
}