Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mapsme/omim.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/coding
diff options
context:
space:
mode:
authorMaxim Pimenov <m@maps.me>2018-06-27 13:09:36 +0300
committerTatiana Yan <tatiana.kondakova@gmail.com>2018-06-27 14:01:33 +0300
commitbcb7af73b81b51bd4851342ad50e5be402b9869c (patch)
treee3bed1d27615a272949b960a72f0882670738807 /coding
parent8a113aa83cd0eb0ae548f719aa85f5bd7a1d6630 (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.cpp9
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)