From 06d9f207592fa8e402236cbcf8d56c56a30e05e2 Mon Sep 17 00:00:00 2001 From: Jordan Lee Date: Wed, 23 Jan 2013 22:53:58 +0000 Subject: [PATCH] (libT) #1220 'change file and folder names': finish cleaning up the unit test for calling tr_torrentRenamePath() on an incomplete torrent with .part files --- libtransmission/rename-test.c | 20 ++++---------------- 1 file changed, 4 insertions(+), 16 deletions(-) diff --git a/libtransmission/rename-test.c b/libtransmission/rename-test.c index 7fb367058..56d88ceee 100644 --- a/libtransmission/rename-test.c +++ b/libtransmission/rename-test.c @@ -465,8 +465,6 @@ static void create_zero_torrent_partial_contents (tr_torrent * tor, bool incomplete) { tr_file_index_t i; - const tr_stat * st; - tr_file_stat * fst; for (i=0; iinfo.fileCount; ++i) { @@ -493,18 +491,12 @@ create_zero_torrent_partial_contents (tr_torrent * tor, bool incomplete) assert (path != NULL); rv = stat (path, &sb); assert (rv == 0); - fprintf (stderr, "%s:%d file %s size is %zu\n", __FILE__, __LINE__, path, (size_t)sb.st_size); tr_free (path); } sync (); verify_and_block_until_done (tor); - st = tr_torrentStat (tor); -fprintf (stderr, "%s:%d leftUntilDone %zu\n", __FILE__, __LINE__, (size_t)st->leftUntilDone); -fst = tr_torrentFiles (tor, NULL); -for (i=0; i<3; ++i) - fprintf (stderr, "%s:%d %d %zu\n", __FILE__, __LINE__, (int)i, (size_t)fst[i].bytesCompleted); - assert (st->leftUntilDone == 0); + assert (tr_torrentStat(tor)->leftUntilDone == 0); if (incomplete) { @@ -524,9 +516,7 @@ for (i=0; i<3; ++i) sync (); verify_and_block_until_done (tor); - st = tr_torrentStat (tor); - assert (st->leftUntilDone == tor->info.pieceSize); -fprintf (stderr, "%s:%d leftUntilDone %zu\n", __FILE__, __LINE__, (size_t)st->leftUntilDone); + assert (tr_torrentStat(tor)->leftUntilDone == tor->info.pieceSize); } } @@ -601,12 +591,10 @@ int main (void) { int ret; - const testFunc tests[] = { //test_single_filename_torrent, - //test_multifile_torrent, + const testFunc tests[] = { test_single_filename_torrent, + test_multifile_torrent, test_partial_file }; - verbose = 1; - libtransmission_test_session_init (); ret = runTests (tests, NUM_TESTS (tests)); libtransmission_test_session_close ();