last for today

This commit is contained in:
Alexandra Latysheva 2020-09-30 19:17:23 +00:00
parent 0f8cbd1bfc
commit 477de3b6b7
5 changed files with 15 additions and 13 deletions

View File

@ -18,7 +18,7 @@ add_executable(sandboxed
)
target_link_libraries(sandboxed PRIVATE
tiff_sapi
sapi::sapi
sandbox2::temp_file
sapi::sapi
tiff_sapi
)

View File

@ -115,7 +115,7 @@ absl::Status LibTIFFMain(const std::string& srcfile) {
// sandbox(absolute_path_to_dir, srcfile) or
// sandbox(absolute_path_to_dir). file and dir should be exists.
// srcfile must also be absolute_path_to_file
TiffSapiSandbox sandbox("", srcfile);
TiffSapiSandbox sandbox(srcfile);
// initialize sapi vars after constructing TiffSapiSandbox
sapi::v::UShort h, v;

View File

@ -18,20 +18,20 @@ add_executable(tests
check_tag.h
check_tag.cc
defer_strile_writing.cc
helper.h
helper.cc
long_tag.cc
raw_decode.cc
short_tag.cc
helper.h
helper.cc
)
target_link_libraries(tests PRIVATE
tiff_sapi
sapi::sapi
sandbox2::temp_file
gtest
gmock
gtest
gtest_main
sandbox2::temp_file
sapi::sapi
tiff_sapi
)
gtest_discover_tests(tests)

View File

@ -215,7 +215,8 @@ void TestWriting(const char* mode, int tiled, int height) {
api.TIFFWriteEncodedTile(&tif, i, tilebuffer_.PtrBoth(), TBS);
ASSERT_THAT(status_or_int, IsOk()) << "TIFFWriteEncodedTile fatal error";
EXPECT_THAT(status_or_int.value(), Eq(TBS))
<< "line " << i << ": expected 256, got " << status_or_int.value();
<< "line " << i << ": expected " << TBS << ", got "
<< status_or_int.value();
}
} else {
for (int i = 0; i < height; ++i) {
@ -254,7 +255,8 @@ void TestWriting(const char* mode, int tiled, int height) {
ASSERT_THAT(status_or_long, IsOk())
<< "TIFFReadEncodedTile fatal error";
EXPECT_THAT(status_or_long.value(), Eq(TBS))
<< "line " << i << ": expected 256, got " << status_or_long.value();
<< "line " << i << ": expected " << TBS << ", got "
<< status_or_long.value();
bool cmp = tilebuffer[0] != expected_c || tilebuffer[255] != expected_c;

View File

@ -23,10 +23,10 @@ std::string GetImagesDir() {
LOG(ERROR) << "Something went wrong: CWD don't contain build dir. "
<< "Please run tests from build dir, path might be incorrect\n";
return cwd + "/test/images";
return sandbox2::file::JoinPath(cwd, "test", "images");
}
return cwd.substr(0, find) + "/test/images";
return sandbox2::file::JoinPath(cwd.substr(0, find), "test", "images");
}
std::string GetFilePath(const std::string& filename) {