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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
|
// -*- Mode: C++ -*-
extern "C" {
#define NOT_MAIN 1
#define REGRESSION_TEST 0
#define VCDIFF_TOOLS 1
#include "../xdelta3.c"
}
#define CHECK_EQ(x,y) CHECK_OP(x,y,==)
#define CHECK_NE(x,y) CHECK_OP(x,y,!=)
#define CHECK_LT(x,y) CHECK_OP(x,y,<)
#define CHECK_GT(x,y) CHECK_OP(x,y,>)
#define CHECK_LE(x,y) CHECK_OP(x,y,<=)
#define CHECK_GE(x,y) CHECK_OP(x,y,>=)
#define CHECK_OP(x,y,OP) \
do {if (!((x) OP (y))) { \
cerr << __FILE__ << ":" << __LINE__ << " Check failed: " << #x " " #OP " " #y << endl; \
cerr << __FILE__ << ":" << __LINE__ << " Expected: " << x << endl; \
cerr << __FILE__ << ":" << __LINE__ << " Actual: " << y << endl; \
abort(); \
} } while (false)
#define CHECK(x) \
do {if (!(x)) { \
cerr << __FILE__ << ":" << __LINE__ << " Check failed: " << #x << endl; \
abort(); \
} } while (false)
#include <string>
using std::string;
#include <iostream>
using std::cerr;
using std::endl;
using std::ostream;
#include <map>
using std::map;
using std::pair;
#include <ext/hash_map>
using __gnu_cxx::hash_map;
#include <list>
using std::list;
template <typename T, typename U>
pair<T, U> make_pair(const T& t, const U& u) {
return pair<T, U>(t, u);
}
class Constants {
public:
static const xoff_t BLOCK_SIZE = 1 << 7;
};
using std::min;
#include "random.h"
using regtest::MTRandom;
using regtest::MTRandom8;
#include "segment.h"
using regtest::Segment;
#include "modify.h"
using regtest::Mutator;
using regtest::ChangeList;
using regtest::Change;
using regtest::ChangeListMutator;
using regtest::Modify1stByte;
#include "file.h"
using regtest::FileSpec;
using regtest::Block;
using regtest::BlockIterator;
using regtest::TmpFile;
#include "cmp.h"
using regtest::CmpDifferentBytes;
#include "sizes.h"
using regtest::SizeIterator;
using regtest::SmallSizes;
#include "delta.h"
using regtest::Delta;
|