From 3cda09ea8123a82ae6c02144c68641f01a3343b9 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 24 Dec 2016 21:24:50 +0300 Subject: [PATCH] Fix up rename test to avoid random duplicate torrent failures --- libtransmission/rename-test.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libtransmission/rename-test.c b/libtransmission/rename-test.c index f9899450f..c3fa01956 100644 --- a/libtransmission/rename-test.c +++ b/libtransmission/rename-test.c @@ -435,15 +435,19 @@ test_multifile_torrent (void) testFileExistsAndConsistsOfThisString (tor, i, expected_contents[i]); } + tr_ctorFree (ctor); + tr_torrentRemove (tor, false, NULL); + + do + { + tr_wait_msec (10); + } + while (tr_sessionCountTorrents (session) > 0); + /** *** Test renaming prefixes (shouldn't work) **/ - tr_ctorFree (ctor); - tr_torrentRemove (tor, false, NULL); - do { - tr_wait_msec (10); - } while (0); ctor = tr_ctorNew (session); tor = create_torrent_from_base64_metainfo (ctor, "ZDEwOmNyZWF0ZWQgYnkyNTpUcmFuc21pc3Npb24vMi42MSAoMTM0MDcpMTM6Y3JlYXRpb24gZGF0"