~brianaker/libmemcached/merge-of-1.0

« back to all changes in this revision

Viewing changes to libtest/exception/fatal.hpp

  • Committer: Continuous Integration
  • Date: 2013-05-04 09:21:59 UTC
  • mfrom: (1102.1.1 libmemcached-1.2)
  • Revision ID: ci@tangent.org-20130504092159-z0z9cm0gnu15wxs0
Merge lp:~tangent-org/libmemcached/1.2-build/ Build: jenkins-Libmemcached-297

Show diffs side-by-side

added added

removed removed

Lines of Context:
38
38
 
39
39
namespace libtest {
40
40
 
41
 
class fatal : public __test_result
 
41
class fatal : public libtest::exception
42
42
{
43
43
public:
44
44
  fatal(const char *file, int line, const char *func, ...);
52
52
  static uint32_t disabled_counter() throw();
53
53
  static void increment_disabled_counter() throw();
54
54
 
 
55
  test_return_t return_code() const
 
56
  {
 
57
    return TEST_SKIPPED;
 
58
  }
 
59
 
55
60
private:
56
61
};
57
62
 
58
63
} // namespace libtest
 
64
 
 
65
#define FATAL(...) \
 
66
do \
 
67
{ \
 
68
  throw libtest::fatal(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \
 
69
} while (0)
 
70
 
 
71
#define FATAL_IF(__expression, ...) \
 
72
do \
 
73
{ \
 
74
  if ((__expression)) { \
 
75
    throw libtest::fatal(LIBYATL_DEFAULT_PARAM, (#__expression)); \
 
76
  } \
 
77
} while (0)
 
78
 
 
79
#define FATAL_IF_(__expression, ...) \
 
80
do \
 
81
{ \
 
82
  if ((__expression)) { \
 
83
    throw libtest::fatal(LIBYATL_DEFAULT_PARAM, __VA_ARGS__); \
 
84
  } \
 
85
} while (0)
 
86
 
 
87
#define fatal_assert(__assert) if((__assert)) {} else { throw libtest::fatal(LIBYATL_DEFAULT_PARAM, #__assert); }