-
Notifications
You must be signed in to change notification settings - Fork 2
/
testset.h
50 lines (41 loc) · 1.26 KB
/
testset.h
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
#ifndef TESTSET_H
#define TESTSET_H
#include <vector>
#include <string>
class TestSet {
public:
virtual ~TestSet() {;}
/**
* If there is another test available, place it into the vector (destroying
* any existing contents) and return true. Otherwise return false.
*/
virtual bool next(std::vector<unsigned char>& dest) = 0;
/**
* Return a string description of the test data last provided by next().
*/
virtual std::string description() = 0;
/**
* (May be used, may not, depending on whether particular test options are
* enabled. For determinism reasons the value is always provided as part of
* the test item.)
*
* Return the desired offset from 64-byte alignment (valid values 0 through 63)
* for the test data last provided by next(). 64 bytes because that's cacheline
* width.
*/
virtual int alignment() {
return 0;
}
/**
* (May be used, may not, depending on whether particular test options are
* enabled. For determinism reasons the value is always provided as part of
* the test item.)
*
* Do we align from the end instead of the beginning? Used when we are putting
* everything in large allocations so that we segfault on over/underflowing them.
*/
virtual bool alignEnd() {
return false;
}
};
#endif // TESTSET_H