| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 #include <stdarg.h> | 6 #include <stdarg.h> |
| 7 | 7 |
| 8 #include <limits> | 8 #include <limits> |
| 9 #include <sstream> | 9 #include <sstream> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/logging.h" | |
| 13 #include "base/string_util.h" | 12 #include "base/string_util.h" |
| 14 #include "testing/gtest/include/gtest/gtest.h" | 13 #include "testing/gtest/include/gtest/gtest.h" |
| 15 | 14 |
| 16 namespace { | 15 namespace { |
| 17 } | 16 } |
| 18 | 17 |
| 19 static const struct trim_case { | 18 static const struct trim_case { |
| 20 const wchar_t* input; | 19 const wchar_t* input; |
| 21 const TrimPositions positions; | 20 const TrimPositions positions; |
| 22 const wchar_t* output; | 21 const wchar_t* output; |
| (...skipping 1577 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1600 } | 1599 } |
| 1601 } | 1600 } |
| 1602 | 1601 |
| 1603 TEST(StringUtilTest, HexEncode) { | 1602 TEST(StringUtilTest, HexEncode) { |
| 1604 std::string hex(HexEncode(NULL, 0)); | 1603 std::string hex(HexEncode(NULL, 0)); |
| 1605 EXPECT_EQ(hex.length(), 0U); | 1604 EXPECT_EQ(hex.length(), 0U); |
| 1606 unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03, 0x80, 0x81}; | 1605 unsigned char bytes[] = {0x01, 0xff, 0x02, 0xfe, 0x03, 0x80, 0x81}; |
| 1607 hex = HexEncode(bytes, sizeof(bytes)); | 1606 hex = HexEncode(bytes, sizeof(bytes)); |
| 1608 EXPECT_EQ(hex.compare("01FF02FE038081"), 0); | 1607 EXPECT_EQ(hex.compare("01FF02FE038081"), 0); |
| 1609 } | 1608 } |
| OLD | NEW |