~zorba-coders/zorba/trunk

« back to all changes in this revision

Viewing changes to src/diagnostics/assert.cpp

  • Committer: Tarmac
  • Author(s): David Graf
  • Date: 2012-04-13 09:17:58 UTC
  • mfrom: (10744.4.4 ordpathmsgs)
  • Revision ID: tarmac-20120413091758-j8svpeqfzais0ycy
Bug #980600.
Introduced ZORBA_ASSERT_WITH_MSG macro to give additional debugging information in case an assertion fails. Currently used in Ordpath functions. Approved: Till Westmann, Markos Zaharioudakis

Show diffs side-by-side

added added

removed removed

Lines of Context:
59
59
 
60
60
///////////////////////////////////////////////////////////////////////////////
61
61
 
62
 
void assertion_failed( char const *condition, char const *file, int line ) {
 
62
void assertion_failed( char const *condition, 
 
63
                       char const *file, 
 
64
                       int line,
 
65
                       char const *msg) {
63
66
  print_stack_trace( cerr );
64
67
  throw make_zorba_exception(
65
 
    file, line, zerr::ZXQP0002_ASSERT_FAILED, ERROR_PARAMS( condition )
 
68
    file, 
 
69
    line, 
 
70
    zerr::ZXQP0002_ASSERT_FAILED, 
 
71
    ( msg ? ERROR_PARAMS( condition, msg ) : ERROR_PARAMS( condition ))
66
72
  );
67
73
}
68
74