Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
rope_test.cc File Reference

Tests for Aleph::Rope (tpl_rope.H). More...

#include <gtest/gtest.h>
#include <tpl_rope.H>
#include <atomic>
#include <chrono>
#include <cstddef>
#include <cstdlib>
#include <new>
#include <random>
#include <stdexcept>
#include <string>
#include <string_view>
Include dependency graph for rope_test.cc:

Go to the source code of this file.

Macros

#define ALEPH_ROPE_TEST_UNDER_TSAN   0
 

Functions

void * operator new (std::size_t size)
 
void * operator new[] (std::size_t size)
 
void * operator new (std::size_t size, const std::nothrow_t &) noexcept
 
void * operator new[] (std::size_t size, const std::nothrow_t &) noexcept
 
void operator delete (void *ptr) noexcept
 
void operator delete[] (void *ptr) noexcept
 
void operator delete (void *ptr, std::size_t) noexcept
 
void operator delete[] (void *ptr, std::size_t) noexcept
 
void operator delete (void *ptr, const std::nothrow_t &) noexcept
 
void operator delete[] (void *ptr, const std::nothrow_t &) noexcept
 
 TEST (Rope, DefaultConstructedRopeIsEmpty)
 
 TEST (Rope, VerifyHoldsForEmptyAndTrivialRopes)
 
 TEST (Rope, ConstructFromStringView)
 
 TEST (Rope, ConstructFromEmptyStringViewIsEmpty)
 
 TEST (Rope, AtReturnsCorrectCharacters)
 
 TEST (Rope, AtThrowsOutOfRange)
 
 TEST (Rope, ConcatCombinesTwoRopes)
 
 TEST (Rope, ConcatWithEmptyRopeIsIdentity)
 
 TEST (Rope, SubstrExtractsCorrectRange)
 
 TEST (Rope, SubstrThrowsOutOfRange)
 
 TEST (Rope, SubstrOfWholeRopeSharesRoot)
 
 TEST (Rope, InsertSplicesInAnotherRope)
 
 TEST (Rope, InsertAtBoundariesWorks)
 
 TEST (Rope, InsertThrowsOutOfRange)
 
 TEST (Rope, EraseRemovesRange)
 
 TEST (Rope, EraseWholeRopeGivesEmpty)
 
 TEST (Rope, EraseZeroLengthIsIdentity)
 
 TEST (Rope, IdentityEditsDoNotAllocate)
 
 TEST (Rope, EraseThrowsOutOfRange)
 
 TEST (Rope, FlattenReturnsAllCharactersInOrder)
 
 TEST (Rope, EqualityComparesContentNotIdentity)
 
 TEST (Rope, EqualityHandlesMismatchedLeafBoundariesAndSharedSubtrees)
 
 TEST (Rope, CopyIsIndependentOfLaterOperationsOnTheOriginalVariable)
 
 TEST (Rope, TinyLeafSizeStillProducesCorrectResults)
 
 TEST (Rope, RepeatedSingleCharacterConcatStaysCorrect)
 
 TEST (Rope, RepeatedSinglePrependStaysCorrect)
 
 TEST (Rope, SubstrAtExactLeafBoundaries)
 
 TEST (Rope, RandomizedEditScriptMatchesStdString)
 
 TEST (Rope, RepeatedSmallConcatStaysFastEnoughToProveAbsorptionFired)
 
 TEST (Rope, CopyAndSmallConcatStayFastRegardlessOfSourceSize)
 
 TEST (Rope, FailedAllocationDuringConcatLeavesExistingRopesUnchanged)
 
 TEST (Rope, SubstrOfManyLeafRangeStaysCorrectAndFastRegardlessOfTotalSize)
 
 TEST (Rope, RepeatedSelfConcatThrowsOverflowErrorInsteadOfWrappingOrHanging)
 

Detailed Description

Tests for Aleph::Rope (tpl_rope.H).

Definition in file rope_test.cc.

Macro Definition Documentation

◆ ALEPH_ROPE_TEST_UNDER_TSAN

#define ALEPH_ROPE_TEST_UNDER_TSAN   0

Definition at line 69 of file rope_test.cc.

Function Documentation

◆ operator delete() [1/3]

void operator delete ( void *  ptr)
noexcept

Definition at line 189 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator delete() [2/3]

void operator delete ( void *  ptr,
const std::nothrow_t &   
)
noexcept

Definition at line 209 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator delete() [3/3]

void operator delete ( void *  ptr,
std::size_t   
)
noexcept

Definition at line 199 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator delete[]() [1/3]

void operator delete[] ( void *  ptr)
noexcept

Definition at line 194 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator delete[]() [2/3]

void operator delete[] ( void *  ptr,
const std::nothrow_t &   
)
noexcept

Definition at line 214 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator delete[]() [3/3]

