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

Unified Diff: net/spdy/spdy_test_utils.cc

Issue 266243004: Clang format slam. Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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
Index: net/spdy/spdy_test_utils.cc
diff --git a/net/spdy/spdy_test_utils.cc b/net/spdy/spdy_test_utils.cc
index a7cfc901fbd93ed3e24298a30043f02c05a53d43..8d46a6e957a428408da9c1382b30c815bd31b618 100644
--- a/net/spdy/spdy_test_utils.cc
+++ b/net/spdy/spdy_test_utils.cc
@@ -15,8 +15,10 @@ namespace net {
namespace test {
-std::string HexDumpWithMarks(const unsigned char* data, int length,
- const bool* marks, int mark_length) {
+std::string HexDumpWithMarks(const unsigned char* data,
+ int length,
+ const bool* marks,
+ int mark_length) {
static const char kHexChars[] = "0123456789abcdef";
static const int kColumns = 4;
@@ -30,7 +32,7 @@ std::string HexDumpWithMarks(const unsigned char* data, int length,
std::string hex;
for (const unsigned char* row = data; length > 0;
row += kColumns, length -= kColumns) {
- for (const unsigned char *p = row; p < row + 4; ++p) {
+ for (const unsigned char* p = row; p < row + 4; ++p) {
if (p < row + length) {
const bool mark =
(marks && (p - data) < mark_length && marks[p - data]);
@@ -44,7 +46,7 @@ std::string HexDumpWithMarks(const unsigned char* data, int length,
}
hex = hex + " ";
- for (const unsigned char *p = row; p < row + 4 && p < row + length; ++p)
+ for (const unsigned char* p = row; p < row + 4 && p < row + length; ++p)
hex += (*p >= 0x20 && *p <= 0x7f) ? (*p) : '.';
hex = hex + '\n';
@@ -52,12 +54,11 @@ std::string HexDumpWithMarks(const unsigned char* data, int length,
return hex;
}
-void CompareCharArraysWithHexError(
- const std::string& description,
- const unsigned char* actual,
- const int actual_len,
- const unsigned char* expected,
- const int expected_len) {
+void CompareCharArraysWithHexError(const std::string& description,
+ const unsigned char* actual,
+ const int actual_len,
+ const unsigned char* expected,
+ const int expected_len) {
const int min_len = std::min(actual_len, expected_len);
const int max_len = std::max(actual_len, expected_len);
scoped_ptr<bool[]> marks(new bool[max_len]);
@@ -73,14 +74,13 @@ void CompareCharArraysWithHexError(
for (int i = min_len; i < max_len; ++i) {
marks[i] = true;
}
- if (identical) return;
- ADD_FAILURE()
- << "Description:\n"
- << description
- << "\n\nExpected:\n"
- << HexDumpWithMarks(expected, expected_len, marks.get(), max_len)
- << "\nActual:\n"
- << HexDumpWithMarks(actual, actual_len, marks.get(), max_len);
+ if (identical)
+ return;
+ ADD_FAILURE() << "Description:\n" << description << "\n\nExpected:\n"
+ << HexDumpWithMarks(
+ expected, expected_len, marks.get(), max_len)
+ << "\nActual:\n"
+ << HexDumpWithMarks(actual, actual_len, marks.get(), max_len);
}
void SetFrameFlags(SpdyFrame* frame,
@@ -116,7 +116,7 @@ void SetFrameLength(SpdyFrame* frame,
break;
case SPDY4:
case SPDY5:
- CHECK_GT(1u<<14, length);
+ CHECK_GT(1u << 14, length);
{
int32 wire_length = base::HostToNet16(static_cast<uint16>(length));
memcpy(frame->data(),
@@ -129,7 +129,6 @@ void SetFrameLength(SpdyFrame* frame,
}
}
-
} // namespace test
} // namespace net

Powered by Google App Engine
This is Rietveld 408576698