Clean up exception classes.
[awesomized/libmemcached] / libtest / result / base.hpp
index 1859c22a925c39fc2a978eb3f04aae7e383e3ea5..5f093f83c2ff747b1d6afea73d52befab9d153a3 100644 (file)
@@ -2,7 +2,7 @@
  *
  *  Data Differential YATL (i.e. libtest)  library
  *
- *  Copyright (C) 2012 Data Differential, http://datadifferential.com/
+ *  Copyright (C) 2012-2013 Data Differential, http://datadifferential.com/
  *
  *  Redistribution and use in source and binary forms, with or without
  *  modification, are permitted provided that the following conditions are
 
 #pragma once
 
+#include "libtest/exception.hpp"
+#include "libtest/error.h"
+
 namespace libtest {
 
-class __test_result : public std::exception
+class __test_result : public libtest::exception
 {
 public:
   __test_result(const char *file, int line, const char *func);
 
-  __test_result( const __test_result& other ) :
-    _line(other._line),
-    _file(other._file),
-    _func(other._func)
-  {
-  }
-
-  int line()
-  {
-    return _line;
-  }
-
-  const char*  file()
-  {
-    return _file;
-  }
-
-  const char* func()
-  {
-    return _func;
-  }
+  virtual test_return_t return_code() const= 0;
 
 private:
-  int _line;
-  const char*  _file;
-  const char* _func;
 };
 
 } // namespace libtest