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

Side by Side Diff: base/strings/string_number_conversions_unittest.cc

Issue 13956013: Fix build bustage. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include <math.h> 5 #include <math.h>
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 {"DeadBeef", 0xdeadbeef, true}, 326 {"DeadBeef", 0xdeadbeef, true},
327 {"0x42", 66, true}, 327 {"0x42", 66, true},
328 {"-0x42", -66, true}, 328 {"-0x42", -66, true},
329 {"+0x42", 66, true}, 329 {"+0x42", 66, true},
330 {"0x40acd88557b", GG_INT64_C(4444444448123), true}, 330 {"0x40acd88557b", GG_INT64_C(4444444448123), true},
331 {"0x7fffffff", INT_MAX, true}, 331 {"0x7fffffff", INT_MAX, true},
332 {"-0x80000000", INT_MIN, true}, 332 {"-0x80000000", INT_MIN, true},
333 {"0xffffffff", 0xffffffff, true}, 333 {"0xffffffff", 0xffffffff, true},
334 {"0XDeadBeef", 0xdeadbeef, true}, 334 {"0XDeadBeef", 0xdeadbeef, true},
335 {"0x7fffffffffffffff", kint64max, true}, 335 {"0x7fffffffffffffff", kint64max, true},
336 {"-0x8000000000000000", 0x8000000000000000L, true}, 336 {"-0x8000000000000000", GG_UINT64_C(0x8000000000000000), true},
337 {"0x8000000000000000", 0x8000000000000000L, true}, 337 {"0x8000000000000000", GG_UINT64_C(0x8000000000000000), true},
338 {"-0x8000000000000001", 0x7fffffffffffffffL, true}, 338 {"-0x8000000000000001", GG_UINT64_C(0x7fffffffffffffff), true},
339 {"0xFFFFFFFFFFFFFFFF", kuint64max, true}, 339 {"0xFFFFFFFFFFFFFFFF", kuint64max, true},
340 {"FFFFFFFFFFFFFFFF", kuint64max, true}, 340 {"FFFFFFFFFFFFFFFF", kuint64max, true},
341 {"0x0000000000000000", 0, true}, 341 {"0x0000000000000000", 0, true},
342 {"0000000000000000", 0, true}, 342 {"0000000000000000", 0, true},
343 {"1FFFFFFFFFFFFFFFF", kuint64max, false}, // Overflow test. 343 {"1FFFFFFFFFFFFFFFF", kuint64max, false}, // Overflow test.
344 {"0x0f", 15, true}, 344 {"0x0f", 15, true},
345 {"0f", 15, true}, 345 {"0f", 15, true},
346 {" 45", 0x45, false}, 346 {" 45", 0x45, false},
347 {"\t\n\v\f\r 0x45", 0x45, false}, 347 {"\t\n\v\f\r 0x45", 0x45, false},
348 {" 45", 0x45, false}, 348 {" 45", 0x45, false},
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
495 495
496 TEST(StringNumberConversionsTest, HexEncode) { 496 TEST(StringNumberConversionsTest, HexEncode) {
497 std::string hex(HexEncode(NULL, 0)); 497 std::string hex(HexEncode(NULL, 0));
498 EXPECT_EQ(hex.length(), 0U); 498 EXPECT_EQ(hex.length(), 0U);
499 unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03, 0x80, 0x81}; 499 unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03, 0x80, 0x81};
500 hex = HexEncode(bytes, sizeof(bytes)); 500 hex = HexEncode(bytes, sizeof(bytes));
501 EXPECT_EQ(hex.compare("01FF02FE038081"), 0); 501 EXPECT_EQ(hex.compare("01FF02FE038081"), 0);
502 } 502 }
503 503
504 } // namespace base 504 } // namespace base
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698