summaryrefslogtreecommitdiff
path: root/xdelta3/testing/modify.h
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2008-06-30 05:15:05 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2008-06-30 05:15:05 +0000
commit9e896b470f5a4550a7fbbdc515db08b0249f5950 (patch)
tree8f2ea4d701f554a578a7d7e441f98e1f77425e9a /xdelta3/testing/modify.h
parente127914b71638072798f7c02e93caf9377ba7385 (diff)
A test is taking shape...
Diffstat (limited to 'xdelta3/testing/modify.h')
-rw-r--r--xdelta3/testing/modify.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/xdelta3/testing/modify.h b/xdelta3/testing/modify.h
new file mode 100644
index 0000000..8d6b480
--- /dev/null
+++ b/xdelta3/testing/modify.h
@@ -0,0 +1,23 @@
1/* -*- Mode: C++ -*- */
2namespace regtest {
3
4class Modify1stByte {
5 public:
6 static void Mutate(SegmentMap *table, MTRandom *rand) {
7 CHECK(!table->empty());
8
9 SegmentMap::iterator i1 = table->begin();
10 CHECK_EQ(0, i1->first);
11
12 if (i1->second.length == 1) {
13 i1->second.seed = rand->Rand32();
14 } else {
15 i1->second.seed_offset += 1;
16 i1->second.length -= 1;
17 table->insert(make_pair(1, i1->second));
18 i1->second = Segment(rand->Rand32(), 1);
19 }
20 }
21};
22
23} // namespace regtest