Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(848)

Unified Diff: ppapi/shared_impl/unittest_utils.cc

Issue 174213003: PPAPI: Use clang-format on ppapi/shared_impl (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: remove DEPS Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ppapi/shared_impl/tracked_callback_unittest.cc ('k') | ppapi/shared_impl/url_request_info_data.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ppapi/shared_impl/unittest_utils.cc
diff --git a/ppapi/shared_impl/unittest_utils.cc b/ppapi/shared_impl/unittest_utils.cc
index 6974bd20b3f88d912c92953b44233f5e65525591..a52db341e218dddf354c45fcf627b4ad1f6fe0e8 100644
--- a/ppapi/shared_impl/unittest_utils.cc
+++ b/ppapi/shared_impl/unittest_utils.cc
@@ -27,8 +27,8 @@ bool Equals(const PP_Var& expected,
const PP_Var& actual,
base::hash_map<int64_t, int64_t>* visited_map) {
if (expected.type != actual.type) {
- LOG(ERROR) << "expected type: " << expected.type <<
- " actual type: " << actual.type;
+ LOG(ERROR) << "expected type: " << expected.type
+ << " actual type: " << actual.type;
return false;
}
if (VarTracker::IsVarTypeRefcounted(expected.type)) {
@@ -36,8 +36,8 @@ bool Equals(const PP_Var& expected,
visited_map->find(expected.value.as_id);
if (it != visited_map->end()) {
if (it->second != actual.value.as_id) {
- LOG(ERROR) << "expected id: " << it->second << " actual id: " <<
- actual.value.as_id;
+ LOG(ERROR) << "expected id: " << it->second
+ << " actual id: " << actual.value.as_id;
return false;
} else {
return true;
@@ -53,29 +53,29 @@ bool Equals(const PP_Var& expected,
return true;
case PP_VARTYPE_BOOL:
if (expected.value.as_bool != actual.value.as_bool) {
- LOG(ERROR) << "expected: " << expected.value.as_bool << " actual: " <<
- actual.value.as_bool;
+ LOG(ERROR) << "expected: " << expected.value.as_bool
+ << " actual: " << actual.value.as_bool;
return false;
}
return true;
case PP_VARTYPE_INT32:
if (expected.value.as_int != actual.value.as_int) {
- LOG(ERROR) << "expected: " << expected.value.as_int << " actual: " <<
- actual.value.as_int;
+ LOG(ERROR) << "expected: " << expected.value.as_int
+ << " actual: " << actual.value.as_int;
return false;
}
return true;
case PP_VARTYPE_DOUBLE:
if (fabs(expected.value.as_double - actual.value.as_double) > 1.0e-4) {
- LOG(ERROR) << "expected: " << expected.value.as_double <<
- " actual: " << actual.value.as_double;
+ LOG(ERROR) << "expected: " << expected.value.as_double
+ << " actual: " << actual.value.as_double;
return false;
}
return true;
case PP_VARTYPE_OBJECT:
if (expected.value.as_id != actual.value.as_id) {
- LOG(ERROR) << "expected: " << expected.value.as_id << " actual: " <<
- actual.value.as_id;
+ LOG(ERROR) << "expected: " << expected.value.as_id
+ << " actual: " << actual.value.as_id;
return false;
}
return true;
@@ -84,8 +84,8 @@ bool Equals(const PP_Var& expected,
StringVar* actual_var = StringVar::FromPPVar(actual);
DCHECK(expected_var && actual_var);
if (expected_var->value() != actual_var->value()) {
- LOG(ERROR) << "expected: " << expected_var->value() << " actual: " <<
- actual_var->value();
+ LOG(ERROR) << "expected: " << expected_var->value()
+ << " actual: " << actual_var->value();
return false;
}
return true;
@@ -95,11 +95,12 @@ bool Equals(const PP_Var& expected,
ArrayBufferVar* actual_var = ArrayBufferVar::FromPPVar(actual);
DCHECK(expected_var && actual_var);
if (expected_var->ByteLength() != actual_var->ByteLength()) {
- LOG(ERROR) << "expected: " << expected_var->ByteLength() <<
- " actual: " << actual_var->ByteLength();
+ LOG(ERROR) << "expected: " << expected_var->ByteLength()
+ << " actual: " << actual_var->ByteLength();
return false;
}
- if (memcmp(expected_var->Map(), actual_var->Map(),
+ if (memcmp(expected_var->Map(),
+ actual_var->Map(),
expected_var->ByteLength()) != 0) {
LOG(ERROR) << "expected array buffer does not match actual.";
return false;
@@ -111,8 +112,8 @@ bool Equals(const PP_Var& expected,
ArrayVar* actual_var = ArrayVar::FromPPVar(actual);
DCHECK(expected_var && actual_var);
if (expected_var->elements().size() != actual_var->elements().size()) {
- LOG(ERROR) << "expected: " << expected_var->elements().size() <<
- " actual: " << actual_var->elements().size();
+ LOG(ERROR) << "expected: " << expected_var->elements().size()
+ << " actual: " << actual_var->elements().size();
return false;
}
for (size_t i = 0; i < expected_var->elements().size(); ++i) {
@@ -130,19 +131,19 @@ bool Equals(const PP_Var& expected,
DCHECK(expected_var && actual_var);
if (expected_var->key_value_map().size() !=
actual_var->key_value_map().size()) {
- LOG(ERROR) << "expected: " << expected_var->key_value_map().size() <<
- " actual: " << actual_var->key_value_map().size();
+ LOG(ERROR) << "expected: " << expected_var->key_value_map().size()
+ << " actual: " << actual_var->key_value_map().size();
return false;
}
DictionaryVar::KeyValueMap::const_iterator expected_iter =
expected_var->key_value_map().begin();
DictionaryVar::KeyValueMap::const_iterator actual_iter =
actual_var->key_value_map().begin();
- for ( ; expected_iter != expected_var->key_value_map().end();
+ for (; expected_iter != expected_var->key_value_map().end();
++expected_iter, ++actual_iter) {
if (expected_iter->first != actual_iter->first) {
- LOG(ERROR) << "expected: " << expected_iter->first <<
- " actual: " << actual_iter->first;
+ LOG(ERROR) << "expected: " << expected_iter->first
+ << " actual: " << actual_iter->first;
return false;
}
if (!Equals(expected_iter->second.get(),
@@ -164,12 +165,11 @@ bool Equals(const PP_Var& expected,
}
const IPC::Message* actual_message = actual_var->GetCreationMessage();
- const IPC::Message* expected_message =
- expected_var->GetCreationMessage();
+ const IPC::Message* expected_message = expected_var->GetCreationMessage();
if (expected_message->size() != actual_message->size()) {
LOG(ERROR) << "expected creation message size: "
- << expected_message->size() << " actual: "
- << actual_message->size();
+ << expected_message->size()
+ << " actual: " << actual_message->size();
return false;
}
@@ -179,10 +179,12 @@ bool Equals(const PP_Var& expected,
// the comparison to fail.
IPC::Message local_actual_message(*actual_message);
local_actual_message.SetHeaderValues(
- actual_message->routing_id(), actual_message->type(),
+ actual_message->routing_id(),
+ actual_message->type(),
(expected_message->flags() & 0xffffff00) |
- (actual_message->flags() & 0xff));
- if (memcmp(expected_message->data(), local_actual_message.data(),
+ (actual_message->flags() & 0xff));
+ if (memcmp(expected_message->data(),
+ local_actual_message.data(),
expected_message->size()) != 0) {
LOG(ERROR) << "expected creation message does not match actual.";
return false;
« no previous file with comments | « ppapi/shared_impl/tracked_callback_unittest.cc ('k') | ppapi/shared_impl/url_request_info_data.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698