| Index: src/platform/update_engine/test_utils.cc
|
| diff --git a/src/platform/update_engine/test_utils.cc b/src/platform/update_engine/test_utils.cc
|
| index f83ddf98d1ba33cad0ff6697012cac67df92b0ee..6c1e35bd98736c7580a2b355353625633f784477 100644
|
| --- a/src/platform/update_engine/test_utils.cc
|
| +++ b/src/platform/update_engine/test_utils.cc
|
| @@ -165,16 +165,25 @@ std::string GetUnusedLoopDevice() {
|
| return ret;
|
| }
|
|
|
| -bool ExpectVectorsEq(const vector<char>& a, const vector<char>& b) {
|
| - EXPECT_EQ(a.size(), b.size());
|
| - if (a.size() != b.size())
|
| +bool ExpectVectorsEq(const vector<char>& expected, const vector<char>& actual) {
|
| + EXPECT_EQ(expected.size(), actual.size());
|
| + if (expected.size() != actual.size())
|
| return false;
|
| - for (unsigned int i = 0; i < a.size(); i++) {
|
| - EXPECT_EQ(a[i], b[i]) << "offset: " << i;
|
| + for (unsigned int i = 0; i < expected.size(); i++) {
|
| + EXPECT_EQ(expected[i], actual[i]) << "offset: " << i;
|
| }
|
| return true;
|
| }
|
|
|
| +void FillWithData(vector<char>* buffer) {
|
| + size_t input_counter = 0;
|
| + for (vector<char>::iterator it = buffer->begin(); it != buffer->end(); ++it) {
|
| + *it = kRandomString[input_counter];
|
| + input_counter++;
|
| + input_counter %= sizeof(kRandomString);
|
| + }
|
| +}
|
| +
|
| void CreateExtImageAtPath(const string& path, vector<string>* out_paths) {
|
| // create 10MiB sparse file
|
| EXPECT_EQ(0, System(StringPrintf("dd if=/dev/zero of=%s"
|
|
|