fixed problem with file pool when files were opened with 0 as info hash and attempted to close with the correct one. the info hash is no longer used as the key in the file pool. Also updated Makefile.am to include the buffer.hpp and .cpp and to include the storage unit test
This commit is contained in:
@@ -13,6 +13,9 @@ test_ip_filter_LDADD = $(top_builddir)/src/libtorrent.la
|
||||
test_piece_picker_SOURCES = main.cpp test_piece_picker.cpp
|
||||
test_piece_picker_LDADD = $(top_builddir)/src/libtorrent.la
|
||||
|
||||
test_storage_SOURCES = main.cpp test_storage.cpp
|
||||
test_storage_LDADD = $(top_builddir)/src/libtorrent.la
|
||||
|
||||
noinst_HEADERS = test.hpp
|
||||
|
||||
AM_CXXFLAGS=-ftemplate-depth-50 -I$(top_srcdir)/include @DEBUGFLAGS@ @PTHREAD_CFLAGS@
|
||||
|
@@ -43,7 +43,10 @@ int test_main()
|
||||
|
||||
int num_pieces = (613 + 17 + piece_size - 1) / piece_size;
|
||||
TEST_CHECK(info.num_pieces() == num_pieces);
|
||||
|
||||
|
||||
char piece[piece_size];
|
||||
|
||||
{ // avoid having two storages use the same files
|
||||
storage s(info, initial_path());
|
||||
|
||||
// write piece 1 (in slot 0)
|
||||
@@ -51,7 +54,6 @@ int test_main()
|
||||
s.write(piece1 + half, 0, half, half);
|
||||
|
||||
// verify piece 1
|
||||
char piece[piece_size];
|
||||
s.read(piece, 0, 0, piece_size);
|
||||
TEST_CHECK(std::equal(piece, piece + piece_size, piece1));
|
||||
|
||||
@@ -69,6 +71,7 @@ int test_main()
|
||||
// make sure the files have the correct size
|
||||
TEST_CHECK(file_size(initial_path() / "temp_storage" / "test1.tmp") == 17);
|
||||
TEST_CHECK(file_size(initial_path() / "temp_storage" / "test2.tmp") == 31);
|
||||
}
|
||||
|
||||
// make sure the piece_manager can identify the pieces
|
||||
piece_manager pm(info, initial_path());
|
||||
|
Reference in New Issue
Block a user