chromium/third_party/abseil-cpp/absl/strings/cordz_test.cc

// Copyright 2021 The Abseil Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     https://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

#include <cstddef>
#include <cstring>
#include <ostream>
#include <string>
#include <utility>

#include "gmock/gmock.h"
#include "gtest/gtest.h"
#include "absl/base/config.h"
#include "absl/strings/cord.h"
#include "absl/strings/cord_buffer.h"
#include "absl/strings/cord_test_helpers.h"
#include "absl/strings/cordz_test_helpers.h"
#include "absl/strings/internal/cord_internal.h"
#include "absl/strings/internal/cordz_info.h"
#include "absl/strings/internal/cordz_sample_token.h"
#include "absl/strings/internal/cordz_statistics.h"
#include "absl/strings/internal/cordz_update_tracker.h"
#include "absl/strings/str_cat.h"
#include "absl/strings/string_view.h"

#ifdef ABSL_INTERNAL_CORDZ_ENABLED

Eq;
AnyOf;

namespace absl {
ABSL_NAMESPACE_BEGIN

CordzInfo;
CordzSampleToken;
CordzStatistics;
CordzUpdateTracker;
Method;

// Do not print cord contents, we only care about 'size' perhaps.
// Note that this method must be inside the named namespace.
inline void PrintTo(const Cord& cord, std::ostream* s) {}

namespace {

auto constexpr kMaxInline =;

// Returns a string_view value of the specified length
// We do this to avoid 'consuming' large strings in Cord by default.
absl::string_view MakeString(size_t size) {}

absl::string_view MakeString(TestCordSize size) {}

// Returns a cord with a sampled method of kAppendString.
absl::Cord MakeAppendStringCord(TestCordSize size) {}

std::string TestParamToString(::testing::TestParamInfo<TestCordSize> size) {}

class CordzUpdateTest : public testing::TestWithParam<TestCordSize> {};

template <typename T>
std::string ParamToString(::testing::TestParamInfo<T> param) {}

INSTANTIATE_TEST_SUITE_P();

class CordzStringTest : public testing::TestWithParam<TestCordSize> {};

INSTANTIATE_TEST_SUITE_P();

TEST(CordzTest, ConstructSmallArray) {}

TEST(CordzTest, ConstructLargeArray) {}

TEST_P(CordzStringTest, ConstructString) {}

TEST(CordzTest, CopyConstructFromUnsampled) {}

TEST(CordzTest, CopyConstructFromSampled) {}

TEST(CordzTest, MoveConstruct) {}

TEST_P(CordzUpdateTest, AssignUnsampledCord) {}

TEST_P(CordzUpdateTest, AssignSampledCord) {}

TEST(CordzUpdateTest, AssignSampledCordToInlined) {}

TEST(CordzUpdateTest, AssignSampledCordToUnsampledCord) {}

TEST(CordzUpdateTest, AssignUnsampledCordToSampledCordWithoutSampling) {}

TEST(CordzUpdateTest, AssignUnsampledCordToSampledCordWithSampling) {}

TEST(CordzUpdateTest, AssignSampledCordToSampledCord) {}

TEST(CordzUpdateTest, AssignUnsampledCordToSampledCord) {}

TEST(CordzTest, AssignInlinedCordToSampledCord) {}

TEST(CordzUpdateTest, MoveAssignCord) {}

TEST_P(CordzUpdateTest, AssignLargeArray) {}

TEST_P(CordzUpdateTest, AssignSmallArray) {}

TEST_P(CordzUpdateTest, AssignInlinedArray) {}

TEST_P(CordzStringTest, AssignStringToInlined) {}

TEST_P(CordzStringTest, AssignStringToCord) {}

TEST_P(CordzUpdateTest, AssignInlinedString) {}

TEST_P(CordzUpdateTest, AppendCord) {}

TEST_P(CordzUpdateTest, MoveAppendCord) {}

TEST_P(CordzUpdateTest, AppendSmallArray) {}

TEST_P(CordzUpdateTest, AppendLargeArray) {}

TEST_P(CordzStringTest, AppendStringToEmpty) {}

TEST_P(CordzStringTest, AppendStringToInlined) {}

TEST_P(CordzStringTest, AppendStringToCord) {}

TEST(CordzTest, MakeCordFromExternal) {}

TEST(CordzTest, MakeCordFromEmptyExternal) {}

TEST_P(CordzUpdateTest, PrependCord) {}

TEST_P(CordzUpdateTest, PrependSmallArray) {}

TEST_P(CordzUpdateTest, PrependLargeArray) {}

TEST_P(CordzStringTest, PrependStringToEmpty) {}

TEST_P(CordzStringTest, PrependStringToInlined) {}

TEST_P(CordzStringTest, PrependStringToCord) {}

TEST(CordzTest, RemovePrefix) {}

TEST(CordzTest, RemoveSuffix) {}

TEST(CordzTest, SubCordFromUnsampledCord) {}

TEST(CordzTest, SubCordFromSampledCord) {}

TEST(CordzTest, SmallSubCord) {}

}  // namespace

ABSL_NAMESPACE_END
}  // namespace absl

#endif  // ABSL_INTERNAL_CORDZ_ENABLED