diff options
Diffstat (limited to 'tests/unit_tests')
-rw-r--r-- | tests/unit_tests/blockchain_db.cpp | 9 | ||||
-rw-r--r-- | tests/unit_tests/logging.cpp | 17 | ||||
-rw-r--r-- | tests/unit_tests/test_protocol_pack.cpp | 2 |
3 files changed, 19 insertions, 9 deletions
diff --git a/tests/unit_tests/blockchain_db.cpp b/tests/unit_tests/blockchain_db.cpp index d7c60cecb..6b569d113 100644 --- a/tests/unit_tests/blockchain_db.cpp +++ b/tests/unit_tests/blockchain_db.cpp @@ -38,9 +38,6 @@ #include "string_tools.h" #include "blockchain_db/blockchain_db.h" #include "blockchain_db/lmdb/db_lmdb.h" -#ifdef BERKELEY_DB -#include "blockchain_db/berkeleydb/db_bdb.h" -#endif #include "cryptonote_basic/cryptonote_format_utils.h" using namespace cryptonote; @@ -233,11 +230,7 @@ protected: using testing::Types; -typedef Types<BlockchainLMDB -#ifdef BERKELEY_DB - , BlockchainBDB -#endif -> implementations; +typedef Types<BlockchainLMDB> implementations; TYPED_TEST_CASE(BlockchainDBTest, implementations); diff --git a/tests/unit_tests/logging.cpp b/tests/unit_tests/logging.cpp index 056eae604..c8526abae 100644 --- a/tests/unit_tests/logging.cpp +++ b/tests/unit_tests/logging.cpp @@ -178,3 +178,20 @@ TEST(logging, last_precedence) cleanup(); } +TEST(logging, multiline) +{ + init(); + mlog_set_categories("global:INFO"); + MGINFO("first\nsecond\nthird"); + std::string str; + ASSERT_TRUE(load_log_to_string(log_filename, str)); + ASSERT_TRUE(nlines(str) == 3); + ASSERT_TRUE(str.find("global") != std::string::npos); + ASSERT_TRUE(str.find("first") != std::string::npos); + ASSERT_TRUE(str.find("second") != std::string::npos); + ASSERT_TRUE(str.find("third") != std::string::npos); + ASSERT_TRUE(str.find("first\nsecond") == std::string::npos); + ASSERT_TRUE(str.find("second\nthird") == std::string::npos); + cleanup(); +} + diff --git a/tests/unit_tests/test_protocol_pack.cpp b/tests/unit_tests/test_protocol_pack.cpp index 0ae2e9c68..59e46e332 100644 --- a/tests/unit_tests/test_protocol_pack.cpp +++ b/tests/unit_tests/test_protocol_pack.cpp @@ -42,7 +42,7 @@ TEST(protocol_pack, protocol_pack_command) r.total_height = 3; for(int i = 1; i < 10000; i += i*10) { - r.m_block_ids.resize(i, boost::value_initialized<crypto::hash>()); + r.m_block_ids.resize(i, crypto::hash{}); bool res = epee::serialization::store_t_to_binary(r, buff); ASSERT_TRUE(res); |