~493pocbrcycmdw7yksonho9o2qzz-o18bz-d18ecat4t1b76tkfi3vttrkfngli/libmemcached/libmemcached

« back to all changes in this revision

Viewing changes to libtest/result/base.hpp

  • Committer: Continuous Integration
  • Date: 2013-04-21 01:20:30 UTC
  • mfrom: (1159.1.1 libmemcached-1.0)
  • Revision ID: ci@tangent.org-20130421012030-0ztye5mh26tm1bqm
Merge lp:~brianaker/libmemcached/exception-cleanup Build: jenkins-Libmemcached-271

Show diffs side-by-side

added added

removed removed

Lines of Context:
36
36
 
37
37
#pragma once
38
38
 
 
39
#include "libtest/exception.hpp"
 
40
#include "libtest/error.h"
 
41
 
39
42
namespace libtest {
40
43
 
41
 
class __test_result : public std::exception
 
44
class __test_result : public libtest::exception
42
45
{
43
46
public:
44
47
  __test_result(const char *file, int line, const char *func);
45
48
 
46
 
  __test_result( const __test_result& );
47
 
 
48
 
  virtual ~__test_result() throw();
49
 
 
50
 
  virtual const char* what() const throw()
51
 
  {
52
 
    if (_error_message)
53
 
    {
54
 
      return _error_message;
55
 
    }
56
 
 
57
 
    return "";
58
 
  }
59
 
 
60
 
  int line() const
61
 
  {
62
 
    return _line;
63
 
  }
64
 
 
65
 
  const char*  file() const
66
 
  {
67
 
    return _file;
68
 
  }
69
 
 
70
 
  const char* func() const
71
 
  {
72
 
    return _func;
73
 
  }
74
 
 
75
 
protected:
76
 
  void init(va_list);
 
49
  virtual test_return_t return_code() const= 0;
77
50
 
78
51
private:
79
 
  int _line;
80
 
  const char*  _file;
81
 
  const char* _func;
82
 
  char* _error_message;
83
 
  int _error_message_size;
84
52
};
85
53
 
86
54
} // namespace libtest