Skip to content

Commit

Permalink
GTEST_SKIP calls added (#4157)
Browse files Browse the repository at this point in the history
Replace unit test early exit return statements with GTEST_SKIP macros.

---------

Co-authored-by: Moliner <Mario.Moliner@es.nestle.com>
Co-authored-by: clemahieu <clemahieu@gmail.com>
  • Loading branch information
3 people committed Feb 28, 2023
1 parent fef5fe8 commit 900dda8
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 21 deletions.
28 changes: 14 additions & 14 deletions nano/core_test/block_store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
// Check that upgrading from an unsupported version is not supported
auto path (nano::unique_path ());
Expand Down Expand Up @@ -693,7 +693,7 @@ TEST (mdb_block_store, bad_path)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
nano::logger_mt logger;
nano::lmdb::store store (logger, boost::filesystem::path ("///"), nano::dev::constants);
Expand Down Expand Up @@ -1057,7 +1057,7 @@ TEST (mdb_block_store, sideband_height)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
nano::logger_mt logger;
nano::keypair key1;
Expand Down Expand Up @@ -1430,7 +1430,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
// Extract confirmation height to a separate database
auto path (nano::unique_path ());
Expand Down Expand Up @@ -1593,7 +1593,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::mdb_val value;
Expand Down Expand Up @@ -1640,7 +1640,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
nano::work_pool pool{ nano::dev::network_params.network, std::numeric_limits<unsigned>::max () };
nano::block_builder builder;
Expand Down Expand Up @@ -1730,7 +1730,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::block_builder builder;
Expand Down Expand Up @@ -2039,7 +2039,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::keypair key1;
Expand Down Expand Up @@ -2176,7 +2176,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::logger_mt logger;
Expand Down Expand Up @@ -2205,7 +2205,7 @@ namespace lmdb
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::logger_mt logger;
Expand Down Expand Up @@ -2236,7 +2236,7 @@ TEST (mdb_block_store, upgrade_backup)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto dir (nano::unique_path ());
namespace fs = boost::filesystem;
Expand Down Expand Up @@ -2277,7 +2277,7 @@ TEST (block_store, confirmation_height)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::logger_mt logger;
Expand Down Expand Up @@ -2323,7 +2323,7 @@ TEST (block_store, final_vote)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode as deletions cause inaccurate counts
return;
GTEST_SKIP ();
}
auto path (nano::unique_path ());
nano::logger_mt logger;
Expand Down Expand Up @@ -2441,7 +2441,7 @@ TEST (rocksdb_block_store, tombstone_count)
{
if (!nano::rocksdb_config::using_rocksdb_in_tests ())
{
return;
GTEST_SKIP ();
}
nano::test::system system{};
nano::logger_mt logger;
Expand Down
8 changes: 4 additions & 4 deletions nano/core_test/confirmation_height.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1195,7 +1195,7 @@ TEST (confirmation_heightDeathTest, rollback_added_block)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
// For ASSERT_DEATH_IF_SUPPORTED
testing::FLAGS_gtest_death_test_style = "threadsafe";
Expand Down Expand Up @@ -1287,7 +1287,7 @@ TEST (confirmation_heightDeathTest, modified_chain)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
// For ASSERT_DEATH_IF_SUPPORTED
testing::FLAGS_gtest_death_test_style = "threadsafe";
Expand Down Expand Up @@ -1365,7 +1365,7 @@ TEST (confirmation_heightDeathTest, modified_chain_account_removed)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
// For ASSERT_DEATH_IF_SUPPORTED
testing::FLAGS_gtest_death_test_style = "threadsafe";
Expand Down Expand Up @@ -2083,7 +2083,7 @@ TEST (confirmation_height, unbounded_block_cache_iteration)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
nano::logger_mt logger;
auto path (nano::unique_path ());
Expand Down
2 changes: 1 addition & 1 deletion nano/core_test/ledger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ TEST (ledger, store_error)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
auto ctx = nano::test::context::ledger_empty ();
}
Expand Down
2 changes: 1 addition & 1 deletion nano/core_test/node.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3338,7 +3338,7 @@ TEST (node, bidirectional_tcp)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
#endif
nano::test::system system;
Expand Down
2 changes: 1 addition & 1 deletion nano/core_test/unchecked_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ TEST (unchecked, multiple)
if (nano::rocksdb_config::using_rocksdb_in_tests ())
{
// Don't test this in rocksdb mode
return;
GTEST_SKIP ();
}
nano::logger_mt logger{};
auto store = nano::make_store (logger, nano::unique_path (), nano::dev::constants);
Expand Down

0 comments on commit 900dda8

Please sign in to comment.