diff --git a/oss-internship-2020/libtiff/test/check_tag.cc b/oss-internship-2020/libtiff/test/check_tag.cc index 051891b..55f2136 100644 --- a/oss-internship-2020/libtiff/test/check_tag.cc +++ b/oss-internship-2020/libtiff/test/check_tag.cc @@ -14,9 +14,9 @@ #include "check_tag.h" // NOLINT(build/include) -using ::sapi::IsOk; -using ::testing::Eq; -using ::testing::IsTrue; +#include "gtest/gtest.h" +#include "sandboxed_api/util/status_matchers.h" +#include "tiffio.h" // NOLINT(build/include) void CheckShortField(TiffApi& api, sapi::v::RemotePtr& tif, const ttag_t field, const uint16_t value) { @@ -24,10 +24,10 @@ void CheckShortField(TiffApi& api, sapi::v::RemotePtr& tif, const ttag_t field, absl::StatusOr status_or_int; status_or_int = api.TIFFGetField1(&tif, field, tmp.PtrBoth()); - ASSERT_THAT(status_or_int, IsOk()) << "TIFFGetField1 fatal error"; - EXPECT_THAT(status_or_int.value(), IsTrue()) + ASSERT_THAT(status_or_int, ::sapi::IsOk()) << "TIFFGetField1 fatal error"; + EXPECT_THAT(status_or_int.value(), ::testing::IsTrue()) << "Problem fetching tag " << field; - EXPECT_THAT(tmp.GetValue(), Eq(value)) + EXPECT_THAT(tmp.GetValue(), ::testing::Eq(value)) << "Wrong SHORT value fetched for tag " << field; } @@ -40,12 +40,12 @@ void CheckShortPairedField(TiffApi& api, sapi::v::RemotePtr& tif, status_or_int = api.TIFFGetField2(&tif, field, tmp0.PtrBoth(), tmp1.PtrBoth()); - ASSERT_THAT(status_or_int, IsOk()) << "TIFFGetField2 fatal error"; - EXPECT_THAT(status_or_int.value(), IsTrue()) + ASSERT_THAT(status_or_int, ::sapi::IsOk()) << "TIFFGetField2 fatal error"; + EXPECT_THAT(status_or_int.value(), ::testing::IsTrue()) << "Problem fetching tag " << field; - EXPECT_THAT(tmp0.GetValue(), Eq(values[0])) + EXPECT_THAT(tmp0.GetValue(), ::testing::Eq(values[0])) << "Wrong SHORT PAIR[0] fetched for tag " << field; - EXPECT_THAT(tmp1.GetValue(), Eq(values[1])) + EXPECT_THAT(tmp1.GetValue(), ::testing::Eq(values[1])) << "Wrong SHORT PAIR[1] fetched for tag " << field; } @@ -55,9 +55,9 @@ void CheckLongField(TiffApi& api, sapi::v::RemotePtr& tif, const ttag_t field, absl::StatusOr status_or_int; status_or_int = api.TIFFGetField1(&tif, field, tmp.PtrBoth()); - ASSERT_THAT(status_or_int, IsOk()) << "TIFFGetField1 fatal error"; - EXPECT_THAT(status_or_int.value(), IsTrue()) + ASSERT_THAT(status_or_int, ::sapi::IsOk()) << "TIFFGetField1 fatal error"; + EXPECT_THAT(status_or_int.value(), ::testing::IsTrue()) << "Problem fetching tag " << field; - EXPECT_THAT(tmp.GetValue(), Eq(value)) + EXPECT_THAT(tmp.GetValue(), ::testing::Eq(value)) << "Wrong LONG value fetched for tag " << field; } diff --git a/oss-internship-2020/libtiff/test/check_tag.h b/oss-internship-2020/libtiff/test/check_tag.h index b60cd74..c45c582 100644 --- a/oss-internship-2020/libtiff/test/check_tag.h +++ b/oss-internship-2020/libtiff/test/check_tag.h @@ -12,10 +12,9 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - -#include "helper.h" // NOLINT(build/include) -#include "tiffio.h" // NOLINT(build/include) +#include "../sandboxed.h" // NOLINT(build/include) +#include "helper.h" // NOLINT(build/include) +#include "tiffio.h" // NOLINT(build/include) void CheckShortField(TiffApi&, sapi::v::RemotePtr& tif, const ttag_t field, const uint16_t value); diff --git a/oss-internship-2020/libtiff/test/defer_strile_writing.cc b/oss-internship-2020/libtiff/test/defer_strile_writing.cc index 017c2a8..502d1e4 100644 --- a/oss-internship-2020/libtiff/test/defer_strile_writing.cc +++ b/oss-internship-2020/libtiff/test/defer_strile_writing.cc @@ -12,9 +12,13 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include - +#include "../sandboxed.h" // NOLINT(build/include) +#include "gtest/gtest.h" #include "helper.h" // NOLINT(build/include) +#include "sandboxed_api/sandbox2/util/fileops.h" +#include "sandboxed_api/sandbox2/util/path.h" +#include "sandboxed_api/sandbox2/util/temp_file.h" +#include "sandboxed_api/util/status_matchers.h" #include "tiffio.h" // NOLINT(build/include) namespace { diff --git a/oss-internship-2020/libtiff/test/helper.cc b/oss-internship-2020/libtiff/test/helper.cc index 18e1205..aec8178 100644 --- a/oss-internship-2020/libtiff/test/helper.cc +++ b/oss-internship-2020/libtiff/test/helper.cc @@ -14,6 +14,10 @@ #include "helper.h" // NOLINT(build/include) +#include "../sandboxed.h" // NOLINT(build/include) +#include "sandboxed_api/sandbox2/util/fileops.h" +#include "sandboxed_api/sandbox2/util/path.h" + std::string GetImagesFolder() { std::string cwd = sandbox2::file_util::fileops::GetCWD(); auto find = cwd.rfind("/build"); diff --git a/oss-internship-2020/libtiff/test/helper.h b/oss-internship-2020/libtiff/test/helper.h index 5c920f8..b5e5afd 100644 --- a/oss-internship-2020/libtiff/test/helper.h +++ b/oss-internship-2020/libtiff/test/helper.h @@ -12,14 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -#include #include -#include "../sandboxed.h" // NOLINT(build/include) -#include "gtest/gtest.h" -#include "sandboxed_api/sandbox2/util/fileops.h" -#include "sandboxed_api/sandbox2/util/path.h" -#include "sandboxed_api/sandbox2/util/temp_file.h" -#include "sandboxed_api/util/status_matchers.h" - std::string GetFilePath(const std::string& filename); diff --git a/oss-internship-2020/libtiff/test/long_tag.cc b/oss-internship-2020/libtiff/test/long_tag.cc index 5843e35..a7d1dfc 100644 --- a/oss-internship-2020/libtiff/test/long_tag.cc +++ b/oss-internship-2020/libtiff/test/long_tag.cc @@ -15,7 +15,12 @@ #include #include "check_tag.h" // NOLINT(build/include) -#include "tiffio.h" // NOLINT(build/include) +#include "gtest/gtest.h" +#include "sandboxed_api/sandbox2/util/fileops.h" +#include "sandboxed_api/sandbox2/util/path.h" +#include "sandboxed_api/sandbox2/util/temp_file.h" +#include "sandboxed_api/util/status_matchers.h" +#include "tiffio.h" // NOLINT(build/include) namespace { diff --git a/oss-internship-2020/libtiff/test/raw_decode.cc b/oss-internship-2020/libtiff/test/raw_decode.cc index 83b7edc..09aee53 100644 --- a/oss-internship-2020/libtiff/test/raw_decode.cc +++ b/oss-internship-2020/libtiff/test/raw_decode.cc @@ -15,9 +15,12 @@ #include #include +#include "../sandboxed.h" // NOLINT(build/include) #include "absl/algorithm/container.h" #include "absl/strings/str_join.h" +#include "gtest/gtest.h" #include "helper.h" // NOLINT(build/include) +#include "sandboxed_api/util/status_matchers.h" #include "tiffio.h" // NOLINT(build/include) namespace { diff --git a/oss-internship-2020/libtiff/test/short_tag.cc b/oss-internship-2020/libtiff/test/short_tag.cc index f2c1d6b..091a2f8 100644 --- a/oss-internship-2020/libtiff/test/short_tag.cc +++ b/oss-internship-2020/libtiff/test/short_tag.cc @@ -13,10 +13,14 @@ // limitations under the License. #include -#include #include "check_tag.h" // NOLINT(build/include) -#include "tiffio.h" // NOLINT(build/include) +#include "gtest/gtest.h" +#include "sandboxed_api/sandbox2/util/fileops.h" +#include "sandboxed_api/sandbox2/util/path.h" +#include "sandboxed_api/sandbox2/util/temp_file.h" +#include "sandboxed_api/util/status_matchers.h" +#include "tiffio.h" // NOLINT(build/include) namespace {