From b2f4e0068ece173ae8ba206813c362838b99d155 Mon Sep 17 00:00:00 2001 From: Demi Marie Obenour Date: Sat, 12 Feb 2022 22:17:57 -0500 Subject: [PATCH] Add libidn2 and TurboJPEG sandboxes to the build This exposed a compilation error and an incorrect TEST_FILES_DIR. Fix both. --- contrib/CMakeLists.txt | 2 ++ contrib/README.md | 16 +++++++++------- contrib/turbojpeg/tests/CMakeLists.txt | 2 +- contrib/turbojpeg/tests/turbojpeg_sapi_test.cc | 2 +- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/contrib/CMakeLists.txt b/contrib/CMakeLists.txt index 42c2b14..70b1223 100644 --- a/contrib/CMakeLists.txt +++ b/contrib/CMakeLists.txt @@ -16,7 +16,9 @@ set(SAPI_CONTRIB_SANDBOXES hunspell jsonnet + libidn2 pffft + turbojpeg zopfli zstd ) diff --git a/contrib/README.md b/contrib/README.md index 9853cda..458ef11 100644 --- a/contrib/README.md +++ b/contrib/README.md @@ -5,13 +5,15 @@ libraries. ## Projects Sandboxed -Directory | Project | Home Page | Integration ------------ | ------------------------------------------------- | ---------------------------------------------------------------------------- | ----------- -`hunspell/` | Hunspell - The most popular spellchecking library | [github.com/hunspell/hunspell](https://github.com/hunspell/hunspell) | CMake -`jsonnet/` | Jsonnet - The Data Templating Language | [github.com/google/jsonnet](https://github.com/google/jsonnet) | CMake -`pffft/` | PFFFT - a pretty fast Fourier Transform | [bitbucket.org/jpommier/pffft.git](https://bitbucket.org/jpommier/pffft.git) | CMake -`zopfli` | Zopfli - Compression Algorithm | [github.com/google/zopfli](https://github.com/google/zopfli) | CMake -`zstd/` | Zstandard - Fast real-time compression algorithm | [github.com/facebook/zstd](https://github.com/facebook/zstd) | CMake +Directory | Project | Home Page | Integration +------------ | ------------------------------------------------- | ------------------------------------------------------------------------------------ | ----------- +`hunspell/` | Hunspell - The most popular spellchecking library | [github.com/hunspell/hunspell](https://github.com/hunspell/hunspell) | CMake +`jsonnet/` | Jsonnet - The Data Templating Language | [github.com/google/jsonnet](https://github.com/google/jsonnet) | CMake +`pffft/` | PFFFT - a pretty fast Fourier Transform | [bitbucket.org/jpommier/pffft.git](https://bitbucket.org/jpommier/pffft.git) | CMake +`zopfli` | Zopfli - Compression Algorithm | [github.com/google/zopfli](https://github.com/google/zopfli) | CMake +`zstd/` | Zstandard - Fast real-time compression algorithm | [github.com/facebook/zstd](https://github.com/facebook/zstd) | CMake +`libidn2/` | libidn2 - GNU IDN library | [www.gnu.org/software/libidn/#libidn2](https://www.gnu.org/software/libidn/#libidn2) | CMake +`turbojpeg/` | High-level JPEG library | [libjpeg-turbo.org/About/TurboJPEG](https://libjpeg-turbo.org/About/TurboJPEG) | CMake ## Projects Shipping with Sandboxed API Sandboxes diff --git a/contrib/turbojpeg/tests/CMakeLists.txt b/contrib/turbojpeg/tests/CMakeLists.txt index dae2462..7e0ee1c 100644 --- a/contrib/turbojpeg/tests/CMakeLists.txt +++ b/contrib/turbojpeg/tests/CMakeLists.txt @@ -23,4 +23,4 @@ target_link_libraries(turbojpeg_sapi_test PRIVATE gmock ) -gtest_discover_tests(turbojpeg_sapi_test PROPERTIES ENVIRONMENT "TEST_FILES_DIR=${PROJECT_SOURCE_DIR}/files") +gtest_discover_tests(turbojpeg_sapi_test PROPERTIES ENVIRONMENT "TEST_FILES_DIR=${PROJECT_SOURCE_DIR}/tests") diff --git a/contrib/turbojpeg/tests/turbojpeg_sapi_test.cc b/contrib/turbojpeg/tests/turbojpeg_sapi_test.cc index 927d4e5..012a76f 100644 --- a/contrib/turbojpeg/tests/turbojpeg_sapi_test.cc +++ b/contrib/turbojpeg/tests/turbojpeg_sapi_test.cc @@ -91,7 +91,7 @@ absl::StatusOr> ReadFile(const std::string& in_file, if (expected_size != SIZE_MAX && ssize != expected_size) { return absl::UnavailableError("Incorrect size of file"); } - std::vector inbuf{ssize}; + std::vector inbuf((ssize)); f.read(reinterpret_cast(inbuf.data()), ssize); if (ssize != f.gcount()) { return absl::UnavailableError("Premature end of file");