fix set_naem() on file_storage actually affecting save paths

This commit is contained in:
Arvid Norberg
2013-11-17 08:02:16 +00:00
parent 8f2683fe5d
commit 25e53cd799
4 changed files with 89 additions and 39 deletions

View File

@@ -78,11 +78,13 @@ void setup_test_storage(file_storage& st)
int test_main()
{
{
// test rename_file
file_storage st;
setup_test_storage(st);
st.rename_file(0, combine_path("test", combine_path("c", "d")));
TEST_EQUAL(st.file_path(0, "."), combine_path(".", combine_path("test", combine_path("c", "d"))));
TEST_EQUAL(st.file_path(0, "."), combine_path(".", combine_path("test"
, combine_path("c", "d"))));
#ifdef TORRENT_WINDOWS
st.rename_file(0, "c:\\tmp\\a");
@@ -93,6 +95,16 @@ int test_main()
#endif
}
{
// test set_name
file_storage st;
setup_test_storage(st);
st.set_name("test_2");
TEST_EQUAL(st.file_path(0, "."), combine_path(".", combine_path("test_2"
, "a")));
}
{
file_storage st;
st.add_file("a", 10000);