OLD | NEW |
1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium OS Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <sys/stat.h> | 5 #include <sys/stat.h> |
6 #include <sys/types.h> | 6 #include <sys/types.h> |
7 #include <unistd.h> | 7 #include <unistd.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
11 #include <gtest/gtest.h> | 11 #include <gtest/gtest.h> |
12 #include "update_engine/extent_writer.h" | 12 #include "update_engine/extent_writer.h" |
| 13 #include "update_engine/graph_types.h" |
13 #include "update_engine/test_utils.h" | 14 #include "update_engine/test_utils.h" |
14 #include "update_engine/utils.h" | 15 #include "update_engine/utils.h" |
15 | 16 |
16 using std::min; | 17 using std::min; |
17 using std::string; | 18 using std::string; |
18 using std::vector; | 19 using std::vector; |
19 | 20 |
20 namespace chromeos_update_engine { | 21 namespace chromeos_update_engine { |
21 | 22 |
22 COMPILE_ASSERT(sizeof(off_t) == 8, off_t_not_64_bit); | 23 COMPILE_ASSERT(sizeof(off_t) == 8, off_t_not_64_bit); |
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 vector<char> big(block_count * kBlockSize); | 247 vector<char> big(block_count * kBlockSize); |
247 for (vector<char>::size_type i = 0; i < big.size(); i++) { | 248 for (vector<char>::size_type i = 0; i < big.size(); i++) { |
248 big[i] = data[i % data.size()]; | 249 big[i] = data[i % data.size()]; |
249 } | 250 } |
250 memcpy(&expected_data[kBlockSize], &big[0], kBlockSize); | 251 memcpy(&expected_data[kBlockSize], &big[0], kBlockSize); |
251 memcpy(&expected_data[0], &big[3 * kBlockSize], kBlockSize); | 252 memcpy(&expected_data[0], &big[3 * kBlockSize], kBlockSize); |
252 ExpectVectorsEq(expected_data, resultant_data); | 253 ExpectVectorsEq(expected_data, resultant_data); |
253 } | 254 } |
254 | 255 |
255 } // namespace chromeos_update_engine | 256 } // namespace chromeos_update_engine |
OLD | NEW |