diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-07-23 21:36:24 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2012-07-23 21:42:47 +0900 |
| commit | 860f4dd06ace859470e118d4b9a8d10ddf92d076 (patch) | |
| tree | 1effdc3fd73160b57f5d6d109662a66e33050d08 /test/SingleFileAllocationIteratorTest.cc | |
| parent | f56743b0833551aa6845d0a4f1d05da02cb52175 (diff) | |
Use int64_t instead of off_t
Using off_t, at least, in DiskAdaptor layer is problematic because
torrent can contain under 2GiB files but total sum of those files may
exceed 2GiB limit, which makes off_t overflow in 32 bit system without
large file support. So we use int64_t in API. We'll check the file
length before download so that it does not exceed max off_t.
Diffstat (limited to 'test/SingleFileAllocationIteratorTest.cc')
| -rw-r--r-- | test/SingleFileAllocationIteratorTest.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/test/SingleFileAllocationIteratorTest.cc b/test/SingleFileAllocationIteratorTest.cc index 3e3e4eb0..ea6ca21a 100644 --- a/test/SingleFileAllocationIteratorTest.cc +++ b/test/SingleFileAllocationIteratorTest.cc @@ -35,8 +35,8 @@ void SingleFileAllocationIteratorTest::testAllocate() CPPUNIT_ASSERT_EQUAL((int64_t)10, x.size()); DefaultDiskWriter writer(fn); - off_t offset = 10; - off_t totalLength = 16*1024*2+8*1024; + int64_t offset = 10; + int64_t totalLength = 16*1024*2+8*1024; // we have to open file first. writer.openExistingFile(); |
