OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/format_macros.h" | 12 #include "base/format_macros.h" |
13 #include "base/i18n/icu_string_conversions.h" | 13 #include "base/i18n/icu_string_conversions.h" |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/stringprintf.h" | 15 #include "base/stringprintf.h" |
16 #include "base/string_piece.h" | 16 #include "base/strings/string_piece.h" |
17 #include "base/utf_string_conversions.h" | 17 #include "base/utf_string_conversions.h" |
18 #include "testing/gtest/include/gtest/gtest.h" | 18 #include "testing/gtest/include/gtest/gtest.h" |
19 | 19 |
20 namespace base { | 20 namespace base { |
21 | 21 |
22 namespace { | 22 namespace { |
23 | 23 |
24 // Given a null-terminated string of wchar_t with each wchar_t representing | 24 // Given a null-terminated string of wchar_t with each wchar_t representing |
25 // a UTF-16 code unit, returns a string16 made up of wchar_t's in the input. | 25 // a UTF-16 code unit, returns a string16 made up of wchar_t's in the input. |
26 // Each wchar_t should be <= 0xFFFF and a non-BMP character (> U+FFFF) | 26 // Each wchar_t should be <= 0xFFFF and a non-BMP character (> U+FFFF) |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
377 | 377 |
378 bool success = ConvertToUtf8AndNormalize( | 378 bool success = ConvertToUtf8AndNormalize( |
379 kConvertAndNormalizeCases[i].encoded, | 379 kConvertAndNormalizeCases[i].encoded, |
380 kConvertAndNormalizeCases[i].codepage_name, &result); | 380 kConvertAndNormalizeCases[i].codepage_name, &result); |
381 EXPECT_EQ(kConvertAndNormalizeCases[i].expected_success, success); | 381 EXPECT_EQ(kConvertAndNormalizeCases[i].expected_success, success); |
382 EXPECT_EQ(kConvertAndNormalizeCases[i].expected_value, result); | 382 EXPECT_EQ(kConvertAndNormalizeCases[i].expected_value, result); |
383 } | 383 } |
384 } | 384 } |
385 | 385 |
386 } // namespace base | 386 } // namespace base |
OLD | NEW |