OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium 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/types.h> | 5 #include <sys/types.h> |
6 #include <sys/stat.h> | 6 #include <sys/stat.h> |
7 #include <fcntl.h> | 7 #include <fcntl.h> |
8 #include <unistd.h> | 8 #include <unistd.h> |
9 #include <set> | 9 #include <set> |
10 #include <string> | 10 #include <string> |
(...skipping 266 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 EXPECT_EQ(1, graph[0].op.src_extents(1).num_blocks()); | 277 EXPECT_EQ(1, graph[0].op.src_extents(1).num_blocks()); |
278 EXPECT_EQ(7, graph[0].op.src_extents(2).start_block()); | 278 EXPECT_EQ(7, graph[0].op.src_extents(2).start_block()); |
279 EXPECT_EQ(1, graph[0].op.src_extents(2).num_blocks()); | 279 EXPECT_EQ(1, graph[0].op.src_extents(2).num_blocks()); |
280 | 280 |
281 // And that the old dst extents haven't changed | 281 // And that the old dst extents haven't changed |
282 EXPECT_EQ(2, graph[0].op.dst_extents_size()); | 282 EXPECT_EQ(2, graph[0].op.dst_extents_size()); |
283 EXPECT_EQ(1, graph[0].op.dst_extents(0).start_block()); | 283 EXPECT_EQ(1, graph[0].op.dst_extents(0).start_block()); |
284 EXPECT_EQ(2, graph[0].op.dst_extents(0).num_blocks()); | 284 EXPECT_EQ(2, graph[0].op.dst_extents(0).num_blocks()); |
285 EXPECT_EQ(4, graph[0].op.dst_extents(1).start_block()); | 285 EXPECT_EQ(4, graph[0].op.dst_extents(1).start_block()); |
286 EXPECT_EQ(1, graph[0].op.dst_extents(1).num_blocks()); | 286 EXPECT_EQ(1, graph[0].op.dst_extents(1).num_blocks()); |
287 | 287 |
288 // Ensure it only depends on the next node | 288 // Ensure it only depends on the next node and the new temp node |
289 EXPECT_EQ(1, graph[0].out_edges.size()); | 289 EXPECT_EQ(2, graph[0].out_edges.size()); |
290 EXPECT_TRUE(graph[0].out_edges.end() != graph[0].out_edges.find(1)); | 290 EXPECT_TRUE(graph[0].out_edges.end() != graph[0].out_edges.find(1)); |
291 | 291 EXPECT_TRUE(graph[0].out_edges.end() != graph[0].out_edges.find(graph.size() - |
| 292 1)); |
| 293 |
292 // Check second node has unchanged extents | 294 // Check second node has unchanged extents |
293 EXPECT_EQ(2, graph[1].op.src_extents_size()); | 295 EXPECT_EQ(2, graph[1].op.src_extents_size()); |
294 EXPECT_EQ(1, graph[1].op.src_extents(0).start_block()); | 296 EXPECT_EQ(1, graph[1].op.src_extents(0).start_block()); |
295 EXPECT_EQ(2, graph[1].op.src_extents(0).num_blocks()); | 297 EXPECT_EQ(2, graph[1].op.src_extents(0).num_blocks()); |
296 EXPECT_EQ(4, graph[1].op.src_extents(1).start_block()); | 298 EXPECT_EQ(4, graph[1].op.src_extents(1).start_block()); |
297 EXPECT_EQ(1, graph[1].op.src_extents(1).num_blocks()); | 299 EXPECT_EQ(1, graph[1].op.src_extents(1).num_blocks()); |
298 | 300 |
299 EXPECT_EQ(2, graph[1].op.dst_extents_size()); | 301 EXPECT_EQ(2, graph[1].op.dst_extents_size()); |
300 EXPECT_EQ(3, graph[1].op.dst_extents(0).start_block()); | 302 EXPECT_EQ(3, graph[1].op.dst_extents(0).start_block()); |
301 EXPECT_EQ(1, graph[1].op.dst_extents(0).num_blocks()); | 303 EXPECT_EQ(1, graph[1].op.dst_extents(0).num_blocks()); |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 EXPECT_EQ(0, manifest.install_operations(0).data_offset()); | 342 EXPECT_EQ(0, manifest.install_operations(0).data_offset()); |
341 EXPECT_EQ(3, manifest.install_operations(0).data_length()); | 343 EXPECT_EQ(3, manifest.install_operations(0).data_length()); |
342 EXPECT_EQ(3, manifest.install_operations(1).data_offset()); | 344 EXPECT_EQ(3, manifest.install_operations(1).data_offset()); |
343 EXPECT_EQ(1, manifest.install_operations(1).data_length()); | 345 EXPECT_EQ(1, manifest.install_operations(1).data_length()); |
344 | 346 |
345 unlink(orig_blobs.c_str()); | 347 unlink(orig_blobs.c_str()); |
346 unlink(new_blobs.c_str()); | 348 unlink(new_blobs.c_str()); |
347 } | 349 } |
348 | 350 |
349 } // namespace chromeos_update_engine | 351 } // namespace chromeos_update_engine |
OLD | NEW |