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

Unified Diff: chrome/utility/local_discovery/local_domain_resolver_unittest.cc

Issue 21534003: avoid char+'\xHH' as it's too easy to use values > 127 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: corresponding change in chrome unit tests Created 7 years, 5 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 | « no previous file | chrome/utility/local_discovery/service_discovery_client_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/utility/local_discovery/local_domain_resolver_unittest.cc
diff --git a/chrome/utility/local_discovery/local_domain_resolver_unittest.cc b/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
index c1fd51c623c73d703656478190496b96f8bf8da0..1dc9fc31ca48de7f0a7b80c71a5ef2d1fdfd3b28 100644
--- a/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
+++ b/chrome/utility/local_discovery/local_domain_resolver_unittest.cc
@@ -14,48 +14,48 @@ namespace local_discovery {
namespace {
-const char kSamplePacketA[] = {
+const uint8 kSamplePacketA[] = {
// Header
- '\x00', '\x00', // ID is zeroed out
- '\x81', '\x80', // Standard query response, RA, no error
- '\x00', '\x00', // No questions (for simplicity)
- '\x00', '\x01', // 1 RR (answers)
- '\x00', '\x00', // 0 authority RRs
- '\x00', '\x00', // 0 additional RRs
-
- '\x07', 'm', 'y', 'h', 'e', 'l', 'l', 'o',
- '\x05', 'l', 'o', 'c', 'a', 'l',
- '\x00',
- '\x00', '\x01', // TYPE is A.
- '\x00', '\x01', // CLASS is IN.
- '\x00', '\x00', // TTL (4 bytes) is 16 seconds.
- '\x00', '\x10',
- '\x00', '\x04', // RDLENGTH is 4 bytes.
- '\x01', '\x02',
- '\x03', '\x04',
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x01, // 1 RR (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ 0x07, 'm', 'y', 'h', 'e', 'l', 'l', 'o',
+ 0x05, 'l', 'o', 'c', 'a', 'l',
+ 0x00,
+ 0x00, 0x01, // TYPE is A.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 16 seconds.
+ 0x00, 0x10,
+ 0x00, 0x04, // RDLENGTH is 4 bytes.
+ 0x01, 0x02,
+ 0x03, 0x04,
};
-const char kSamplePacketAAAA[] = {
+const uint8 kSamplePacketAAAA[] = {
// Header
- '\x00', '\x00', // ID is zeroed out
- '\x81', '\x80', // Standard query response, RA, no error
- '\x00', '\x00', // No questions (for simplicity)
- '\x00', '\x01', // 1 RR (answers)
- '\x00', '\x00', // 0 authority RRs
- '\x00', '\x00', // 0 additional RRs
-
- '\x07', 'm', 'y', 'h', 'e', 'l', 'l', 'o',
- '\x05', 'l', 'o', 'c', 'a', 'l',
- '\x00',
- '\x00', '\x1C', // TYPE is AAAA.
- '\x00', '\x01', // CLASS is IN.
- '\x00', '\x00', // TTL (4 bytes) is 16 seconds.
- '\x00', '\x10',
- '\x00', '\x10', // RDLENGTH is 4 bytes.
- '\x00', '\x0A', '\x00', '\x00',
- '\x00', '\x00', '\x00', '\x00',
- '\x00', '\x01', '\x00', '\x02',
- '\x00', '\x03', '\x00', '\x04',
+ 0x00, 0x00, // ID is zeroed out
+ 0x81, 0x80, // Standard query response, RA, no error
+ 0x00, 0x00, // No questions (for simplicity)
+ 0x00, 0x01, // 1 RR (answers)
+ 0x00, 0x00, // 0 authority RRs
+ 0x00, 0x00, // 0 additional RRs
+
+ 0x07, 'm', 'y', 'h', 'e', 'l', 'l', 'o',
+ 0x05, 'l', 'o', 'c', 'a', 'l',
+ 0x00,
+ 0x00, 0x1C, // TYPE is AAAA.
+ 0x00, 0x01, // CLASS is IN.
+ 0x00, 0x00, // TTL (4 bytes) is 16 seconds.
+ 0x00, 0x10,
+ 0x00, 0x10, // RDLENGTH is 4 bytes.
+ 0x00, 0x0A, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x00, 0x02,
+ 0x00, 0x03, 0x00, 0x04,
};
class LocalDomainResolverTest : public testing::Test {
« no previous file with comments | « no previous file | chrome/utility/local_discovery/service_discovery_client_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698