Skip to content

Commit

Permalink
Config tests
Browse files Browse the repository at this point in the history
  • Loading branch information
pwojcikdev committed Mar 11, 2024
1 parent 9782234 commit 8513ba8
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions nano/core_test/toml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,7 @@ TEST (toml, daemon_config_deserialize_defaults)
std::stringstream ss;
ss << R"toml(
[node]
[node.block_processor]
[node.diagnostics.txn_tracking]
[node.httpcallback]
[node.ipc.local]
Expand Down Expand Up @@ -251,6 +252,12 @@ TEST (toml, daemon_config_deserialize_defaults)

ASSERT_EQ (conf.node.vote_cache.max_size, defaults.node.vote_cache.max_size);
ASSERT_EQ (conf.node.vote_cache.max_voters, defaults.node.vote_cache.max_voters);

ASSERT_EQ (conf.node.block_processor.max_peer_queue, defaults.node.block_processor.max_peer_queue);
ASSERT_EQ (conf.node.block_processor.max_system_queue, defaults.node.block_processor.max_system_queue);
ASSERT_EQ (conf.node.block_processor.priority_live, defaults.node.block_processor.priority_live);
ASSERT_EQ (conf.node.block_processor.priority_bootstrap, defaults.node.block_processor.priority_bootstrap);
ASSERT_EQ (conf.node.block_processor.priority_local, defaults.node.block_processor.priority_local);
}

TEST (toml, optional_child)
Expand Down Expand Up @@ -427,6 +434,13 @@ TEST (toml, daemon_config_deserialize_no_defaults)
backlog_scan_batch_size = 999
backlog_scan_frequency = 999
[node.block_processor]
max_peer_queue = 999
max_system_queue = 999
priority_live = 999
priority_bootstrap = 999
priority_local = 999
[node.diagnostics.txn_tracking]
enable = true
ignore_writes_below_block_processor_max_time = false
Expand Down Expand Up @@ -671,6 +685,12 @@ TEST (toml, daemon_config_deserialize_no_defaults)

ASSERT_NE (conf.node.vote_cache.max_size, defaults.node.vote_cache.max_size);
ASSERT_NE (conf.node.vote_cache.max_voters, defaults.node.vote_cache.max_voters);

ASSERT_NE (conf.node.block_processor.max_peer_queue, defaults.node.block_processor.max_peer_queue);
ASSERT_NE (conf.node.block_processor.max_system_queue, defaults.node.block_processor.max_system_queue);
ASSERT_NE (conf.node.block_processor.priority_live, defaults.node.block_processor.priority_live);
ASSERT_NE (conf.node.block_processor.priority_bootstrap, defaults.node.block_processor.priority_bootstrap);
ASSERT_NE (conf.node.block_processor.priority_local, defaults.node.block_processor.priority_local);
}

/** There should be no required values **/
Expand Down

0 comments on commit 8513ba8

Please sign in to comment.