OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 <sstream> | 5 #include <sstream> |
6 | 6 |
7 #include "base/strings/string16.h" | 7 #include "base/strings/string16.h" |
8 | 8 |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "testing/gtest/include/gtest/gtest.h" | 10 #include "testing/gtest/googletest/include/gtest/gtest.h" |
11 | 11 |
12 namespace base { | 12 namespace base { |
13 | 13 |
14 #if defined(WCHAR_T_IS_UTF32) | 14 #if defined(WCHAR_T_IS_UTF32) |
15 | 15 |
16 // We define a custom operator<< for string16 so we can use it with logging. | 16 // We define a custom operator<< for string16 so we can use it with logging. |
17 // This tests that conversion. | 17 // This tests that conversion. |
18 TEST(String16Test, OutputStream) { | 18 TEST(String16Test, OutputStream) { |
19 // Basic stream test. | 19 // Basic stream test. |
20 { | 20 { |
(...skipping 28 matching lines...) Expand all Loading... |
49 << surrogate_pair << "," << unterminated_surrogate; | 49 << surrogate_pair << "," << unterminated_surrogate; |
50 | 50 |
51 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds", | 51 EXPECT_STREQ("\xef\xbf\xbd,\xef\xbf\xbd,\xf0\x90\x8c\x80z,\xef\xbf\xbds", |
52 stream.str().c_str()); | 52 stream.str().c_str()); |
53 } | 53 } |
54 } | 54 } |
55 | 55 |
56 #endif | 56 #endif |
57 | 57 |
58 } // namespace base | 58 } // namespace base |
OLD | NEW |