Fix to unit testing code.
* test_utils::ExpectVectorsEq() returns false if vector contents are not
identical (conforming to the documentation in test_utils.h). This
should clarify which of the ExpectVectorsEq() calls fail in the
associated bug.
* Moved a buffer integrity test to a more sensible location.
BUG=chromium-os:29841
TEST=Unit tests run successfully
Change-Id: I1d8d679e3b42e9b90af7d906bb019feeecbb8e0e
Reviewed-on: https://gerrit.chromium.org/gerrit/22704
Reviewed-by: Don Garrett <dgarrett@chromium.org>
Tested-by: Gilad Arnold <garnold@chromium.org>
Commit-Ready: Gilad Arnold <garnold@chromium.org>
diff --git a/filesystem_copier_action_unittest.cc b/filesystem_copier_action_unittest.cc
index ccad03a..967ca20 100644
--- a/filesystem_copier_action_unittest.cc
+++ b/filesystem_copier_action_unittest.cc
@@ -211,12 +211,12 @@
// Make sure everything in the out_image is there
vector<char> a_out;
EXPECT_TRUE(utils::ReadFile(a_dev, &a_out));
+ EXPECT_TRUE(ExpectVectorsEq(a_loop_data, a_out));
if (!verify_hash) {
vector<char> b_out;
EXPECT_TRUE(utils::ReadFile(b_dev, &b_out));
EXPECT_TRUE(ExpectVectorsEq(a_out, b_out));
}
- EXPECT_TRUE(ExpectVectorsEq(a_loop_data, a_out));
EXPECT_TRUE(collector_action.object() == install_plan);
}