From bcb7af73b81b51bd4851342ad50e5be402b9869c Mon Sep 17 00:00:00 2001 From: Maxim Pimenov Date: Wed, 27 Jun 2018 13:09:36 +0300 Subject: [PATCH] [coding] [map] Fixed tests. Assertions in FileReader interfered with tests that checked exceptions from reading broken files. --- coding/file_reader.cpp | 9 ++++----- 1 file 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)