ARB
Macros | Functions
arb_assert.h File Reference
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
#include <arb_core.h>
#include <glib.h>
#include <cxxforward.h>
Include dependency graph for arb_assert.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define ASSERT_NONE
 
#define provoke_core_dump()   do { *(int*)0 = 0; } while(0)
 
#define stop_in_debugger()   G_BREAKPOINT()
 
#define TRIGGER_SANITIZER()
 
#define ARB_SIGSEGV(backtrace)
 
#define ARB_STOP(backtrace)
 
#define arb_assert_crash(cond)
 
#define arb_assert_stop(cond)
 
#define arb_assert_backtrace_and_crash(cond)
 
#define arb_assert_backtrace_and_stop(cond)
 
#define arb_assert(cond)
 
#define assert_or_exit(cond)
 
#define RUNNING_TEST()   false
 
#define implicated(hypothesis, conclusion)   (!(hypothesis) || !!(conclusion))
 
#define IF_DEBUG(x)
 
#define IF_NDEBUG(x)   x
 
#define IF_ASSERTION_USED(x)   x
 
#define ASSERTING_CONSTEXPR_INLINE   inline
 
#define ASSERTING_CONSTEXPR_INLINE_Cxx14   inline
 
#define ASSERT_RESULT(Type, Expected, Expr)
 
#define ASSERT_RESULT_PREDICATE(Pred, Expr)
 
#define ASSERT_NULL_RESULT(ptrExpr)   ASSERT_RESULT(const void*, NULp, ptrExpr)
 
#define ASSERT_NO_ERROR(errorExpr)   ASSERT_RESULT(GB_ERROR, NULp, errorExpr)
 
#define ASSERT_TRUE(boolExpr)   ASSERT_RESULT(bool, true, boolExpr)
 
#define ASSERT_FALSE(boolExpr)   ASSERT_RESULT(bool, false, boolExpr)
 
#define UNCOVERED()
 

Functions

bool knownNonNull (const void *nonnull)
 

Macro Definition Documentation

#define ASSERT_NONE

Definition at line 85 of file arb_assert.h.

#define provoke_core_dump ( )    do { *(int*)0 = 0; } while(0)

Definition at line 100 of file arb_assert.h.

#define stop_in_debugger ( )    G_BREAKPOINT()

Definition at line 154 of file arb_assert.h.

#define TRIGGER_SANITIZER ( )

Definition at line 170 of file arb_assert.h.

#define ARB_SIGSEGV (   backtrace)
Value:
do { \
} while (0)
#define provoke_core_dump()
Definition: arb_assert.h:100
#define TRIGGER_SANITIZER()
Definition: arb_assert.h:170
#define ARB_SIGSEGV(backtrace)
Definition: arb_assert.h:174
void GBK_install_SIGSEGV_handler(bool dump_backtrace)
Definition: arb_signal.cxx:47
#define false
Definition: ureadseq.h:13
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:428
#define NULp
Definition: cxxforward.h:97

Definition at line 174 of file arb_assert.h.

Referenced by aw_question(), and GBK_terminate().

#define ARB_STOP (   backtrace)
Value:
do { \
if (backtrace) GBK_dump_backtrace(NULp, "ARB_STOP"); \
} while(0)
#define stop_in_debugger()
Definition: arb_assert.h:154
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)
#define ARB_STOP(backtrace)
Definition: arb_assert.h:181
void GBK_dump_backtrace(FILE *out, const char *message)
Definition: arb_msg.cxx:428
#define NULp
Definition: cxxforward.h:97

Definition at line 181 of file arb_assert.h.

#define arb_assert_crash (   cond)
Value:
do { \
if (!(cond)) ARB_SIGSEGV(0); \
} while (0)
#define ARB_SIGSEGV(backtrace)
Definition: arb_assert.h:174
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)

Definition at line 187 of file arb_assert.h.

#define arb_assert_stop (   cond)
Value:
do { \
if (!(cond)) ARB_STOP(0); \
} while (0)
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
while(1)
#define ARB_STOP(backtrace)
Definition: arb_assert.h:181

Definition at line 192 of file arb_assert.h.

