diff options
author | Paul Cristian Sarbu <paul.cristian.sarbu@huawei.com> | 2024-04-29 12:27:59 +0200 |
---|---|---|
committer | Oliver Reiche <oliver.reiche@huawei.com> | 2024-05-02 10:51:04 +0200 |
commit | a8fc6fc51c6c9ef90ae1480f0ff4448d69b0e235 (patch) | |
tree | d2b63497133aa24223c3a114bccdc5a588dea2a4 /test | |
parent | 6c0471e40c56a92a704fcdcef9c3e7e7e96af3fa (diff) | |
download | justbuild-a8fc6fc51c6c9ef90ae1480f0ff4448d69b0e235.tar.gz |
Small changes to allow gsl-lite support
The gsl-lite implementation is slightly more picky in terms of
type conversions and constness resolution in initializers,
therefore small changes were needed.
Diffstat (limited to 'test')
-rw-r--r-- | test/utils/TARGETS | 2 | ||||
-rw-r--r-- | test/utils/large_objects/large_object_utils.cpp | 6 |
2 files changed, 4 insertions, 4 deletions
diff --git a/test/utils/TARGETS b/test/utils/TARGETS index bbbd363d..9eb5a28a 100644 --- a/test/utils/TARGETS +++ b/test/utils/TARGETS @@ -57,7 +57,7 @@ , "hdrs": ["large_objects/large_object_utils.hpp"] , "srcs": ["large_objects/large_object_utils.cpp"] , "private-deps": - [ ["@", "src", "src/utils/cpp", "gsl"] + [ ["@", "gsl", "", "gsl"] , ["@", "src", "src/buildtool/file_system", "file_system_manager"] ] , "stage": ["test", "utils"] diff --git a/test/utils/large_objects/large_object_utils.cpp b/test/utils/large_objects/large_object_utils.cpp index 6c3000ff..de8e6c7d 100644 --- a/test/utils/large_objects/large_object_utils.cpp +++ b/test/utils/large_objects/large_object_utils.cpp @@ -21,8 +21,8 @@ #include <random> #include <string> +#include "gsl/gsl" #include "src/buildtool/file_system/file_system_manager.hpp" -#include "src/utils/cpp/gsl.hpp" namespace { class Randomizer final { @@ -53,7 +53,7 @@ class ChunkPool final { [[nodiscard]] auto operator[](std::size_t index) const noexcept -> std::string const& { - return gsl::at(pool_, static_cast<std::ptrdiff_t>(index)); + return gsl::at(pool_, index); } private: @@ -64,7 +64,7 @@ class ChunkPool final { Randomizer randomizer{1, std::numeric_limits<char>::max()}; for (std::size_t i = 0; i < pool_.size(); ++i) { - auto& chunk = gsl::at(pool_, static_cast<std::ptrdiff_t>(i)); + auto& chunk = gsl::at(pool_, i); chunk.resize(kChunkLength); for (std::size_t j = 0; j < kChunkLength; ++j) { chunk[j] = randomizer.Get(); |