diff options
author | Daniel Cheng <dcheng@chromium.org> | 2022-03-04 09:51:11 +0000 |
---|---|---|
committer | Copybara-Service <copybara-worker@google.com> | 2022-03-04 02:05:14 -0800 |
commit | aa6909a566735820ab0ca4de6f4045eac691f904 (patch) | |
tree | 4592ff1f0e946d5027186824793f7f520b7701ae | |
parent | aa5ea608a40133d8287870e189750d62cb9dc2f7 (diff) | |
download | zlib-aa6909a566735820ab0ca4de6f4045eac691f904.tar.gz |
Migrate base::size() to std::size() in //third_party.
Remaining uses are all in explicit customization points for third-party
libraries, or in the case of //third_party/sudden_motion_sensor,
libraries that are effectively forked.
Bug: 1299695
Change-Id: Ic49e481775d76fb80efc7170bf9baa1534e7d1f2
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3500722
Reviewed-by: Lei Zhang <thestig@chromium.org>
Owners-Override: Lei Zhang <thestig@chromium.org>
Commit-Queue: Daniel Cheng <dcheng@chromium.org>
Cr-Commit-Position: refs/heads/main@{#977575}
NOKEYCHECK=True
GitOrigin-RevId: 05d0147c3ebf761316fa24197a6cb3de19ec1d7f
-rw-r--r-- | google/compression_utils_unittest.cc | 16 | ||||
-rw-r--r-- | google/zip_reader_unittest.cc | 4 |
2 files changed, 10 insertions, 10 deletions
diff --git a/google/compression_utils_unittest.cc b/google/compression_utils_unittest.cc index 415b9ab..76572e5 100644 --- a/google/compression_utils_unittest.cc +++ b/google/compression_utils_unittest.cc @@ -7,9 +7,9 @@ #include <stddef.h> #include <stdint.h> +#include <iterator> #include <string> -#include "base/cxx17_backports.h" #include "testing/gtest/include/gtest/gtest.h" namespace compression { @@ -33,24 +33,24 @@ const uint8_t kCompressedData[] = { } // namespace TEST(CompressionUtilsTest, GzipCompression) { - std::string data(reinterpret_cast<const char*>(kData), base::size(kData)); + std::string data(reinterpret_cast<const char*>(kData), std::size(kData)); std::string compressed_data; EXPECT_TRUE(GzipCompress(data, &compressed_data)); std::string golden_compressed_data( reinterpret_cast<const char*>(kCompressedData), - base::size(kCompressedData)); + std::size(kCompressedData)); EXPECT_EQ(golden_compressed_data, compressed_data); } TEST(CompressionUtilsTest, GzipUncompression) { std::string compressed_data(reinterpret_cast<const char*>(kCompressedData), - base::size(kCompressedData)); + std::size(kCompressedData)); std::string uncompressed_data; EXPECT_TRUE(GzipUncompress(compressed_data, &uncompressed_data)); std::string golden_data(reinterpret_cast<const char*>(kData), - base::size(kData)); + std::size(kData)); EXPECT_EQ(golden_data, uncompressed_data); } @@ -59,7 +59,7 @@ TEST(CompressionUtilsTest, GzipUncompressionFromSpanToString) { EXPECT_TRUE(GzipUncompress(kCompressedData, &uncompressed_data)); std::string golden_data(reinterpret_cast<const char*>(kData), - base::size(kData)); + std::size(kData)); EXPECT_EQ(golden_data, uncompressed_data); } @@ -84,10 +84,10 @@ TEST(CompressionUtilsTest, LargeInput) { TEST(CompressionUtilsTest, InPlace) { const std::string original_data(reinterpret_cast<const char*>(kData), - base::size(kData)); + std::size(kData)); const std::string golden_compressed_data( reinterpret_cast<const char*>(kCompressedData), - base::size(kCompressedData)); + std::size(kCompressedData)); std::string data(original_data); EXPECT_TRUE(GzipCompress(data, &data)); diff --git a/google/zip_reader_unittest.cc b/google/zip_reader_unittest.cc index cb887a9..363e302 100644 --- a/google/zip_reader_unittest.cc +++ b/google/zip_reader_unittest.cc @@ -8,12 +8,12 @@ #include <stdint.h> #include <string.h> +#include <iterator> #include <string> #include <vector> #include "base/bind.h" #include "base/check.h" -#include "base/cxx17_backports.h" #include "base/files/file.h" #include "base/files/file_path.h" #include "base/files/file_util.h" @@ -516,7 +516,7 @@ TEST_F(ZipReaderTest, OpenFromString) { "\x50\x75\x78\x0b\x00\x01\x04\x8e\xf0\x00\x00\x04\x88\x13\x00\x00" "\x50\x4b\x05\x06\x00\x00\x00\x00\x01\x00\x01\x00\x4e\x00\x00\x00" "\x52\x00\x00\x00\x00\x00"; - std::string data(kTestData, base::size(kTestData)); + std::string data(kTestData, std::size(kTestData)); ZipReader reader; ASSERT_TRUE(reader.OpenFromString(data)); base::FilePath target_path(FILE_PATH_LITERAL("test.txt")); |