summaryrefslogtreecommitdiff
path: root/xdelta3/testing/segment.h
diff options
context:
space:
mode:
authorjosh.macdonald <jmacd@users.noreply.github.com>2010-02-07 03:00:42 +0000
committerjosh.macdonald <jmacd@users.noreply.github.com>2010-02-07 03:00:42 +0000
commit3dbebbe46096e17c0298f1cbe315d10b35b4f9ee (patch)
treec2ae665c490d2a4e4cd4365721f4cf807fa1e44b /xdelta3/testing/segment.h
parente7a0eda2519593950a1a0dff77e42d4da9189c3e (diff)
Implement srcwin_maxsz in xd3_source_match_setup(), which prevents
the encoder from seeking backwards further than this parameter. This was supposed to be implemented long ago, but was especially problematic in the recent release, which implements source-from-FIFO.
Diffstat (limited to 'xdelta3/testing/segment.h')
-rw-r--r--xdelta3/testing/segment.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/xdelta3/testing/segment.h b/xdelta3/testing/segment.h
index a743bfd..ea3dcee 100644
--- a/xdelta3/testing/segment.h
+++ b/xdelta3/testing/segment.h
@@ -6,7 +6,7 @@ class Segment {
6 : size_(size), 6 : size_(size),
7 seed_(rand->Rand32()), 7 seed_(rand->Rand32()),
8 seed_offset_(0), 8 seed_offset_(0),
9 data_(NULL) { 9 data_(NULL) {
10 CHECK_GT(size_, 0); 10 CHECK_GT(size_, 0);
11 } 11 }
12 12
@@ -14,7 +14,7 @@ class Segment {
14 : size_(size), 14 : size_(size),
15 seed_(seed), 15 seed_(seed),
16 seed_offset_(0), 16 seed_offset_(0),
17 data_(NULL) { 17 data_(NULL) {
18 CHECK_GT(size_, 0); 18 CHECK_GT(size_, 0);
19 } 19 }
20 20
@@ -22,12 +22,12 @@ class Segment {
22 : size_(size), 22 : size_(size),
23 seed_(0), 23 seed_(0),
24 seed_offset_(0), 24 seed_offset_(0),
25 data_(data) { 25 data_(data) {
26 CHECK_GT(size_, 0); 26 CHECK_GT(size_, 0);
27 } 27 }
28 28
29 size_t Size() const { 29 size_t Size() const {
30 return size_; 30 return size_;
31 } 31 }
32 32
33 Segment Subseg(size_t start, size_t size) const { 33 Segment Subseg(size_t start, size_t size) const {
@@ -66,7 +66,7 @@ class Segment {
66 } 66 }
67 } else { 67 } else {
68 char buf[256]; 68 char buf[256];
69 sprintf(buf, "size=%ld,seed=%ld,skip=%ld", size_, seed_, seed_offset_); 69 sprintf(buf, "size=%ld,seed=%ud,skip=%ld", size_, seed_, seed_offset_);
70 r.append(buf); 70 r.append(buf);
71 } 71 }
72 return r; 72 return r;