xrpld
Loading...
Searching...
No Matches
xrpl::tests Namespace Reference

Classes

struct  Barrier
class  cluster_test
class  LedgerNodeHelpers_test
struct  SHAMapBackingMode
class  SHAMapPathProof
class  SHAMapSyncTest
class  SHAMapTest
class  SHAMapTraversal
class  TestNodeFamily

Functions

 BEAST_DEFINE_TESTSUITE (LedgerNodeHelpers, app, xrpl)
 BEAST_DEFINE_TESTSUITE (cluster, overlay, xrpl)
 TEST (IntrusiveSharedTest, basics)
 TEST (IntrusiveSharedTest, partial_delete)
 TEST (IntrusiveSharedTest, convert_last_strong_to_weak)
 TEST (IntrusiveSharedTest, multithreaded_convert_to_weak_partial_delete)
 TEST (IntrusiveSharedTest, destructor)
 TEST (IntrusiveSharedTest, multithreaded_clear_mixed_variant)
 TEST (IntrusiveSharedTest, multithreaded_clear_mixed_union)
 TEST (IntrusiveSharedTest, multithreaded_locking_weak)
 TEST (FetchPackTest, construct_table)
bool operator!= (SHAMapItem const &a, SHAMapItem const &b)
std::string shamapBackingModeName (::testing::TestParamInfo< SHAMapBackingMode > const &info)
 TEST_P (SHAMapTest, add_traverse_snapshot_build_tear_and_iterate)
 INSTANTIATE_TEST_SUITE_P (BackingMode, SHAMapTest, ::testing::Values(kBackedMode, kUnbackedMode), shamapBackingModeName)
 TEST_F (SHAMapTraversal, forward_iteration_visits_every_key_in_order)
 TEST_F (SHAMapTraversal, upper_bound_walks_the_whole_map)
 TEST_F (SHAMapTraversal, lower_bound_walks_the_whole_map)
 TEST_F (SHAMapTraversal, bounds_agree_with_iteration_for_absent_keys)
 TEST_F (SHAMapTraversal, bounds_on_empty_map_return_end)
 TEST_F (SHAMapTraversal, bounds_on_single_item_map_use_the_leaf_below_the_root)
 TEST_F (SHAMapTraversal, iteration_survives_deletions)
 TEST_F (SHAMapTraversal, iteration_survives_a_collapsed_inner_node)
 TEST_F (SHAMapTraversal, forward_iteration_visits_every_key_in_order_at_leaf_depth)
 TEST_F (SHAMapTraversal, upper_bound_walks_the_whole_map_at_leaf_depth)
 TEST_F (SHAMapTraversal, lower_bound_walks_the_whole_map_at_leaf_depth)
 TEST_F (SHAMapTraversal, bounds_agree_with_iteration_for_absent_keys_at_leaf_depth)
 TEST_F (SHAMapTraversal, iteration_survives_deletions_at_leaf_depth)
 TEST_F (SHAMapPathProof, verify_proof_path)
 TEST_F (SHAMapPathProof, legitimate_deep_path_is_sixty_five_elements)
 TEST_F (SHAMapPathProof, all_inner_path_at_leaf_depth_is_rejected)
static std::pair< std::vector< Blob >, UInt256 > forgeRootOverLeaf (Blob const &leafBlob, UInt256 const &key)
 Wrap a leaf blob in a forged root inner node whose branch for key carries that leaf's hash.
 TEST_F (SHAMapPathProof, substituted_leaf_for_other_key_is_rejected)