void operator delete[] ( void *  ptr,
std::size_t   
)
noexcept

Definition at line 204 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ operator new() [1/2]

void * operator new ( std::size_t  size)

Definition at line 155 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and Aleph::size().

◆ operator new() [2/2]

void * operator new ( std::size_t  size,
const std::nothrow_t &   
)
noexcept

Definition at line 165 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and Aleph::size().

◆ operator new[]() [1/2]

void * operator new[] ( std::size_t  size)

Definition at line 160 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and Aleph::size().

◆ operator new[]() [2/2]

void * operator new[] ( std::size_t  size,
const std::nothrow_t &   
)
noexcept

Definition at line 177 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and Aleph::size().

◆ TEST() [1/33]

TEST ( Rope  ,
AtReturnsCorrectCharacters   
)

Definition at line 260 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [2/33]

TEST ( Rope  ,
AtThrowsOutOfRange   
)

◆ TEST() [3/33]

◆ TEST() [4/33]

◆ TEST() [5/33]

TEST ( Rope  ,
ConstructFromEmptyStringViewIsEmpty   
)

Definition at line 253 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [6/33]

TEST ( Rope  ,
ConstructFromStringView   
)

Definition at line 245 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [7/33]

TEST ( Rope  ,
CopyAndSmallConcatStayFastRegardlessOfSourceSize   
)

◆ TEST() [8/33]

TEST ( Rope  ,
CopyIsIndependentOfLaterOperationsOnTheOriginalVariable   
)

◆ TEST() [9/33]

TEST ( Rope  ,
DefaultConstructedRopeIsEmpty   
)

Definition at line 230 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [10/33]

TEST ( Rope  ,
EqualityComparesContentNotIdentity   
)

Definition at line 431 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ TEST() [11/33]

TEST ( Rope  ,
EqualityHandlesMismatchedLeafBoundariesAndSharedSubtrees   
)

Definition at line 445 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and Aleph::concat().

◆ TEST() [12/33]

◆ TEST() [13/33]

TEST ( Rope  ,
EraseThrowsOutOfRange   
)

Definition at line 414 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [14/33]

TEST ( Rope  ,
EraseWholeRopeGivesEmpty   
)

Definition at line 371 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [15/33]

TEST ( Rope  ,
EraseZeroLengthIsIdentity   
)

Definition at line 377 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [16/33]

TEST ( Rope  ,
FailedAllocationDuringConcatLeavesExistingRopesUnchanged   
)

Definition at line 745 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching().

◆ TEST() [17/33]

TEST ( Rope  ,
FlattenReturnsAllCharactersInOrder   
)

◆ TEST() [18/33]

TEST ( Rope  ,
IdentityEditsDoNotAllocate   
)

◆ TEST() [19/33]

TEST ( Rope  ,
InsertAtBoundariesWorks   
)

Definition at line 346 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [20/33]

◆ TEST() [21/33]

TEST ( Rope  ,
InsertThrowsOutOfRange   
)

Definition at line 355 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [22/33]

TEST ( Rope  ,
RandomizedEditScriptMatchesStdString   
)

Definition at line 574 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), random_string(), and rng.

◆ TEST() [23/33]

TEST ( Rope  ,
RepeatedSelfConcatThrowsOverflowErrorInsteadOfWrappingOrHanging   
)

Definition at line 866 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [24/33]

TEST ( Rope  ,
RepeatedSingleCharacterConcatStaysCorrect   
)

Definition at line 515 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [25/33]

TEST ( Rope  ,
RepeatedSinglePrependStaysCorrect   
)

Definition at line 537 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [26/33]

TEST ( Rope  ,
RepeatedSmallConcatStaysFastEnoughToProveAbsorptionFired   
)

Definition at line 645 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), Aleph::count(), N, and r.

◆ TEST() [27/33]

TEST ( Rope  ,
SubstrAtExactLeafBoundaries   
)

Definition at line 559 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [28/33]

TEST ( Rope  ,
SubstrExtractsCorrectRange   
)

Definition at line 302 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [29/33]

TEST ( Rope  ,
SubstrOfManyLeafRangeStaysCorrectAndFastRegardlessOfTotalSize   
)

Definition at line 810 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), r, and rng.

◆ TEST() [30/33]

TEST ( Rope  ,
SubstrOfWholeRopeSharesRoot   
)

Definition at line 320 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [31/33]

TEST ( Rope  ,
SubstrThrowsOutOfRange   
)

Definition at line 312 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [32/33]

TEST ( Rope  ,
TinyLeafSizeStillProducesCorrectResults   
)

Definition at line 494 of file rope_test.cc.

References Aleph::blossom_maximum_cardinality_matching(), and r.

◆ TEST() [33/33]

TEST ( Rope  ,
VerifyHoldsForEmptyAndTrivialRopes   
)