Fix FilesystemCopierAction unit tests.
This will add an explicit failure if either the read source/target
content fails to compare against the original. This way we can be sure
whichever has caused a failure when one is exhibited.
BUG=chromium-os:29841
TEST=Builds and passes unit tests
Change-Id: I685ddf9a383c0bddfea22369a128c7d8c56b0295
Reviewed-on: https://gerrit.chromium.org/gerrit/25127
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
diff --git a/filesystem_copier_action_unittest.cc b/filesystem_copier_action_unittest.cc
index a1d5233..a626363 100644
--- a/filesystem_copier_action_unittest.cc
+++ b/filesystem_copier_action_unittest.cc
@@ -270,14 +270,18 @@
ADD_FAILURE();
return false;
}
- success = success && ExpectVectorsEq(a_loop_data, a_out);
+ const bool is_a_file_reading_eq = ExpectVectorsEq(a_loop_data, a_out);
+ EXPECT_TRUE(is_a_file_reading_eq);
+ success = success && is_a_file_reading_eq;
if (!verify_hash) {
vector<char> b_out;
if (!utils::ReadFile(b_dev, &b_out)) {
ADD_FAILURE();
return false;
}
- success = success && ExpectVectorsEq(a_out, b_out);
+ const bool is_b_file_reading_eq = ExpectVectorsEq(a_out, b_out);
+ EXPECT_TRUE(is_b_file_reading_eq);
+ success = success && is_b_file_reading_eq;
}
bool is_install_plan_eq = (collector_action.object() == install_plan);