Changeset 13835


Ignore:
Timestamp:
Jan 22, 2013, 5:06:38 AM (8 years ago)
Author:
jordan
Message:

(libT) #1220 'change file and folder names': add a test to confirm passing tor->info.name as the 'oldname' argument works

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/libtransmission/rename-test.c

    r13829 r13835  
    210210  check (tr_fileExists (tmpstr, NULL));
    211211  check_streq ("hello-world.txt", tr_torrentName(tor));
    212   check_int_eq (0, torrentRenameAndWait (tor, "hello-world.txt", "foobar"));
    213   check (!tr_fileExists (tmpstr, NULL));
    214   check (tor->info.files[0].is_renamed);
    215   check_streq ("foobar", tor->info.files[0].name);
    216   check_streq ("foobar", tr_torrentName(tor));
    217   check (strstr (tor->info.torrent, "foobar") == NULL);
    218   check (testFileExistsAndConsistsOfThisString (tor, 0, "hello, world!\n"));
     212  check_int_eq (0, torrentRenameAndWait (tor, tor->info.name, "foobar"));
     213  check (!tr_fileExists (tmpstr, NULL)); /* confirm the old filename can't be found */
     214  check (tor->info.files[0].is_renamed); /* confirm the file's 'renamed' flag is set */
     215  check_streq ("foobar", tr_torrentName(tor)); /* confirm the torrent's name is now 'foobar' */
     216  check_streq ("foobar", tor->info.files[0].name); /* confirm the file's name is now 'foobar' */
     217  check (strstr (tor->info.torrent, "foobar") == NULL); /* confirm the name in the .torrent file hasn't changed */
     218  check (testFileExistsAndConsistsOfThisString (tor, 0, "hello, world!\n")); /* confirm the contents are right */
    219219  tr_free (tmpstr);
    220220
Note: See TracChangeset for help on using the changeset viewer.