summaryrefslogtreecommitdiff
path: root/xdelta3/testing/file.h
diff options
context:
space:
mode:
Diffstat (limited to 'xdelta3/testing/file.h')
-rw-r--r--xdelta3/testing/file.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/xdelta3/testing/file.h b/xdelta3/testing/file.h
index 1205bc0..d3b9d4a 100644
--- a/xdelta3/testing/file.h
+++ b/xdelta3/testing/file.h
@@ -117,6 +117,11 @@ public:
117 } 117 }
118 118
119 uint8_t* Data() const { 119 uint8_t* Data() const {
120 if (data_ == NULL) {
121 CHECK_EQ(0, size_);
122 data_size_ = 1;
123 data_ = new uint8_t[1];
124 }
120 return data_; 125 return data_;
121 } 126 }
122 127
@@ -147,8 +152,8 @@ private:
147 152
148 friend class BlockIterator; 153 friend class BlockIterator;
149 154
150 uint8_t *data_; 155 mutable uint8_t *data_;
151 size_t data_size_; 156 mutable size_t data_size_;
152 size_t size_; 157 size_t size_;
153}; 158};
154 159