SQLsmith  v1.2.1-5-gfacd7a8
A random SQL query generator
dut.hh
Go to the documentation of this file.
1 
4 #ifndef DUT_HH
5 #define DUT_HH
6 #include <stdexcept>
7 #include <string>
8 
9 #include "prod.hh"
10 
11 namespace dut {
12 
13 struct failure : public std::exception {
14  std::string errstr;
15  std::string sqlstate;
16  const char* what() const throw()
17  {
18  return errstr.c_str();
19  }
20  failure(const char *s, const char *sqlstate_ = "") throw()
21  : errstr(), sqlstate() {
22  errstr = s;
23  sqlstate = sqlstate_;
24  };
25 };
26 
27 struct broken : failure {
28  broken(const char *s, const char *sqlstate_ = "") throw()
29  : failure(s, sqlstate_) { }
30 };
31 
32 struct timeout : failure {
33  timeout(const char *s, const char *sqlstate_ = "") throw()
34  : failure(s, sqlstate_) { }
35 };
36 
37 struct syntax : failure {
38  syntax(const char *s, const char *sqlstate_ = "") throw()
39  : failure(s, sqlstate_) { }
40 };
41 
42 }
43 
44 struct dut_base {
45  std::string version;
46  virtual void test(const std::string &stmt) = 0;
47 };
48 
49 
50 #endif
Base class for grammar productions.
Definition: dut.hh:44