Skip to content

Commit

Permalink
Add docs/comments explaining unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
theohax committed Jan 24, 2022
1 parent f8e6a0b commit 90826c4
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4298,6 +4298,8 @@ TEST (rep_crawler, local)
}
}

// Test that a node configured with `enable_pruning` and `max_pruning_age = 1s` will automatically
// prune old confirmed blocks without explicitly saying `node.ledger_pruning` in the unit test
TEST (node, pruning_automatic)
{
nano::system system{};
Expand Down Expand Up @@ -4352,6 +4354,8 @@ TEST (node, pruning_automatic)
ASSERT_TRUE (node1.ledger.block_or_pruned_exists (send2->hash ()));
}

// Test that a node configured with `enable_pruning` will
// prune OLD-enough confirmed blocks by explicitly saying `node.ledger_pruning` in the unit test
TEST (node, pruning_age)
{
nano::system system{};
Expand Down Expand Up @@ -4413,6 +4417,8 @@ TEST (node, pruning_age)
ASSERT_TRUE (node1.ledger.block_or_pruned_exists (send2->hash ()));
}

// Test that a node configured with `enable_pruning` will
// prune DEEP-enough confirmed blocks by explicitly saying `node.ledger_pruning` in the unit test
TEST (node, pruning_depth)
{
nano::system system{};
Expand Down

0 comments on commit 90826c4

Please sign in to comment.