mirror of
https://github.com/thorvg/thorvg.git
synced 2025-06-08 05:33:36 +00:00
test Picture: Change file open of ifstream to binary(and readonly) type
When opening a file using ifstream, a different problem occurs for each platform. To fix this, change to binary, readonly type. refer to: https://stackoverflow.com/questions/9817806/why-does-my-program-produce-different-results-on-windows-and-linux-about-file-r
This commit is contained in:
parent
370b9b08ec
commit
a7f7cbd29a
1 changed files with 3 additions and 3 deletions
|
@ -129,7 +129,7 @@ TEST_CASE("Load PNG file from data", "[tvgPicture]")
|
|||
REQUIRE(picture);
|
||||
|
||||
//Open file
|
||||
ifstream file(TEST_DIR"/test.png");
|
||||
ifstream file(TEST_DIR"/test.png", std::ios::in | std::ios::binary);
|
||||
REQUIRE(file.is_open());
|
||||
auto size = sizeof(uint32_t) * (1000*1000);
|
||||
auto data = (char*)malloc(size);
|
||||
|
@ -170,7 +170,7 @@ TEST_CASE("Load JPG file from data", "[tvgPicture]")
|
|||
REQUIRE(picture);
|
||||
|
||||
//Open file
|
||||
ifstream file(TEST_DIR"/test.jpg");
|
||||
ifstream file(TEST_DIR"/test.jpg", std::ios::in | std::ios::binary);
|
||||
REQUIRE(file.is_open());
|
||||
auto begin = file.tellg();
|
||||
file.seekg(0, std::ios::end);
|
||||
|
@ -214,7 +214,7 @@ TEST_CASE("Load TVG file from data", "[tvgPicture]")
|
|||
REQUIRE(picture);
|
||||
|
||||
//Open file
|
||||
ifstream file(TEST_DIR"/tag.tvg");
|
||||
ifstream file(TEST_DIR"/tag.tvg", std::ios::in | std::ios::binary);
|
||||
REQUIRE(file.is_open());
|
||||
auto begin = file.tellg();
|
||||
file.seekg(0, std::ios::end);
|
||||
|
|
Loading…
Add table
Reference in a new issue