#include "absl/strings/cord.h"#include <algorithm>#include <climits>#include <cstdio>#include <iterator>#include <map>#include <numeric>#include <random>#include <sstream>#include <type_traits>#include <utility>#include <vector>#include "gmock/gmock.h"#include "gtest/gtest.h"#include "absl/base/casts.h"#include "absl/base/config.h"#include "absl/base/internal/endian.h"#include "absl/base/internal/raw_logging.h"#include "absl/base/macros.h"#include "absl/container/fixed_array.h"#include "absl/hash/hash.h"#include "absl/random/random.h"#include "absl/strings/cord_test_helpers.h"#include "absl/strings/cordz_test_helpers.h"#include "absl/strings/match.h"#include "absl/strings/str_cat.h"#include "absl/strings/str_format.h"#include "absl/strings/string_view.h"
Go to the source code of this file.
Classes | |
| class | AfterExitCordTester |
| struct | CordLeaker |
| class | CordTest |
| class | absl::CordTestPeer |
| struct | LongView |
| struct | ShortView |
Namespaces | |
| absl | |
Typedefs | |
| typedef std::mt19937_64 | RandomEngine |
Functions | |
| static void | AddExternalMemory (absl::string_view s, absl::Cord *dst) |
| static void | AddNewStringBlock (const std::string &str, absl::Cord *dst) |
| static size_t | AppendWithFragments (const std::string &s, RandomEngine *rng, absl::Cord *cord) |
| static void | DeleteExternalString (absl::string_view data, void *arg) |
| static void | DoNothing (absl::string_view, void *) |
| static void | DumpGrowth () |
| static int32_t | GenerateSkewedRandom (RandomEngine *rng, int max_log) |
| static int | GetUniformRandomUpTo (RandomEngine *rng, int upper_bound) |
| static size_t | GetUniformRandomUpTo (RandomEngine *rng, size_t upper_bound) |
| INSTANTIATE_TEST_SUITE_P (WithParam, CordTest, testing::Values(0, 1), CordTest::ToString) | |
| static bool | IsFlat (const absl::Cord &c) |
| static absl::Cord | MakeComposite () |
| static absl::Cord | MakeExternalCord (int size) |
| static absl::Cord | MakeHuge (absl::string_view prefix) |
| static std::string | RandomLowercaseString (RandomEngine *rng) |
| static std::string | RandomLowercaseString (RandomEngine *rng, size_t length) |
| constexpr int | SimpleStrlen (const char *p) |
| TEST (CordRepFlat, AllFlatCapacities) | |
| TEST (CordRepFlat, AllFlatSizes) | |
| TEST (CordRepFlat, MaxFlatSize) | |
| TEST (CordRepFlat, MaxLargeFlatSize) | |
| TEST_P (CordTest, AdvanceAndReadOnDataEdge) | |
| TEST_P (CordTest, AdvanceAndReadOnSubstringDataEdge) | |
| TEST_P (CordTest, AllFlatSizes) | |
| TEST_P (CordTest, AppendAndPrependBufferArePrecise) | |
| TEST_P (CordTest, AppendEmptyBuffer) | |
| TEST_P (CordTest, AppendEmptyBufferToFlat) | |
| TEST_P (CordTest, AppendEmptyBufferToTree) | |
| TEST_P (CordTest, AppendLargeBuffer) | |
| TEST_P (CordTest, AppendSelf) | |
| TEST_P (CordTest, AppendSmallBuffer) | |
| TEST_P (CordTest, Assignment) | |
| TEST_P (CordTest, BtreeHostileSplitInsertJoin) | |
| TEST_P (CordTest, CharIteratorAdvanceAndRead) | |
| TEST_P (CordTest, CharIteratorOperations) | |
| TEST_P (CordTest, CharIteratorTraits) | |
| TEST_P (CordTest, Concat_Append) | |
| TEST_P (CordTest, ConstinitConstructor) | |
| TEST_P (CordTest, CopyToString) | |
| TEST_P (CordTest, CordChunkIteratorOperations) | |
| TEST_P (CordTest, CordChunkIteratorTraits) | |
| TEST_P (CordTest, DiabolicalGrowth) | |
| TEST_P (CordTest, ExpectedChecksum) | |
| TEST_P (CordTest, Flatten) | |
| TEST_P (CordTest, ForEachChunk) | |
| TEST_P (CordTest, Format) | |
| TEST_P (CordTest, GetAppendBufferOnEmptyCord) | |
| TEST_P (CordTest, GetAppendBufferOnFlat) | |
| TEST_P (CordTest, GetAppendBufferOnFlatWithoutMinCapacity) | |
| TEST_P (CordTest, GetAppendBufferOnInlinedCord) | |
| TEST_P (CordTest, GetAppendBufferOnInlinedCordWithCapacityCloseToMax) | |
| TEST_P (CordTest, GetAppendBufferOnSharedCord) | |
| TEST_P (CordTest, GetAppendBufferOnSubstring) | |
| TEST_P (CordTest, GetAppendBufferOnTree) | |
| TEST_P (CordTest, GetAppendBufferOnTreeWithoutMinCapacity) | |
| TEST_P (CordTest, GigabyteCordFromExternal) | |
| TEST_P (CordTest, Hardening) | |
| TEST_P (CordTest, HugeCord) | |
| TEST_P (CordTest, MakeFragmentedCordFromInitializerList) | |
| TEST_P (CordTest, MakeFragmentedCordFromVector) | |
| TEST_P (CordTest, MultipleLengths) | |
| TEST_P (CordTest, PrependLargeBuffer) | |
| TEST_P (CordTest, PrependSmallBuffer) | |
| TEST_P (CordTest, SmallBufferAssignFromOwnData) | |
| TEST_P (CordTest, StartsEndsWith) | |
| TEST_P (CordTest, StreamingOutput) | |
| TEST_P (CordTest, Subcord) | |
| TEST_P (CordTest, Swap) | |
| TEST_P (CordTest, TryFlatCommonlyAssumedInvariants) | |
| TEST_P (CordTest, TryFlatConcat) | |
| TEST_P (CordTest, TryFlatEmpty) | |
| TEST_P (CordTest, TryFlatExternal) | |
| TEST_P (CordTest, TryFlatFlat) | |
| TEST_P (CordTest, TryFlatSubstrExternal) | |
| TEST_P (CordTest, TryFlatSubstrFlat) | |
| TEST_P (CordTest, TryFlatSubstrInlined) | |
| template<typename Str > | |
| void | TestConstinitConstructor (Str) |
| static void | VerifyCharIterator (const absl::Cord &cord) |
| static void | VerifyChunkIterator (const absl::Cord &cord, size_t expected_chunks) |
| static void | VerifyCopyToString (const absl::Cord &cord) |
| static void | VerifyFlatten (absl::Cord c) |
Variables | |
| static constexpr auto | FLAT = absl::cord_internal::FLAT |
| static constexpr auto | MAX_FLAT_TAG = absl::cord_internal::MAX_FLAT_TAG |
| bool | my_unique_true_boolean = true |
| typedef std::mt19937_64 RandomEngine |
Definition at line 50 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 122 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 166 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 139 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 115 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 113 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 129 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 84 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 66 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 75 of file abseil-cpp/absl/strings/cord_test.cc.
| INSTANTIATE_TEST_SUITE_P | ( | WithParam | , |
| CordTest | , | ||
| testing::Values(0, 1) | , | ||
| CordTest::ToString | |||
| ) |
|
static |
Definition at line 951 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 175 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 381 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 1920 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 90 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 105 of file abseil-cpp/absl/strings/cord_test.cc.
Definition at line 2583 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST | ( | CordRepFlat | , |
| AllFlatCapacities | |||
| ) |
Definition at line 259 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST | ( | CordRepFlat | , |
| AllFlatSizes | |||
| ) |
Definition at line 316 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST | ( | CordRepFlat | , |
| MaxFlatSize | |||
| ) |
Definition at line 299 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST | ( | CordRepFlat | , |
| MaxLargeFlatSize | |||
| ) |
Definition at line 309 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AdvanceAndReadOnDataEdge | |||
| ) |
Definition at line 2135 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AdvanceAndReadOnSubstringDataEdge | |||
| ) |
Definition at line 2169 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AllFlatSizes | |||
| ) |
Definition at line 327 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendAndPrependBufferArePrecise | |||
| ) |
Definition at line 639 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendEmptyBuffer | |||
| ) |
Definition at line 600 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendEmptyBufferToFlat | |||
| ) |
Definition at line 606 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendEmptyBufferToTree | |||
| ) |
Definition at line 612 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendLargeBuffer | |||
| ) |
Definition at line 692 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendSelf | |||
| ) |
Definition at line 1960 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| AppendSmallBuffer | |||
| ) |
Definition at line 619 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Assignment | |||
| ) |
Definition at line 396 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| BtreeHostileSplitInsertJoin | |||
| ) |
Definition at line 2472 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CharIteratorAdvanceAndRead | |||
| ) |
Definition at line 2350 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CharIteratorOperations | |||
| ) |
Definition at line 2315 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CharIteratorTraits | |||
| ) |
Definition at line 2206 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Concat_Append | |||
| ) |
Definition at line 1877 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| ConstinitConstructor | |||
| ) |
Definition at line 2601 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CopyToString | |||
| ) |
Definition at line 592 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CordChunkIteratorOperations | |||
| ) |
Definition at line 2098 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| CordChunkIteratorTraits | |||
| ) |
Definition at line 2017 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| DiabolicalGrowth | |||
| ) |
Definition at line 1894 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| ExpectedChecksum | |||
| ) |
Definition at line 2761 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Flatten | |||
| ) |
Definition at line 979 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| ForEachChunk | |||
| ) |
Definition at line 2396 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Format | |||
| ) |
Definition at line 2431 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnEmptyCord | |||
| ) |
Definition at line 736 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnFlat | |||
| ) |
Definition at line 771 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnFlatWithoutMinCapacity | |||
| ) |
Definition at line 786 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnInlinedCord | |||
| ) |
Definition at line 743 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnInlinedCordWithCapacityCloseToMax | |||
| ) |
Definition at line 755 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnSharedCord | |||
| ) |
Definition at line 852 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnSubstring | |||
| ) |
Definition at line 837 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnTree | |||
| ) |
Definition at line 800 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GetAppendBufferOnTreeWithoutMinCapacity | |||
| ) |
Definition at line 823 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| GigabyteCordFromExternal | |||
| ) |
Definition at line 346 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Hardening | |||
| ) |
Definition at line 2441 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| HugeCord | |||
| ) |
Definition at line 1949 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| MakeFragmentedCordFromInitializerList | |||
| ) |
Definition at line 1973 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| MakeFragmentedCordFromVector | |||
| ) |
Definition at line 1995 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| MultipleLengths | |||
| ) |
Definition at line 1035 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| PrependLargeBuffer | |||
| ) |
Definition at line 714 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| PrependSmallBuffer | |||
| ) |
Definition at line 672 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| SmallBufferAssignFromOwnData | |||
| ) |
Definition at line 2415 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| StartsEndsWith | |||
| ) |
Definition at line 452 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| StreamingOutput | |||
| ) |
Definition at line 2387 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Subcord | |||
| ) |
Definition at line 486 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| Swap | |||
| ) |
Definition at line 551 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatCommonlyAssumedInvariants | |||
| ) |
Definition at line 922 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatConcat | |||
| ) |
Definition at line 903 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatEmpty | |||
| ) |
Definition at line 878 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatExternal | |||
| ) |
Definition at line 909 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatFlat | |||
| ) |
Definition at line 883 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatSubstrExternal | |||
| ) |
Definition at line 915 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatSubstrFlat | |||
| ) |
Definition at line 896 of file abseil-cpp/absl/strings/cord_test.cc.
| TEST_P | ( | CordTest | , |
| TryFlatSubstrInlined | |||
| ) |
Definition at line 889 of file abseil-cpp/absl/strings/cord_test.cc.
| void TestConstinitConstructor | ( | Str | ) |
Definition at line 2542 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 2240 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 2051 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 573 of file abseil-cpp/absl/strings/cord_test.cc.
|
static |
Definition at line 955 of file abseil-cpp/absl/strings/cord_test.cc.
|
staticconstexpr |
Definition at line 47 of file abseil-cpp/absl/strings/cord_test.cc.
|
staticconstexpr |
Definition at line 48 of file abseil-cpp/absl/strings/cord_test.cc.
Definition at line 394 of file abseil-cpp/absl/strings/cord_test.cc.