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 <[email protected]>
Tested-by: Gilad Arnold <[email protected]>
Commit-Ready: Gilad Arnold <[email protected]>
diff --git a/test_utils.cc b/test_utils.cc
index 7e77519..6e5ec44 100644
--- a/test_utils.cc
+++ b/test_utils.cc
@@ -168,10 +168,12 @@
EXPECT_EQ(expected.size(), actual.size());
if (expected.size() != actual.size())
return false;
+ bool is_all_eq = true;
for (unsigned int i = 0; i < expected.size(); i++) {
EXPECT_EQ(expected[i], actual[i]) << "offset: " << i;
+ is_all_eq = is_all_eq && (expected[i] == actual[i]);
}
- return true;
+ return is_all_eq;
}
void FillWithData(vector<char>* buffer) {