diff options
author | Maxim Pimenov <m@maps.me> | 2018-06-27 13:09:36 +0300 |
---|---|---|
committer | Tatiana Yan <tatiana.kondakova@gmail.com> | 2018-06-27 14:01:33 +0300 |
commit | bcb7af73b81b51bd4851342ad50e5be402b9869c (patch) | |
tree | e3bed1d27615a272949b960a72f0882670738807 /coding | |
parent | 8a113aa83cd0eb0ae548f719aa85f5bd7a1d6630 (diff) |
[coding] [map] Fixed tests.
Assertions in FileReader interfered with tests that checked
exceptions from reading broken files.
Diffstat (limited to 'coding')
-rw-r--r-- | coding/file_reader.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/coding/file_reader.cpp b/coding/file_reader.cpp index 6a7d0231a4..e19920e255 100644 --- a/coding/file_reader.cpp +++ b/coding/file_reader.cpp @@ -128,14 +128,13 @@ void FileReader::CheckPosAndSize(uint64_t pos, uint64_t size) const { uint64_t const allSize1 = Size(); bool const ret1 = (pos + size <= allSize1); - ASSERT(ret1, (pos, size, allSize1)); + if (!ret1) + MYTHROW(Reader::SizeException, (pos, size, allSize1)); uint64_t const allSize2 = m_fileData->Size(); bool const ret2 = (m_offset + pos + size <= allSize2); - ASSERT(ret2, (m_offset, pos, size, allSize2)); - - if (!ret1 || !ret2) - MYTHROW(Reader::SizeException, (pos, size)); + if (!ret2) + MYTHROW(Reader::SizeException, (pos, size, allSize2)); } void FileReader::SetOffsetAndSize(uint64_t offset, uint64_t size) |