constexpr UInt256 kTestKey ("b92891fe4ef6cee585fdc6fda1e09eb4d386363158ec3321b8123e5a772c6ca8")
 TEST (SHAMapNodeIDTest, root_is_prefix_of_every_key)
 TEST (SHAMapNodeIDTest, child_id_is_prefix_of_keys_in_that_branch)
 TEST (SHAMapNodeIDTest, wrong_branch_is_not_prefix_of_key)
 TEST (SHAMapNodeIDTest, prefix_check_is_depth_sensitive)
 TEST (SHAMapNodeIDTest, leaf_id_from_key_is_prefix_of_that_key)
 TEST (SHAMapNodeIDTest, create_id_masks_key_to_depth)
 TEST (SHAMapNodeIDTest, child_of_leaf_depth_id_throws)
 TEST (SHAMapNodeIDDeathTest, out_of_range_depth_is_clamped)
 TEST (SHAMapNodeIDDeathTest, select_branch_clamps_leaf_depth)
 TEST (SHAMapNodeIDTest, deserialize_rejects_out_of_range_depth)
 TEST_F (SHAMapSyncTest, sync)

Variables

constexpr SHAMapBackingMode kBackedMode {.backed = true, .testName = "backed"}
constexpr SHAMapBackingMode kUnbackedMode {.backed = false, .testName = "unbacked"}

Function Documentation

◆ BEAST_DEFINE_TESTSUITE() [1/2]

xrpl::tests::BEAST_DEFINE_TESTSUITE ( LedgerNodeHelpers ,
app ,
xrpl  )

◆ BEAST_DEFINE_TESTSUITE() [2/2]

xrpl::tests::BEAST_DEFINE_TESTSUITE ( cluster ,
overlay ,
xrpl  )

◆ TEST() [1/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
basics  )

Definition at line 193 of file IntrusiveShared.cpp.

◆ TEST() [2/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
partial_delete  )

Definition at line 364 of file IntrusiveShared.cpp.

◆ TEST() [3/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
convert_last_strong_to_weak  )

Definition at line 439 of file IntrusiveShared.cpp.

◆ TEST() [4/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
multithreaded_convert_to_weak_partial_delete  )

Definition at line 458 of file IntrusiveShared.cpp.

◆ TEST() [5/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
destructor  )

Definition at line 528 of file IntrusiveShared.cpp.

◆ TEST() [6/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
multithreaded_clear_mixed_variant  )

Definition at line 583 of file IntrusiveShared.cpp.

◆ TEST() [7/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
multithreaded_clear_mixed_union  )

Definition at line 719 of file IntrusiveShared.cpp.

◆ TEST() [8/19]

xrpl::tests::TEST ( IntrusiveSharedTest ,
multithreaded_locking_weak  )

Definition at line 873 of file IntrusiveShared.cpp.

◆ TEST() [9/19]

xrpl::tests::TEST ( FetchPackTest ,
construct_table  )

Definition at line 13 of file FetchPack.cpp.

◆ operator!=()

bool xrpl::tests::operator!= ( SHAMapItem const & a,
SHAMapItem const & b )

Definition at line 90 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ shamapBackingModeName()

std::string xrpl::tests::shamapBackingModeName ( ::testing::TestParamInfo< SHAMapBackingMode > const & info)

Definition at line 105 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_P()

xrpl::tests::TEST_P ( SHAMapTest ,
add_traverse_snapshot_build_tear_and_iterate  )

Definition at line 124 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ INSTANTIATE_TEST_SUITE_P()

xrpl::tests::INSTANTIATE_TEST_SUITE_P ( BackingMode ,
SHAMapTest ,
::testing::Values(kBackedMode, kUnbackedMode) ,
shamapBackingModeName  )

◆ TEST_F() [1/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
forward_iteration_visits_every_key_in_order  )

Definition at line 330 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [2/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
upper_bound_walks_the_whole_map  )

Definition at line 345 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [3/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
lower_bound_walks_the_whole_map  )

Definition at line 364 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [4/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
bounds_agree_with_iteration_for_absent_keys  )

Definition at line 383 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [5/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
bounds_on_empty_map_return_end  )

Definition at line 458 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [6/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
bounds_on_single_item_map_use_the_leaf_below_the_root  )

Definition at line 476 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [7/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
iteration_survives_deletions  )

Definition at line 504 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [8/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
iteration_survives_a_collapsed_inner_node  )

