Skip to content

Commit 988628a

Browse files
committed
unitTests: test unicode file opening
As of the last commit, unicode file opening is working on Windows for the library but not the app. Signed-off-by: Rosen Penev <[email protected]>
1 parent 51dfe90 commit 988628a

File tree

3 files changed

+15
-10
lines changed

3 files changed

+15
-10
lines changed

test/data/Реган.jp2

39.7 KB
Binary file not shown.

tests/regression_tests/test_regression_allfiles.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ def get_valid_files(data_dir):
5858
"imagemagick.pgf",
5959
"iptc-psAPP13s-wIPTC-psAPP13s-noIPTC.jpg",
6060
"Reagan.jp2",
61+
"Реган.jp2",
6162
"issue_ghsa_8949_hhfh_j7rj_poc.exv",
6263
"exiv2-bug495.jpg",
6364
"issue_1920_poc.tiff",

unitTests/test_ImageFactory.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -100,45 +100,49 @@ TEST(TheImageFactory, cannotCreateInstancesForSomeTypesInFiles) {
100100
TEST(TheImageFactory, loadInstancesDifferentImageTypes) {
101101
fs::path testData(TESTDATA_PATH);
102102

103-
std::string imagePath = (testData / "DSC_3079.jpg").string();
103+
fs::path imagePath = testData / "DSC_3079.jpg";
104104
EXPECT_EQ(ImageType::jpeg, ImageFactory::getType(imagePath));
105105
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
106106

107-
imagePath = (testData / "exiv2-bug1108.exv").string();
107+
imagePath = testData / "exiv2-bug1108.exv";
108108
EXPECT_EQ(ImageType::exv, ImageFactory::getType(imagePath));
109109
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
110110

111-
imagePath = (testData / "exiv2-canon-powershot-s40.crw").string();
111+
imagePath = testData / "exiv2-canon-powershot-s40.crw";
112112
EXPECT_EQ(ImageType::crw, ImageFactory::getType(imagePath));
113113
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
114114

115-
imagePath = (testData / "exiv2-bug1044.tif").string();
115+
imagePath = testData / "exiv2-bug1044.tif";
116116
EXPECT_EQ(ImageType::tiff, ImageFactory::getType(imagePath));
117117
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
118118

119119
#ifdef EXV_HAVE_LIBZ
120-
imagePath = (testData / "exiv2-bug1074.png").string();
120+
imagePath = testData / "exiv2-bug1074.png";
121121
EXPECT_EQ(ImageType::png, ImageFactory::getType(imagePath));
122122
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
123123
#endif
124124

125-
imagePath = (testData / "BlueSquare.xmp").string();
125+
imagePath = testData / "BlueSquare.xmp";
126126
EXPECT_EQ(ImageType::xmp, ImageFactory::getType(imagePath));
127127
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
128128

129-
imagePath = (testData / "exiv2-photoshop.psd").string();
129+
imagePath = testData / "exiv2-photoshop.psd";
130130
EXPECT_EQ(ImageType::psd, ImageFactory::getType(imagePath));
131131
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
132132

133-
imagePath = (testData / "cve_2017_1000126_stack-oob-read.webp").string();
133+
imagePath = testData / "cve_2017_1000126_stack-oob-read.webp";
134134
EXPECT_EQ(ImageType::webp, ImageFactory::getType(imagePath));
135135
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
136136

137-
imagePath = (testData / "imagemagick.pgf").string();
137+
imagePath = testData / "imagemagick.pgf";
138138
EXPECT_EQ(ImageType::pgf, ImageFactory::getType(imagePath));
139139
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
140140

141-
imagePath = (testData / "Reagan.jp2").string();
141+
imagePath = testData / "Reagan.jp2";
142+
EXPECT_EQ(ImageType::jp2, ImageFactory::getType(imagePath));
143+
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
144+
145+
imagePath = testData / "Реган.jp2";
142146
EXPECT_EQ(ImageType::jp2, ImageFactory::getType(imagePath));
143147
EXPECT_NO_THROW(ImageFactory::open(imagePath, false));
144148
}

0 commit comments

Comments
 (0)