mirror of
https://github.com/GerbilSoft/rom-properties.git
synced 2025-06-18 19:45:41 -04:00
[libromdata/tests] ImageDecoderTest: Change the max file size constants to off64_t.
Fixes a compile warning (error) in the 64-bit MSVC 2015 build on AppVeyor: extlib\googletest\googletest\include\gtest/gtest.h(1438): error C2220: warning treated as error - no 'object' file generated [build\src\libromdata\tests\ImageDecoderTest.vcxproj] src\libromdata\tests\img\ImageDecoderTest.cpp(297): note: see reference to function template instantiation 'testing::AssertionResult testing::internal::CmpHelperLE<off64_t,std::size_t>(const char *,const char *,const T1 &,const T2 &)' being compiled with [ T1=off64_t, T2=std::size_t ] extlib\googletest\googletest\include\gtest/gtest.h(1438): warning C4018: '<=': signed/unsigned mismatch [build\src\libromdata\tests\ImageDecoderTest.vcxproj]
This commit is contained in:
parent
e984a074ce
commit
8f4648eb38
@ -134,8 +134,8 @@ struct ImageDecoderTest_mode
|
|||||||
};
|
};
|
||||||
|
|
||||||
// Maximum file size for images.
|
// Maximum file size for images.
|
||||||
static constexpr size_t MAX_DDS_IMAGE_FILESIZE = 12U*1024U*1024U;
|
static constexpr off64_t MAX_DDS_IMAGE_FILESIZE = 12U*1024U*1024U;
|
||||||
static constexpr size_t MAX_PNG_IMAGE_FILESIZE = 2U*1024U*1024U;
|
static constexpr off64_t MAX_PNG_IMAGE_FILESIZE = 2U*1024U*1024U;
|
||||||
|
|
||||||
class ImageDecoderTest : public ::testing::TestWithParam<ImageDecoderTest_mode>
|
class ImageDecoderTest : public ::testing::TestWithParam<ImageDecoderTest_mode>
|
||||||
{
|
{
|
||||||
@ -272,11 +272,9 @@ void ImageDecoderTest::SetUp(void)
|
|||||||
|
|
||||||
/* FIXME: Per-type minimum sizes.
|
/* FIXME: Per-type minimum sizes.
|
||||||
* This fails on some very small SVR files.
|
* This fails on some very small SVR files.
|
||||||
ASSERT_GT(ddsSize, 4+sizeof(DDS_HEADER))
|
ASSERT_GT(ddsSize, 4+sizeof(DDS_HEADER)) << "DDS image is too small.";
|
||||||
<< "DDS image is too small.";
|
|
||||||
*/
|
*/
|
||||||
ASSERT_LE(ddsSize, MAX_DDS_IMAGE_FILESIZE)
|
ASSERT_LE(static_cast<off64_t>(ddsSize), MAX_DDS_IMAGE_FILESIZE) << "DDS image is too big.";
|
||||||
<< "DDS image is too big.";
|
|
||||||
|
|
||||||
// Read the DDS image into memory.
|
// Read the DDS image into memory.
|
||||||
m_dds_buf.resize(ddsSize);
|
m_dds_buf.resize(ddsSize);
|
||||||
|
Loading…
Reference in New Issue
Block a user