// -*- 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 using std::cerr; using std::endl; using std::ostream; #include using std::map; using std::pair; #include using __gnu_cxx::hash_map; #include using std::list; template pair make_pair(const T& t, const U& u) { return pair(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; #include "cmp.h" using regtest::CmpDifferentBytes; #include "sizes.h" using regtest::SizeIterator; using regtest::SmallSizes; #include "delta.h" using regtest::Delta;