Definition at line 539 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [9/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
forward_iteration_visits_every_key_in_order_at_leaf_depth  )

Definition at line 589 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [10/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
upper_bound_walks_the_whole_map_at_leaf_depth  )

Definition at line 604 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [11/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
lower_bound_walks_the_whole_map_at_leaf_depth  )

Definition at line 623 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [12/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
bounds_agree_with_iteration_for_absent_keys_at_leaf_depth  )

Definition at line 642 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [13/18]

xrpl::tests::TEST_F ( SHAMapTraversal ,
iteration_survives_deletions_at_leaf_depth  )

Definition at line 693 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [14/18]

xrpl::tests::TEST_F ( SHAMapPathProof ,
verify_proof_path  )

Definition at line 733 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [15/18]

xrpl::tests::TEST_F ( SHAMapPathProof ,
legitimate_deep_path_is_sixty_five_elements  )

Definition at line 808 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [16/18]

xrpl::tests::TEST_F ( SHAMapPathProof ,
all_inner_path_at_leaf_depth_is_rejected  )

Definition at line 842 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ forgeRootOverLeaf()

std::pair< std::vector< Blob >, UInt256 > xrpl::tests::forgeRootOverLeaf ( Blob const & leafBlob,
UInt256 const & key )
static

Wrap a leaf blob in a forged root inner node whose branch for key carries that leaf's hash.

The resulting two-element path hash-chains for key no matter which leaf sits at the bottom, which is exactly the substitution a peer could attempt.

Parameters
leafBlobthe wire form of the leaf to place at the bottom of the path.
keythe key the forged path claims to prove.
Returns
the path (deepest element first) and the forged root hash, or an empty path if the leaf blob does not parse.

Definition at line 885 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ TEST_F() [17/18]

xrpl::tests::TEST_F ( SHAMapPathProof ,
substituted_leaf_for_other_key_is_rejected  )

Definition at line 909 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ kTestKey()

UInt256 xrpl::tests::kTestKey ( "b92891fe4ef6cee585fdc6fda1e09eb4d386363158ec3321b8123e5a772c6ca8" )
constexpr

◆ TEST() [10/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
root_is_prefix_of_every_key  )

Definition at line 17 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [11/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
child_id_is_prefix_of_keys_in_that_branch  )

Definition at line 25 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [12/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
wrong_branch_is_not_prefix_of_key  )

Definition at line 38 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [13/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
prefix_check_is_depth_sensitive  )

Definition at line 54 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [14/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
leaf_id_from_key_is_prefix_of_that_key  )

Definition at line 73 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [15/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
create_id_masks_key_to_depth  )

Definition at line 83 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [16/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
child_of_leaf_depth_id_throws  )

Definition at line 96 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [17/19]

xrpl::tests::TEST ( SHAMapNodeIDDeathTest ,
out_of_range_depth_is_clamped  )

Definition at line 103 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [18/19]

xrpl::tests::TEST ( SHAMapNodeIDDeathTest ,
select_branch_clamps_leaf_depth  )

Definition at line 140 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST() [19/19]

xrpl::tests::TEST ( SHAMapNodeIDTest ,
deserialize_rejects_out_of_range_depth  )

Definition at line 168 of file tests/libxrpl/shamap/SHAMapNodeID.cpp.

◆ TEST_F() [18/18]

xrpl::tests::TEST_F ( SHAMapSyncTest ,
sync  )

Definition at line 86 of file tests/libxrpl/shamap/SHAMapSync.cpp.

Variable Documentation

◆ kBackedMode

SHAMapBackingMode xrpl::tests::kBackedMode {.backed = true, .testName = "backed"}
constexpr

Definition at line 101 of file tests/libxrpl/shamap/SHAMap.cpp.

◆ kUnbackedMode

SHAMapBackingMode xrpl::tests::kUnbackedMode {.backed = false, .testName = "unbacked"}
constexpr

Definition at line 102 of file tests/libxrpl/shamap/SHAMap.cpp.