forked from dustin/kvtest
-
Notifications
You must be signed in to change notification settings - Fork 1
/
tests.hh
52 lines (42 loc) · 925 Bytes
/
tests.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#ifndef TESTS_H
#define TESTS_H 1
#include "base-test.hh"
namespace kvtest {
/**
* A test to run.
*/
class Test : public Assertions {
public:
/**
* Run the test.
*/
virtual bool run(KVStore *tut) = 0;
/**
* Name of the test.
*/
virtual std::string name() = 0;
/**
* Tests print out their names.
*/
friend std::ostream& operator<<(std::ostream& s, Test &t) {
return s << t.name();
}
};
}
/**
* A really basic protocol compliance test.
*/
class TestTest : public kvtest::Test {
public:
bool run(kvtest::KVStore *tut);
std::string name() { return "test test"; }
};
/**
* A test of write efficiency.
*/
class WriteTest : public kvtest::Test {
public:
bool run(kvtest::KVStore *tut);
std::string name() { return "write test"; }
};
#endif /* TESTS_H */