#define arb_assert_backtrace_and_crash (   cond)
Value:
do { \
if (!(cond)) { \
fputs(GBK_assert_msg(#cond, __FILE__, __LINE__), stderr); \
fflush(stderr); \
} \
} while (0)
GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr)
Definition: arb_msg.cxx:217
#define ARB_SIGSEGV(backtrace)
Definition: arb_assert.h:174
fflush(stdout)
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
fputs(TRACE_PREFIX, stderr)

Definition at line 197 of file arb_assert.h.

#define arb_assert_backtrace_and_stop (   cond)
Value:
do { \
if (!(cond)) { \
fputs(GBK_assert_msg(#cond, __FILE__, __LINE__), stderr); \
fflush(stderr); \
ARB_STOP(1); \
} \
} while (0)
GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr)
Definition: arb_msg.cxx:217
fflush(stdout)
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166
fputs(TRACE_PREFIX, stderr)
#define ARB_STOP(backtrace)
Definition: arb_assert.h:181

Definition at line 206 of file arb_assert.h.

#define arb_assert (   cond)

Definition at line 245 of file arb_assert.h.

Referenced by arb_test::expectation_group::add(), CLI::add_filters_to(), PART::add_members_from(), MG_remaps::alignment_name(), alloc_failure_panic(), GBS_strstruct::alloc_mem(), InfoWindowRegistry::allocate_detach_id(), ARB_date_string(), ARB_dateTime_suffix(), ARB_float_2_ascii(), ARB_inc_sleep::ARB_inc_sleep(), arb_look_and_start_server(), ARB_main(), arb_open_socket(), arb_progress::arb_progress(), arb_reduce_primer_len(), ARB_sleep(), ARB_strduplen(), ARB_textfiles_have_difflines(), ARB_zfclose(), ARB_zfopen(), Validity::assert_is_valid(), GBS_strstruct::assign_mem(), FINAL_TYPE< SEQTYPE >::auto_subtitles(), AW_edit(), AWT_insert_DBcompression_selector(), BackTraceInfo::BackTraceInfo(), basic_set_gauge(), InfoWindow::bind_to_selected_item(), bio2info(), PART::bit_is_set(), build_consensus_tree(), PartRegistry::build_sorted_list(), Structure3D::calc_helix_count(), check_for_remote_command(), null_counter::child_updates_gauge(), no_counter::clone(), BasicStatus::close(), collectKeysRegisteredInDatabase(), compress_sequence_tree(), CON_calc_max_freq(), FINAL_TYPE< SEQTYPE >::concrete_counter(), Type::convert_result_for_PERL(), PosRange::copy_corresponding_part(), ArbProgress::counter::counter(), Location::create_GEN_position(), PartitionSize::create_root(), createCallOnSocketHost(), CreateDisplayHelices_window(), CreateRNA3DMainWindow(), dbserver_entry(), arb_test::expectation_group::dependent(), InfoWindow::display_selected_item(), ModRLimit::dump_error(), PosRange::end(), arb_test::epsilon_similar::epsilon_similar(), PART::equals(), CharPtrArray::erase_elems(), ARB_ERROR::expect_no_error(), ExplicitRange::ExplicitRange(), export_seq_data(), GB_await_error(), GB_copy_file(), GB_export_error(), GB_host_is_local(), GB_incur_error_if(), GB_internal_error(), GB_IO_error(), GB_sort(), GBK_raises_SIGSEGV(), GBK_test_address(), GBS_global_string_to_buffer(), GBS_readable_timediff(), GBS_regmatch(), GBS_regreplace(), GBS_spaces(), GBS_stropen(), GBS_unwrap_regexpr(), GBT_join_strings(), GBT_TREE_order(), xsubGenerator::generate_all_xsubs(), ConsensusTreeBuilder::get(), ConsensusTree::get_consensus_tree(), GBT_config::get_definition(), AW_window::get_device(), SizedCstr::get_length(), PartRegistry::get_part(), get_physical_memory(), CLI::get_treeimport_filename(), ColumnStat::get_type_path(), ErrorOr< TYPE >::getError(), getInt(), getString(), ErrorOr< TYPE >::getValue(), no_counter::inc(), ArbProgress::nestable::inc_by(), arb_progress::inc_by(), PART::index(), info2bio(), ins_ntree(), insert_ntree(), ConsensusTree::insert_tree_weighted(), PART::insertionOrder_cmp(), PART::invert(), PART::invertInSuperset(), SimpleLocation::isInRange(), isStartOrStopCodonNr(), PART::key(), Lazy< int,-1 >::Lazy(), LazyFloat< double >::LazyFloat(), FileContent::lines(), DI_MATRIX::load(), test_runtool::make_checked_piped_command(), FilterDefinition::make_filter(), ArbProbeMatchWeighting::matchWeight(), ArbProbeMatchWeighting::matchWeightResult(), MatrixOrder::MatrixOrder(), CharPtrArray::move(), Mutex::Mutex(), ArbProbe::nameAndSequence(), ArbProgress::nestable::nestable(), no_mode_text_defined(), ntree_init(), BasicStatus::open(), SizedCstr::operator const char *(), Lazy< T, UNDEFINED >::operator T(), LazyFloat< T >::operator T(), Callback_FVF< RT, F1, F2 >::operator()(), arb_test::containing::operator()(), Lazy< int,-1 >::operator=(), LazyFloat< double >::operator=(), Validity::operator=(), CharPtrArray::operator[](), PART::overlaps_with(), NtreeCommandLine::parse(), parseCommandLine(), parseLocationList(), PART::PART(), PartitionSize::PartitionSize(), PartRegistry::PartRegistry(), PosRange::PosRange(), FINAL_TYPE< SEQTYPE >::put(), ConstStrArray::put(), PartRegistry::put_artificial_part(), PartRegistry::put_part_from_complete_tree(), PartRegistry::put_part_from_partial_tree(), InfoWindow::reactivate(), InfoWindowRegistry::reactivate(), GBS_strstruct::realloc_mem(), reconfigure_dbserver(), InfoWindowRegistry::registerInfoWindow(), MG_remaps::remap(), remote_command_handler(), CharPtrArray::remove(), FINAL_TYPE< SEQTYPE >::replace(), ConstStrArray::replace(), InfoWindow::reuse(), FileContent::save(), GBT_config::set_definition(), Writer::set_error(), BasicStatus::set_gauge(), ARB_ERROR::set_handled(), PART::set_len(), ConstStrArray::set_memblock(), FilteredExport::set_required_baseCount(), CharPtrArray::set_space(), BasicStatus::set_subtitle(), InfoWindow::set_used(), PART::setbit(), SimpleLocation::SimpleLocation(), SizedCstr::SizedCstr(), SPOOLER::spool(), PART::standardize(), PosRange::start(), startup_dbserver(), store_unused_detached_info_window_cb(), strcpy_truncate(), CharPtrArray::swap(), PART::takeMean(), iupac::to_index(), to_Location(), PART::topological_cmp(), trace_over_braces(), translate_nuc2aa(), unlock_detached_cb(), initial_progress::update_gauge(), FINAL_TYPE< SEQTYPE >::~concrete_counter(), ConsensusTree::~ConsensusTree(), ArbProgress::counter::~counter(), and ArbProgress::nestable::~nestable().

#define assert_or_exit (   cond)
Value:
do { \
if (!(cond)) { \
GBK_terminate(GBK_assert_msg(#cond, __FILE__, __LINE__)); \
} \
} while (0)
GB_ERROR GBK_assert_msg(const char *assertion, const char *file, int linenr)
Definition: arb_msg.cxx:217
void GBK_terminate(const char *error) __ATTR__NORETURN
Definition: arb_msg.cxx:463
GB_write_int const char GB_write_autoconv_string WRITE_SKELETON(write_pointer, GBDATA *,"%p", GB_write_pointer) char *AW_awa if)(!gb_var) return strdup("")
Definition: AW_awar.cxx:166

Definition at line 263 of file arb_assert.h.

Referenced by GB_get_GBDATA_path(), gbcm_read_bin(), GEN_is_genome_db(), and GBS_strstruct::vnprintf().

#define RUNNING_TEST ( )    false

Definition at line 278 of file arb_assert.h.

Referenced by aw_message(), GBT_tree_2_newick(), and insert_species_into_tree().

#define implicated (   hypothesis,
  conclusion 
)    (!(hypothesis) || !!(conclusion))
#define IF_DEBUG (   x)

Definition at line 303 of file arb_assert.h.

Referenced by field_awar(), and SelectedDatabase::open_db_for_merge().

#define IF_NDEBUG (   x)    x

Definition at line 304 of file arb_assert.h.

#define IF_ASSERTION_USED (   x)    x
#define ASSERTING_CONSTEXPR_INLINE   inline

Definition at line 317 of file arb_assert.h.

#define ASSERTING_CONSTEXPR_INLINE_Cxx14   inline

Definition at line 318 of file arb_assert.h.

#define ASSERT_RESULT (   Type,
  Expected,
  Expr 
)
#define ASSERT_RESULT_PREDICATE (   Pred,
  Expr 
)
Value:
do { \
arb_assert(Pred(Expr)); \
} while (0)
#define arb_assert(cond)
Definition: arb_assert.h:245

Definition at line 341 of file arb_assert.h.

Referenced by gb_load_key_data_and_dictionaries(), and GBS_ptserver_tag().

#define ASSERT_NULL_RESULT (   ptrExpr)    ASSERT_RESULT(const void*, NULp, ptrExpr)

Definition at line 359 of file arb_assert.h.

#define ASSERT_NO_ERROR (   errorExpr)    ASSERT_RESULT(GB_ERROR, NULp, errorExpr)
#define ASSERT_TRUE (   boolExpr)    ASSERT_RESULT(bool, true, boolExpr)

Definition at line 362 of file arb_assert.h.

Referenced by get_available_fontsizes().

#define ASSERT_FALSE (   boolExpr)    ASSERT_RESULT(bool, false, boolExpr)

Definition at line 363 of file arb_assert.h.

#define UNCOVERED ( )

Function Documentation

bool knownNonNull ( const void *  nonnull)
inline