|
proxygen
|
#include <folly/small_vector.h>#include <folly/sorted_vector_types.h>#include <iostream>#include <iterator>#include <limits>#include <memory>#include <sstream>#include <string>#include <vector>#include <boost/algorithm/string.hpp>#include <folly/Conv.h>#include <folly/Traits.h>#include <folly/portability/GTest.h>Go to the source code of this file.
Classes | |
| struct | CheckedInt |
Functions | |
| TEST (small_vector, BasicGuarantee) | |
| TEST (small_vector, leak_test) | |
| TEST (small_vector, Insert) | |
| TEST (small_vector, Swap) | |
| TEST (small_vector, Emplace) | |
| TEST (small_vector, Erase) | |
| TEST (small_vector, GrowShrinkGrow) | |
| TEST (small_vector, Iteration) | |
| TEST (small_vector, NonCopyableType) | |
| TEST (small_vector, MoveConstructor) | |
| TEST (small_vector, NoHeap) | |
| TEST (small_vector, MaxSize) | |
| TEST (small_vector, AllHeap) | |
| TEST (small_vector, Basic) | |
| TEST (small_vector, Capacity) | |
| TEST (small_vector, SelfPushBack) | |
| TEST (small_vector, SelfEmplaceBack) | |
| TEST (small_vector, SelfInsert) | |
| TEST (small_vector, ForwardingEmplaceInsideVector) | |
| TEST (small_vector, LVEmplaceInsideVector) | |
| TEST (small_vector, CLVEmplaceInsideVector) | |
| TEST (small_vector, RVEmplaceInsideVector) | |
| TEST (small_vector, LVPushValueInsideVector) | |
| TEST (small_vector, RVPushValueInsideVector) | |
| TEST (small_vector, EmplaceIterCtor) | |
| TEST (small_vector, InputIterator) | |
| TEST (small_vector, NoCopyCtor) | |
| TEST (small_vector, ZeroInitializable) | |
| TEST (small_vector, InsertMoreThanGrowth) | |
| TEST (small_vector, EmplaceBackExponentialGrowth) | |
| TEST (small_vector, InsertExponentialGrowth) | |
| TEST (small_vector, InsertNExponentialGrowth) | |
| TEST (small_vector, EmplaceBackEfficiency) | |
| TEST (small_vector, RVPushBackEfficiency) | |
| TEST (small_vector, CLVPushBackEfficiency) | |
| TEST (small_vector, StorageForSortedVectorMap) | |
| TEST (small_vector, NoHeapStorageForSortedVectorMap) | |
| TEST (small_vector, StorageForSortedVectorSet) | |
| TEST (small_vector, NoHeapStorageForSortedVectorSet) | |
| TEST (small_vector, SelfMoveAssignmentForVectorOfPair) | |
| TEST (small_vector, SelfCopyAssignmentForVectorOfPair) | |
| TEST | ( | small_vector | , |
| BasicGuarantee | |||
| ) |
Definition at line 265 of file small_vector_test.cpp.
References b, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), and v.
| TEST | ( | small_vector | , |
| leak_test | |||
| ) |
Definition at line 323 of file small_vector_test.cpp.
References i, and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back().
| TEST | ( | small_vector | , |
| Insert | |||
| ) |
Definition at line 332 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), EXPECT_EQ, EXPECT_TRUE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| Swap | |||
| ) |
Definition at line 355 of file small_vector_test.cpp.
References folly::gen::all(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::assign(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::end(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::erase(), EXPECT_EQ, EXPECT_FALSE, EXPECT_LT, EXPECT_TRUE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and folly::swap().
| TEST | ( | small_vector | , |
| Emplace | |||
| ) |
Definition at line 410 of file small_vector_test.cpp.
References a, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::front(), i, and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::reserve().
| TEST | ( | small_vector | , |
| Erase | |||
| ) |
Definition at line 439 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::empty(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::end(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::erase(), EXPECT_EQ, EXPECT_TRUE, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::front(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::resize(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and v.
| TEST | ( | small_vector | , |
| GrowShrinkGrow | |||
| ) |
Definition at line 469 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::empty(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::erase(), EXPECT_EQ, EXPECT_GT, EXPECT_LT, EXPECT_TRUE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::resize(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::shrink_to_fit(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| Iteration | |||
| ) |
Definition at line 497 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::erase(), EXPECT_EQ, EXPECT_TRUE, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), and s.
| TEST | ( | small_vector | , |
| NonCopyableType | |||
| ) |
Definition at line 521 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace(), EXPECT_EQ, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), folly::gen::move, and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| MoveConstructor | |||
| ) |
Definition at line 553 of file small_vector_test.cpp.
References EXPECT_EQ, folly::gen::move, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| NoHeap | |||
| ) |
Definition at line 568 of file small_vector_test.cpp.
References EXPECT_EQ, EXPECT_FALSE, EXPECT_TRUE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::max_size(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), string, and v.
| TEST | ( | small_vector | , |
| MaxSize | |||
| ) |
Definition at line 615 of file small_vector_test.cpp.
References EXPECT_EQ, and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::max_size().
| TEST | ( | small_vector | , |
| AllHeap | |||
| ) |
Definition at line 622 of file small_vector_test.cpp.
References a, b, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), c, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::empty(), EXPECT_EQ, EXPECT_TRUE, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), folly::operator==(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and val.
| TEST | ( | small_vector | , |
| Basic | |||
| ) |
Definition at line 643 of file small_vector_test.cpp.
References a, b, c, EXPECT_EQ, EXPECT_GT, EXPECT_TRUE, folly::gen::move, and s.
| TEST | ( | small_vector | , |
| Capacity | |||
| ) |
Definition at line 687 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), EXPECT_EQ, EXPECT_GT, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and v.
| TEST | ( | small_vector | , |
| SelfPushBack | |||
| ) |
Definition at line 731 of file small_vector_test.cpp.
References EXPECT_EQ, i, folly::gen::move, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| SelfEmplaceBack | |||
| ) |
Definition at line 745 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, i, folly::gen::move, and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| SelfInsert | |||
| ) |
Definition at line 759 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::end(), EXPECT_EQ, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), folly::gen::move, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), and folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size().
| TEST | ( | small_vector | , |
| ForwardingEmplaceInsideVector | |||
| ) |
Definition at line 811 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| LVEmplaceInsideVector | |||
| ) |
Definition at line 820 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| CLVEmplaceInsideVector | |||
| ) |
Definition at line 829 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| RVEmplaceInsideVector | |||
| ) |
Definition at line 839 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), i, folly::gen::move, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| LVPushValueInsideVector | |||
| ) |
Definition at line 849 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| RVPushValueInsideVector | |||
| ) |
Definition at line 858 of file small_vector_test.cpp.
References ASSERT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::back(), i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), v, and CheckedInt::value.
| TEST | ( | small_vector | , |
| EmplaceIterCtor | |||
| ) |
Definition at line 868 of file small_vector_test.cpp.
| TEST | ( | small_vector | , |
| InputIterator | |||
| ) |
Definition at line 876 of file small_vector_test.cpp.
References ASSERT_EQ, i, string, and values().
| TEST | ( | small_vector | , |
| NoCopyCtor | |||
| ) |
Definition at line 897 of file small_vector_test.cpp.
References ASSERT_EQ, EXPECT_EQ, folly::gen::field(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| ZeroInitializable | |||
| ) |
Definition at line 913 of file small_vector_test.cpp.
References ASSERT_EQ, EXPECT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| InsertMoreThanGrowth | |||
| ) |
Definition at line 921 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::end(), EXPECT_EQ, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), and test().
| TEST | ( | small_vector | , |
| EmplaceBackExponentialGrowth | |||
| ) |
Definition at line 929 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_LE, i, and test().
| TEST | ( | small_vector | , |
| InsertExponentialGrowth | |||
| ) |
Definition at line 942 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), EXPECT_LE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), and test().
| TEST | ( | small_vector | , |
| InsertNExponentialGrowth | |||
| ) |
Definition at line 955 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::begin(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), EXPECT_EQ, EXPECT_LE, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::insert(), folly::pushmi::__adl::noexcept(), folly::detail::rhs, and test().
| TEST | ( | small_vector | , |
| EmplaceBackEfficiency | |||
| ) |
Definition at line 998 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, EXPECT_LT, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| RVPushBackEfficiency | |||
| ) |
Definition at line 1014 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), EXPECT_EQ, EXPECT_LT, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| CLVPushBackEfficiency | |||
| ) |
Definition at line 1032 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::capacity(), counter, EXPECT_EQ, EXPECT_LT, i, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::push_back(), folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| StorageForSortedVectorMap | |||
| ) |
Definition at line 1051 of file small_vector_test.cpp.
References EXPECT_EQ, and test().
| TEST | ( | small_vector | , |
| NoHeapStorageForSortedVectorMap | |||
| ) |
Definition at line 1063 of file small_vector_test.cpp.
References EXPECT_EQ, EXPECT_THROW, and test().
| TEST | ( | small_vector | , |
| StorageForSortedVectorSet | |||
| ) |
Definition at line 1075 of file small_vector_test.cpp.
References EXPECT_EQ, and test().
| TEST | ( | small_vector | , |
| NoHeapStorageForSortedVectorSet | |||
| ) |
Definition at line 1087 of file small_vector_test.cpp.
References EXPECT_EQ, EXPECT_THROW, and test().
| TEST | ( | small_vector | , |
| SelfMoveAssignmentForVectorOfPair | |||
| ) |
Definition at line 1099 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, folly::gen::first, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().
| TEST | ( | small_vector | , |
| SelfCopyAssignmentForVectorOfPair | |||
| ) |
Definition at line 1109 of file small_vector_test.cpp.
References folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::emplace_back(), EXPECT_EQ, folly::gen::first, folly::small_vector< Value, RequestedMaxInline, PolicyA, PolicyB, PolicyC >::size(), and test().