diff --git a/CMakeLists.txt b/CMakeLists.txt index a21736a1c..65ba81e75 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -136,18 +136,6 @@ if(CLANG_TIDY) endif() # ----------------------------------------------------------------------------- -# custom assert control parameters - -# by default on custom assert only the message, filename and line number will be -# printed on stderr, if STACKTRACE_ASSERT is ON the whole stacktrace is going to -# be printed on stderr -option(STACKTRACE_ASSERT "Dump stacktrace on custom assert" OFF) -message(STATUS "STACKTRACE_ASSERT: ${STACKTRACE_ASSERT}") -if(STACKTRACE_ASSERT) - add_definitions(-DSTACKTRACE_ASSERT_ON) -endif() -# ----------------------------------------------------------------------------- - # ndebug option(NDEBUG "No debug" OFF) message(STATUS "NDEBUG: ${NDEBUG} (be careful CMAKE_BUILD_TYPE can also \ diff --git a/poc/measure_time.cpp b/poc/measure_time.cpp index 0d68f65d0..3fb1ead15 100644 --- a/poc/measure_time.cpp +++ b/poc/measure_time.cpp @@ -5,7 +5,6 @@ #include <gtest/gtest.h> #include "timer.hpp" -#include "utils/assert.hpp" using namespace std::chrono_literals; using namespace utils; diff --git a/poc/utils/copy_on_write.hpp b/poc/utils/copy_on_write.hpp index 3a3d4683d..8f3c1b301 100644 --- a/poc/utils/copy_on_write.hpp +++ b/poc/utils/copy_on_write.hpp @@ -2,8 +2,6 @@ #include <memory> -#include "utils/assert.hpp" - namespace utils { /** diff --git a/src/communication/bolt/v1/decoder/chunked_decoder_buffer.hpp b/src/communication/bolt/v1/decoder/chunked_decoder_buffer.hpp index 5bde14377..08a538879 100644 --- a/src/communication/bolt/v1/decoder/chunked_decoder_buffer.hpp +++ b/src/communication/bolt/v1/decoder/chunked_decoder_buffer.hpp @@ -5,11 +5,11 @@ #include <memory> #include <vector> +#include <fmt/format.h> #include <glog/logging.h> #include "communication/bolt/v1/constants.hpp" #include "communication/bolt/v1/decoder/buffer.hpp" -#include "utils/assert.hpp" namespace communication::bolt { diff --git a/src/communication/bolt/v1/decoder/decoded_value.hpp b/src/communication/bolt/v1/decoder/decoded_value.hpp index ff320e955..9184a5a41 100644 --- a/src/communication/bolt/v1/decoder/decoded_value.hpp +++ b/src/communication/bolt/v1/decoder/decoded_value.hpp @@ -7,7 +7,6 @@ #include "query/typed_value.hpp" #include "storage/property_value.hpp" #include "utils/algorithm.hpp" -#include "utils/assert.hpp" #include "utils/exceptions.hpp" namespace communication::bolt { diff --git a/src/communication/bolt/v1/encoder/chunked_encoder_buffer.hpp b/src/communication/bolt/v1/encoder/chunked_encoder_buffer.hpp index 24d4e40d3..3159886a0 100644 --- a/src/communication/bolt/v1/encoder/chunked_encoder_buffer.hpp +++ b/src/communication/bolt/v1/encoder/chunked_encoder_buffer.hpp @@ -8,7 +8,6 @@ #include <glog/logging.h> #include "communication/bolt/v1/constants.hpp" -#include "utils/assert.hpp" #include "utils/bswap.hpp" namespace communication::bolt { diff --git a/src/communication/server.hpp b/src/communication/server.hpp index 9428d7e9b..73e127467 100644 --- a/src/communication/server.hpp +++ b/src/communication/server.hpp @@ -12,7 +12,6 @@ #include "communication/worker.hpp" #include "io/network/socket_event_dispatcher.hpp" -#include "utils/assert.hpp" namespace communication { diff --git a/src/database/graph_db_accessor.cpp b/src/database/graph_db_accessor.cpp index eabff9751..bdae20769 100644 --- a/src/database/graph_db_accessor.cpp +++ b/src/database/graph_db_accessor.cpp @@ -5,7 +5,6 @@ #include "storage/edge_accessor.hpp" #include "storage/vertex.hpp" #include "storage/vertex_accessor.hpp" -#include "utils/assert.hpp" #include "utils/on_scope_exit.hpp" GraphDbAccessor::GraphDbAccessor(GraphDb &db) diff --git a/src/io/network/socket.cpp b/src/io/network/socket.cpp index e0e1450c1..90d4bbd5b 100644 --- a/src/io/network/socket.cpp +++ b/src/io/network/socket.cpp @@ -1,6 +1,5 @@ #include "io/network/socket.hpp" -#include <cassert> #include <cstdio> #include <cstring> #include <iostream> diff --git a/src/mvcc/version_list.hpp b/src/mvcc/version_list.hpp index b561c692e..4d2f5eb56 100644 --- a/src/mvcc/version_list.hpp +++ b/src/mvcc/version_list.hpp @@ -3,7 +3,6 @@ #include "storage/locking/record_lock.hpp" #include "threading/sync/lockable.hpp" #include "transactions/transaction.hpp" -#include "utils/assert.hpp" #include "utils/exceptions.hpp" namespace mvcc { diff --git a/src/utils/assert.hpp b/src/utils/assert.hpp deleted file mode 100644 index 24dd9564c..000000000 --- a/src/utils/assert.hpp +++ /dev/null @@ -1,25 +0,0 @@ -/** - * @file - * This file defines @c permanent_assert and @c debug_assert. - * - * If @c STACKTRACE_ASSERT_ON is defined, when an assertion fails, the full - * stack trace will be printed to @c stderr, otherwise just the basic - * information will be printed out (message, file, line) - */ -#pragma once - -#include <cstdlib> -#include <iostream> -#include <sstream> - -#include "utils/stacktrace.hpp" - -#ifdef STACKTRACE_ASSERT_ON -#define __handle_assert_message(message) \ - Stacktrace stacktrace; \ - std::cerr << "ASSERT: " << message << std::endl; \ - std::cerr << stacktrace.dump(); -#else -#define __handle_assert_message(message) \ - std::cerr << "ASSERT: " << message << std::endl; -#endif diff --git a/src/utils/random_graph_generator.hpp b/src/utils/random_graph_generator.hpp index 21d3a068b..4a817d576 100644 --- a/src/utils/random_graph_generator.hpp +++ b/src/utils/random_graph_generator.hpp @@ -18,7 +18,6 @@ #include "storage/property_value.hpp" #include "storage/vertex_accessor.hpp" #include "threading/sync/lock_timeout_exception.hpp" -#include "utils/assert.hpp" namespace utils { diff --git a/tests/benchmark/data_structures/concurrent/skiplist_insert.cpp b/tests/benchmark/data_structures/concurrent/skiplist_insert.cpp index d4ae92071..df2cc97e9 100644 --- a/tests/benchmark/data_structures/concurrent/skiplist_insert.cpp +++ b/tests/benchmark/data_structures/concurrent/skiplist_insert.cpp @@ -12,7 +12,6 @@ #include "data_structures/concurrent/skiplist.hpp" #include "skiplist_helper.hpp" -#include "utils/assert.hpp" void Insert(benchmark::State &state) { SkipList<int> skiplist; diff --git a/tests/concurrent/futex.cpp b/tests/concurrent/futex.cpp index 6f5086353..1f9df9e1d 100644 --- a/tests/concurrent/futex.cpp +++ b/tests/concurrent/futex.cpp @@ -4,7 +4,6 @@ #include <thread> #include "threading/sync/futex.hpp" -#include "utils/assert.hpp" Futex futex; int x = 0; diff --git a/tests/concurrent/network_common.hpp b/tests/concurrent/network_common.hpp index bea9951a2..decde19b0 100644 --- a/tests/concurrent/network_common.hpp +++ b/tests/concurrent/network_common.hpp @@ -1,7 +1,6 @@ #pragma once #include <array> -#include <cassert> #include <cstring> #include <iostream> #include <random> diff --git a/tests/concurrent/network_read_hang.cpp b/tests/concurrent/network_read_hang.cpp index 368e173cd..9e5c37417 100644 --- a/tests/concurrent/network_read_hang.cpp +++ b/tests/concurrent/network_read_hang.cpp @@ -3,7 +3,6 @@ #endif #include <array> -#include <cassert> #include <chrono> #include <cstring> #include <iostream> diff --git a/tests/macro_benchmark/clients/long_running_client.cpp b/tests/macro_benchmark/clients/long_running_client.cpp index 3eb5bf0f2..87d18a9ae 100644 --- a/tests/macro_benchmark/clients/long_running_client.cpp +++ b/tests/macro_benchmark/clients/long_running_client.cpp @@ -22,7 +22,6 @@ #include "threading/sync/spinlock.hpp" #include "utils/algorithm.hpp" #include "utils/algorithm.hpp" -#include "utils/assert.hpp" #include "utils/timer.hpp" using communication::bolt::DecodedValue; diff --git a/tests/manual/generate_snapshot.cpp b/tests/manual/generate_snapshot.cpp index 208b3eb28..d06af7764 100644 --- a/tests/manual/generate_snapshot.cpp +++ b/tests/manual/generate_snapshot.cpp @@ -13,7 +13,6 @@ #include "communication/bolt/v1/encoder/base_encoder.hpp" #include "durability/file_writer_buffer.hpp" -#include "utils/assert.hpp" #include "utils/string.hpp" #include "utils/timer.hpp" diff --git a/tests/manual/xorshift.cpp b/tests/manual/xorshift.cpp index e567c2a76..7b333a292 100644 --- a/tests/manual/xorshift.cpp +++ b/tests/manual/xorshift.cpp @@ -3,7 +3,6 @@ */ #include <array> #include <atomic> -#include <cassert> #include <iostream> #include <thread> diff --git a/tests/unit/bolt_common.hpp b/tests/unit/bolt_common.hpp index 3e83804bc..d5da81910 100644 --- a/tests/unit/bolt_common.hpp +++ b/tests/unit/bolt_common.hpp @@ -1,5 +1,4 @@ #include <array> -#include <cassert> #include <cstring> #include <iostream> #include <random> diff --git a/tests/unit/concurrent_map.cpp b/tests/unit/concurrent_map.cpp index 5bd9b4f6c..3309f8f54 100644 --- a/tests/unit/concurrent_map.cpp +++ b/tests/unit/concurrent_map.cpp @@ -1,10 +1,10 @@ #include <iostream> +#include <fmt/format.h> #include <glog/logging.h> #include <gtest/gtest.h> #include "data_structures/concurrent/concurrent_map.hpp" -#include "utils/assert.hpp" using concurrent_map_t = ConcurrentMap<int, int>; diff --git a/tests/unit/concurrent_set.cpp b/tests/unit/concurrent_set.cpp index 12275c65e..0d7018640 100644 --- a/tests/unit/concurrent_set.cpp +++ b/tests/unit/concurrent_set.cpp @@ -4,7 +4,6 @@ #include <gtest/gtest.h> #include "data_structures/concurrent/concurrent_set.hpp" -#include "utils/assert.hpp" void print_skiplist(const ConcurrentSet<int>::Accessor<false> &skiplist) { DLOG(INFO) << "Skiplist set now has:";