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

Unified Diff: net/websockets/websocket_frame_test.cc

Issue 1841863002: Update monet. (Closed) Base URL: https://github.com/domokit/monet.git@master
Patch Set: Created 4 years, 9 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 | « net/websockets/websocket_frame_parser_test.cc ('k') | net/websockets/websocket_stream_cookie_test.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/websockets/websocket_frame_test.cc
diff --git a/net/websockets/websocket_frame_test.cc b/net/websockets/websocket_frame_test.cc
index eca94f02647ee014efaad3bf84b21f65b64f6376..b6d1df2009cc4fefac65f7c75e0ad6fd1ccddc68 100644
--- a/net/websockets/websocket_frame_test.cc
+++ b/net/websockets/websocket_frame_test.cc
@@ -4,6 +4,8 @@
#include "net/websockets/websocket_frame.h"
+#include <stdint.h>
+
#include <algorithm>
#include <vector>
@@ -23,14 +25,13 @@ TEST(WebSocketFrameHeaderTest, FrameLengths) {
uint64 frame_length;
};
static const TestCase kTests[] = {
- { "\x81\x00", 2, GG_UINT64_C(0) },
- { "\x81\x7D", 2, GG_UINT64_C(125) },
- { "\x81\x7E\x00\x7E", 4, GG_UINT64_C(126) },
- { "\x81\x7E\xFF\xFF", 4, GG_UINT64_C(0xFFFF) },
- { "\x81\x7F\x00\x00\x00\x00\x00\x01\x00\x00", 10, GG_UINT64_C(0x10000) },
- { "\x81\x7F\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 10,
- GG_UINT64_C(0x7FFFFFFFFFFFFFFF) }
- };
+ {"\x81\x00", 2, UINT64_C(0)},
+ {"\x81\x7D", 2, UINT64_C(125)},
+ {"\x81\x7E\x00\x7E", 4, UINT64_C(126)},
+ {"\x81\x7E\xFF\xFF", 4, UINT64_C(0xFFFF)},
+ {"\x81\x7F\x00\x00\x00\x00\x00\x01\x00\x00", 10, UINT64_C(0x10000)},
+ {"\x81\x7F\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF", 10,
+ UINT64_C(0x7FFFFFFFFFFFFFFF)}};
static const int kNumTests = arraysize(kTests);
for (int i = 0; i < kNumTests; ++i) {
@@ -61,15 +62,14 @@ TEST(WebSocketFrameHeaderTest, FrameLengthsWithMasking) {
uint64 frame_length;
};
static const TestCase kTests[] = {
- { "\x81\x80\xDE\xAD\xBE\xEF", 6, GG_UINT64_C(0) },
- { "\x81\xFD\xDE\xAD\xBE\xEF", 6, GG_UINT64_C(125) },
- { "\x81\xFE\x00\x7E\xDE\xAD\xBE\xEF", 8, GG_UINT64_C(126) },
- { "\x81\xFE\xFF\xFF\xDE\xAD\xBE\xEF", 8, GG_UINT64_C(0xFFFF) },
- { "\x81\xFF\x00\x00\x00\x00\x00\x01\x00\x00\xDE\xAD\xBE\xEF", 14,
- GG_UINT64_C(0x10000) },
- { "\x81\xFF\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xDE\xAD\xBE\xEF", 14,
- GG_UINT64_C(0x7FFFFFFFFFFFFFFF) }
- };
+ {"\x81\x80\xDE\xAD\xBE\xEF", 6, UINT64_C(0)},
+ {"\x81\xFD\xDE\xAD\xBE\xEF", 6, UINT64_C(125)},
+ {"\x81\xFE\x00\x7E\xDE\xAD\xBE\xEF", 8, UINT64_C(126)},
+ {"\x81\xFE\xFF\xFF\xDE\xAD\xBE\xEF", 8, UINT64_C(0xFFFF)},
+ {"\x81\xFF\x00\x00\x00\x00\x00\x01\x00\x00\xDE\xAD\xBE\xEF", 14,
+ UINT64_C(0x10000)},
+ {"\x81\xFF\x7F\xFF\xFF\xFF\xFF\xFF\xFF\xFF\xDE\xAD\xBE\xEF", 14,
+ UINT64_C(0x7FFFFFFFFFFFFFFF)}};
static const int kNumTests = arraysize(kTests);
WebSocketMaskingKey masking_key;
@@ -182,20 +182,18 @@ TEST(WebSocketFrameHeaderTest, InsufficientBufferSize) {
bool masked;
size_t expected_header_size;
};
- static const TestCase kTests[] = {
- { GG_UINT64_C(0), false, 2u },
- { GG_UINT64_C(125), false, 2u },
- { GG_UINT64_C(126), false, 4u },
- { GG_UINT64_C(0xFFFF), false, 4u },
- { GG_UINT64_C(0x10000), false, 10u },
- { GG_UINT64_C(0x7FFFFFFFFFFFFFFF), false, 10u },
- { GG_UINT64_C(0), true, 6u },
- { GG_UINT64_C(125), true, 6u },
- { GG_UINT64_C(126), true, 8u },
- { GG_UINT64_C(0xFFFF), true, 8u },
- { GG_UINT64_C(0x10000), true, 14u },
- { GG_UINT64_C(0x7FFFFFFFFFFFFFFF), true, 14u }
- };
+ static const TestCase kTests[] = {{UINT64_C(0), false, 2u},
+ {UINT64_C(125), false, 2u},
+ {UINT64_C(126), false, 4u},
+ {UINT64_C(0xFFFF), false, 4u},
+ {UINT64_C(0x10000), false, 10u},
+ {UINT64_C(0x7FFFFFFFFFFFFFFF), false, 10u},
+ {UINT64_C(0), true, 6u},
+ {UINT64_C(125), true, 6u},
+ {UINT64_C(126), true, 8u},
+ {UINT64_C(0xFFFF), true, 8u},
+ {UINT64_C(0x10000), true, 14u},
+ {UINT64_C(0x7FFFFFFFFFFFFFFF), true, 14u}};
static const int kNumTests = arraysize(kTests);
for (int i = 0; i < kNumTests; ++i) {
« no previous file with comments | « net/websockets/websocket_frame_parser_test.cc ('k') | net/websockets/websocket_stream_cookie_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698