mirror of
https://github.com/wownero/wownero.git
synced 2026-10-20 08:58:36 +02:00
epee: remove LOCAL_ASSERT
LOCAL_ASSERT was only defined on Windows, only used in the `CHECK_AND_ASSERT` macro, and was disabled in unit tests anyways, but only in the main translation unit, which didn't have local asserts, since get_set_enable_assert was inline, so the disabling didn't even do anything.
This commit is contained in:
@@ -124,16 +124,6 @@
|
|||||||
|
|
||||||
#define MLOG_SET_THREAD_NAME(x) el::Helpers::setThreadName(x)
|
#define MLOG_SET_THREAD_NAME(x) el::Helpers::setThreadName(x)
|
||||||
|
|
||||||
#ifndef LOCAL_ASSERT
|
|
||||||
#include <assert.h>
|
|
||||||
#if (defined _MSC_VER)
|
|
||||||
#define LOCAL_ASSERT(expr) {if(epee::debug::get_set_enable_assert()){_ASSERTE(expr);}}
|
|
||||||
#else
|
|
||||||
#define LOCAL_ASSERT(expr)
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
std::string mlog_get_default_log_path(const char *default_filename);
|
std::string mlog_get_default_log_path(const char *default_filename);
|
||||||
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size = MAX_LOG_FILE_SIZE, const std::size_t max_log_files = MAX_LOG_FILES);
|
void mlog_configure(const std::string &filename_base, bool console, const std::size_t max_log_file_size = MAX_LOG_FILE_SIZE, const std::size_t max_log_files = MAX_LOG_FILES);
|
||||||
void mlog_set_categories(const char *categories);
|
void mlog_set_categories(const char *categories);
|
||||||
@@ -143,18 +133,6 @@ void mlog_set_log(const char *log);
|
|||||||
|
|
||||||
namespace epee
|
namespace epee
|
||||||
{
|
{
|
||||||
namespace debug
|
|
||||||
{
|
|
||||||
inline bool get_set_enable_assert(bool set = false, bool v = false)
|
|
||||||
{
|
|
||||||
static bool e = true;
|
|
||||||
if(set)
|
|
||||||
e = v;
|
|
||||||
return e;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#define ENDL std::endl
|
#define ENDL std::endl
|
||||||
|
|
||||||
@@ -195,7 +173,7 @@ namespace debug
|
|||||||
|
|
||||||
|
|
||||||
#ifndef CHECK_AND_ASSERT
|
#ifndef CHECK_AND_ASSERT
|
||||||
#define CHECK_AND_ASSERT(expr, fail_ret_val) do{if(!(expr)){LOCAL_ASSERT(expr); return fail_ret_val;};}while(0)
|
#define CHECK_AND_ASSERT(expr, fail_ret_val) do{if(!(expr)){return fail_ret_val;};}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CHECK_AND_ASSERT_MES
|
#ifndef CHECK_AND_ASSERT_MES
|
||||||
@@ -203,7 +181,7 @@ namespace debug
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CHECK_AND_NO_ASSERT_MES_L
|
#ifndef CHECK_AND_NO_ASSERT_MES_L
|
||||||
#define CHECK_AND_NO_ASSERT_MES_L(expr, fail_ret_val, l, message) do{if(!(expr)) {LOG_PRINT_L##l(message); /*LOCAL_ASSERT(expr);*/ return fail_ret_val;};}while(0)
|
#define CHECK_AND_NO_ASSERT_MES_L(expr, fail_ret_val, l, message) do{if(!(expr)) {LOG_PRINT_L##l(message); return fail_ret_val;};}while(0)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef CHECK_AND_NO_ASSERT_MES
|
#ifndef CHECK_AND_NO_ASSERT_MES
|
||||||
|
|||||||
@@ -243,7 +243,6 @@ bool transactions_flow_test(std::string& working_folder,
|
|||||||
if(!do_send_money(w1, w2, mix_in_factor, amount_to_tx, tx))
|
if(!do_send_money(w1, w2, mix_in_factor, amount_to_tx, tx))
|
||||||
{
|
{
|
||||||
LOG_PRINT_L0( "failed to transfer money, second chance. tx: " << get_transaction_hash(tx) << ", exit" );
|
LOG_PRINT_L0( "failed to transfer money, second chance. tx: " << get_transaction_hash(tx) << ", exit" );
|
||||||
LOCAL_ASSERT(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -297,7 +296,6 @@ bool transactions_flow_test(std::string& working_folder,
|
|||||||
|
|
||||||
MERROR("-----------------------FINISHING TRANSACTIONS FLOW TEST FAILED-----------------------" );
|
MERROR("-----------------------FINISHING TRANSACTIONS FLOW TEST FAILED-----------------------" );
|
||||||
MERROR("income " << print_money(money_2) << " via " << i << " transactions, expected money = " << print_money(transfered_money) );
|
MERROR("income " << print_money(money_2) << " via " << i << " transactions, expected money = " << print_money(transfered_money) );
|
||||||
LOCAL_ASSERT(false);
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -631,7 +631,6 @@ int main(int argc, char** argv)
|
|||||||
{
|
{
|
||||||
TRY_ENTRY();
|
TRY_ENTRY();
|
||||||
tools::on_startup();
|
tools::on_startup();
|
||||||
epee::debug::get_set_enable_assert(true, false);
|
|
||||||
//set up logging options
|
//set up logging options
|
||||||
mlog_configure(mlog_get_default_log_path("net_load_tests_clt.log"), true);
|
mlog_configure(mlog_get_default_log_path("net_load_tests_clt.log"), true);
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,6 @@ int main(int argc, char** argv)
|
|||||||
tools::on_startup();
|
tools::on_startup();
|
||||||
epee::string_tools::set_module_name_and_folder(argv[0]);
|
epee::string_tools::set_module_name_and_folder(argv[0]);
|
||||||
mlog_configure(mlog_get_default_log_path("unit_tests.log"), true);
|
mlog_configure(mlog_get_default_log_path("unit_tests.log"), true);
|
||||||
epee::debug::get_set_enable_assert(true, false);
|
|
||||||
|
|
||||||
::testing::InitGoogleTest(&argc, argv);
|
::testing::InitGoogleTest(&argc, argv);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user