OLD | NEW |
1 // Copyright 2014 PDFium Authors. All rights reserved. | 1 // Copyright 2014 PDFium 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 "testing/gtest/include/gtest/gtest.h" | 5 #include "testing/gtest/include/gtest/gtest.h" |
6 #include "../../../testing/fx_string_testhelpers.h" | 6 #include "../../../testing/fx_string_testhelpers.h" |
7 #include "../../include/fxcrt/fx_basic.h" | 7 #include "../../include/fxcrt/fx_basic.h" |
8 | 8 |
9 TEST(fxcrt, WideStringOperatorSubscript) { | 9 TEST(fxcrt, WideStringOperatorSubscript) { |
10 // CFX_WideString includes the NUL terminator for non-empty strings. | 10 // CFX_WideString includes the NUL terminator for non-empty strings. |
(...skipping 28 matching lines...) Expand all Loading... |
39 EXPECT_FALSE(abc < a); | 39 EXPECT_FALSE(abc < a); |
40 | 40 |
41 EXPECT_TRUE(a < def); | 41 EXPECT_TRUE(a < def); |
42 EXPECT_FALSE(def < a); | 42 EXPECT_FALSE(def < a); |
43 | 43 |
44 EXPECT_TRUE(abc < def); | 44 EXPECT_TRUE(abc < def); |
45 EXPECT_FALSE(def < abc); | 45 EXPECT_FALSE(def < abc); |
46 } | 46 } |
47 | 47 |
48 TEST(fxcrt, WideStringOperatorEQ) { | 48 TEST(fxcrt, WideStringOperatorEQ) { |
| 49 CFX_WideString null_string; |
| 50 EXPECT_TRUE(null_string == null_string); |
| 51 |
| 52 CFX_WideString empty_string(L""); |
| 53 EXPECT_TRUE(empty_string == empty_string); |
| 54 EXPECT_TRUE(empty_string == null_string); |
| 55 EXPECT_TRUE(null_string == empty_string); |
| 56 |
| 57 CFX_WideString deleted_string(L"hello"); |
| 58 deleted_string.Delete(0, 5); |
| 59 EXPECT_TRUE(deleted_string == deleted_string); |
| 60 EXPECT_TRUE(deleted_string == null_string); |
| 61 EXPECT_TRUE(deleted_string == empty_string); |
| 62 EXPECT_TRUE(null_string == deleted_string); |
| 63 EXPECT_TRUE(null_string == empty_string); |
| 64 |
49 CFX_WideString wide_string(L"hello"); | 65 CFX_WideString wide_string(L"hello"); |
50 ASSERT_TRUE(wide_string == wide_string); | 66 EXPECT_TRUE(wide_string == wide_string); |
| 67 EXPECT_FALSE(wide_string == null_string); |
| 68 EXPECT_FALSE(wide_string == empty_string); |
| 69 EXPECT_FALSE(wide_string == deleted_string); |
| 70 EXPECT_FALSE(null_string == wide_string); |
| 71 EXPECT_FALSE(empty_string == wide_string); |
| 72 EXPECT_FALSE(deleted_string == wide_string); |
51 | 73 |
52 CFX_WideString wide_string_same1(L"hello"); | 74 CFX_WideString wide_string_same1(L"hello"); |
53 ASSERT_TRUE(wide_string == wide_string_same1); | 75 EXPECT_TRUE(wide_string == wide_string_same1); |
54 ASSERT_TRUE(wide_string_same1 == wide_string); | 76 EXPECT_TRUE(wide_string_same1 == wide_string); |
55 | 77 |
56 CFX_WideString wide_string_same2(wide_string); | 78 CFX_WideString wide_string_same2(wide_string); |
57 ASSERT_TRUE(wide_string == wide_string_same2); | 79 EXPECT_TRUE(wide_string == wide_string_same2); |
58 ASSERT_TRUE(wide_string_same2 == wide_string); | 80 EXPECT_TRUE(wide_string_same2 == wide_string); |
59 | 81 |
60 CFX_WideString wide_string1(L"he"); | 82 CFX_WideString wide_string1(L"he"); |
61 CFX_WideString wide_string2(L"hellp"); | 83 CFX_WideString wide_string2(L"hellp"); |
62 CFX_WideString wide_string3(L"hellod"); | 84 CFX_WideString wide_string3(L"hellod"); |
63 ASSERT_FALSE(wide_string == wide_string1); | 85 EXPECT_FALSE(wide_string == wide_string1); |
64 ASSERT_FALSE(wide_string == wide_string2); | 86 EXPECT_FALSE(wide_string == wide_string2); |
65 ASSERT_FALSE(wide_string == wide_string3); | 87 EXPECT_FALSE(wide_string == wide_string3); |
66 ASSERT_FALSE(wide_string1 == wide_string); | 88 EXPECT_FALSE(wide_string1 == wide_string); |
67 ASSERT_FALSE(wide_string2 == wide_string); | 89 EXPECT_FALSE(wide_string2 == wide_string); |
68 ASSERT_FALSE(wide_string3 == wide_string); | 90 EXPECT_FALSE(wide_string3 == wide_string); |
| 91 |
| 92 CFX_WideStringC null_string_c; |
| 93 CFX_WideStringC empty_string_c(L""); |
| 94 EXPECT_TRUE(null_string == null_string_c); |
| 95 EXPECT_TRUE(null_string == empty_string_c); |
| 96 EXPECT_TRUE(empty_string == null_string_c); |
| 97 EXPECT_TRUE(empty_string == empty_string_c); |
| 98 EXPECT_TRUE(deleted_string == null_string_c); |
| 99 EXPECT_TRUE(deleted_string == empty_string_c); |
| 100 EXPECT_TRUE(null_string_c == null_string); |
| 101 EXPECT_TRUE(empty_string_c == null_string); |
| 102 EXPECT_TRUE(null_string_c == empty_string); |
| 103 EXPECT_TRUE(empty_string_c == empty_string); |
| 104 EXPECT_TRUE(null_string_c == deleted_string); |
| 105 EXPECT_TRUE(empty_string_c == deleted_string); |
69 | 106 |
70 CFX_WideStringC wide_string_c_same1(L"hello"); | 107 CFX_WideStringC wide_string_c_same1(L"hello"); |
71 ASSERT_TRUE(wide_string == wide_string_c_same1); | 108 EXPECT_TRUE(wide_string == wide_string_c_same1); |
72 ASSERT_TRUE(wide_string_c_same1 == wide_string); | 109 EXPECT_TRUE(wide_string_c_same1 == wide_string); |
73 | 110 |
74 CFX_WideStringC wide_string_c1(L"he"); | 111 CFX_WideStringC wide_string_c1(L"he"); |
75 CFX_WideStringC wide_string_c2(L"hellp"); | 112 CFX_WideStringC wide_string_c2(L"hellp"); |
76 CFX_WideStringC wide_string_c3(L"hellod"); | 113 CFX_WideStringC wide_string_c3(L"hellod"); |
77 ASSERT_FALSE(wide_string == wide_string_c1); | 114 EXPECT_FALSE(wide_string == wide_string_c1); |
78 ASSERT_FALSE(wide_string == wide_string_c2); | 115 EXPECT_FALSE(wide_string == wide_string_c2); |
79 ASSERT_FALSE(wide_string == wide_string_c3); | 116 EXPECT_FALSE(wide_string == wide_string_c3); |
80 ASSERT_FALSE(wide_string_c1 == wide_string); | 117 EXPECT_FALSE(wide_string_c1 == wide_string); |
81 ASSERT_FALSE(wide_string_c2 == wide_string); | 118 EXPECT_FALSE(wide_string_c2 == wide_string); |
82 ASSERT_FALSE(wide_string_c3 == wide_string); | 119 EXPECT_FALSE(wide_string_c3 == wide_string); |
| 120 |
| 121 const wchar_t* c_null_string = nullptr; |
| 122 const wchar_t* c_empty_string = L""; |
| 123 EXPECT_TRUE(null_string == c_null_string); |
| 124 EXPECT_TRUE(null_string == c_empty_string); |
| 125 EXPECT_TRUE(empty_string == c_null_string); |
| 126 EXPECT_TRUE(empty_string == c_empty_string); |
| 127 EXPECT_TRUE(deleted_string == c_null_string); |
| 128 EXPECT_TRUE(deleted_string == c_empty_string); |
| 129 EXPECT_TRUE(c_null_string == null_string); |
| 130 EXPECT_TRUE(c_empty_string == null_string); |
| 131 EXPECT_TRUE(c_null_string == empty_string); |
| 132 EXPECT_TRUE(c_empty_string == empty_string); |
| 133 EXPECT_TRUE(c_null_string == deleted_string); |
| 134 EXPECT_TRUE(c_empty_string == deleted_string); |
83 | 135 |
84 const wchar_t* c_string_same1 = L"hello"; | 136 const wchar_t* c_string_same1 = L"hello"; |
85 ASSERT_TRUE(wide_string == c_string_same1); | 137 EXPECT_TRUE(wide_string == c_string_same1); |
86 ASSERT_TRUE(c_string_same1 == wide_string); | 138 EXPECT_TRUE(c_string_same1 == wide_string); |
87 | 139 |
88 const wchar_t* c_string1 = L"he"; | 140 const wchar_t* c_string1 = L"he"; |
89 const wchar_t* c_string2 = L"hellp"; | 141 const wchar_t* c_string2 = L"hellp"; |
90 const wchar_t* c_string3 = L"hellod"; | 142 const wchar_t* c_string3 = L"hellod"; |
91 ASSERT_FALSE(wide_string == c_string1); | 143 EXPECT_FALSE(wide_string == c_string1); |
92 ASSERT_FALSE(wide_string == c_string2); | 144 EXPECT_FALSE(wide_string == c_string2); |
93 ASSERT_FALSE(wide_string == c_string3); | 145 EXPECT_FALSE(wide_string == c_string3); |
94 ASSERT_FALSE(c_string1 == wide_string); | 146 EXPECT_FALSE(c_string1 == wide_string); |
95 ASSERT_FALSE(c_string2 == wide_string); | 147 EXPECT_FALSE(c_string2 == wide_string); |
96 ASSERT_FALSE(c_string3 == wide_string); | 148 EXPECT_FALSE(c_string3 == wide_string); |
97 } | 149 } |
98 | 150 |
99 TEST(fxcrt, WideStringOperatorNE) { | 151 TEST(fxcrt, WideStringOperatorNE) { |
| 152 CFX_WideString null_string; |
| 153 EXPECT_FALSE(null_string != null_string); |
| 154 |
| 155 CFX_WideString empty_string(L""); |
| 156 EXPECT_FALSE(empty_string != empty_string); |
| 157 EXPECT_FALSE(empty_string != null_string); |
| 158 EXPECT_FALSE(null_string != empty_string); |
| 159 |
| 160 CFX_WideString deleted_string(L"hello"); |
| 161 deleted_string.Delete(0, 5); |
| 162 EXPECT_FALSE(deleted_string != deleted_string); |
| 163 EXPECT_FALSE(deleted_string != null_string); |
| 164 EXPECT_FALSE(deleted_string != empty_string); |
| 165 EXPECT_FALSE(null_string != deleted_string); |
| 166 EXPECT_FALSE(null_string != empty_string); |
| 167 |
100 CFX_WideString wide_string(L"hello"); | 168 CFX_WideString wide_string(L"hello"); |
101 ASSERT_FALSE(wide_string != wide_string); | 169 EXPECT_FALSE(wide_string != wide_string); |
| 170 EXPECT_TRUE(wide_string != null_string); |
| 171 EXPECT_TRUE(wide_string != empty_string); |
| 172 EXPECT_TRUE(wide_string != deleted_string); |
| 173 EXPECT_TRUE(null_string != wide_string); |
| 174 EXPECT_TRUE(empty_string != wide_string); |
| 175 EXPECT_TRUE(deleted_string != wide_string); |
102 | 176 |
103 CFX_WideString wide_string_same1(L"hello"); | 177 CFX_WideString wide_string_same1(L"hello"); |
104 ASSERT_FALSE(wide_string != wide_string_same1); | 178 EXPECT_FALSE(wide_string != wide_string_same1); |
105 ASSERT_FALSE(wide_string_same1 != wide_string); | 179 EXPECT_FALSE(wide_string_same1 != wide_string); |
106 | 180 |
107 CFX_WideString wide_string_same2(wide_string); | 181 CFX_WideString wide_string_same2(wide_string); |
108 ASSERT_FALSE(wide_string != wide_string_same2); | 182 EXPECT_FALSE(wide_string != wide_string_same2); |
109 ASSERT_FALSE(wide_string_same2 != wide_string); | 183 EXPECT_FALSE(wide_string_same2 != wide_string); |
110 | 184 |
111 CFX_WideString wide_string1(L"he"); | 185 CFX_WideString wide_string1(L"he"); |
112 CFX_WideString wide_string2(L"hellp"); | 186 CFX_WideString wide_string2(L"hellp"); |
113 CFX_WideString wide_string3(L"hellod"); | 187 CFX_WideString wide_string3(L"hellod"); |
114 ASSERT_TRUE(wide_string != wide_string1); | 188 EXPECT_TRUE(wide_string != wide_string1); |
115 ASSERT_TRUE(wide_string != wide_string2); | 189 EXPECT_TRUE(wide_string != wide_string2); |
116 ASSERT_TRUE(wide_string != wide_string3); | 190 EXPECT_TRUE(wide_string != wide_string3); |
117 ASSERT_TRUE(wide_string1 != wide_string); | 191 EXPECT_TRUE(wide_string1 != wide_string); |
118 ASSERT_TRUE(wide_string2 != wide_string); | 192 EXPECT_TRUE(wide_string2 != wide_string); |
119 ASSERT_TRUE(wide_string3 != wide_string); | 193 EXPECT_TRUE(wide_string3 != wide_string); |
| 194 |
| 195 CFX_WideStringC null_string_c; |
| 196 CFX_WideStringC empty_string_c(L""); |
| 197 EXPECT_FALSE(null_string != null_string_c); |
| 198 EXPECT_FALSE(null_string != empty_string_c); |
| 199 EXPECT_FALSE(empty_string != null_string_c); |
| 200 EXPECT_FALSE(empty_string != empty_string_c); |
| 201 EXPECT_FALSE(deleted_string != null_string_c); |
| 202 EXPECT_FALSE(deleted_string != empty_string_c); |
| 203 EXPECT_FALSE(null_string_c != null_string); |
| 204 EXPECT_FALSE(empty_string_c != null_string); |
| 205 EXPECT_FALSE(null_string_c != empty_string); |
| 206 EXPECT_FALSE(empty_string_c != empty_string); |
120 | 207 |
121 CFX_WideStringC wide_string_c_same1(L"hello"); | 208 CFX_WideStringC wide_string_c_same1(L"hello"); |
122 ASSERT_FALSE(wide_string != wide_string_c_same1); | 209 EXPECT_FALSE(wide_string != wide_string_c_same1); |
123 ASSERT_FALSE(wide_string_c_same1 != wide_string); | 210 EXPECT_FALSE(wide_string_c_same1 != wide_string); |
124 | 211 |
125 CFX_WideStringC wide_string_c1(L"he"); | 212 CFX_WideStringC wide_string_c1(L"he"); |
126 CFX_WideStringC wide_string_c2(L"hellp"); | 213 CFX_WideStringC wide_string_c2(L"hellp"); |
127 CFX_WideStringC wide_string_c3(L"hellod"); | 214 CFX_WideStringC wide_string_c3(L"hellod"); |
128 ASSERT_TRUE(wide_string != wide_string_c1); | 215 EXPECT_TRUE(wide_string != wide_string_c1); |
129 ASSERT_TRUE(wide_string != wide_string_c2); | 216 EXPECT_TRUE(wide_string != wide_string_c2); |
130 ASSERT_TRUE(wide_string != wide_string_c3); | 217 EXPECT_TRUE(wide_string != wide_string_c3); |
131 ASSERT_TRUE(wide_string_c1 != wide_string); | 218 EXPECT_TRUE(wide_string_c1 != wide_string); |
132 ASSERT_TRUE(wide_string_c2 != wide_string); | 219 EXPECT_TRUE(wide_string_c2 != wide_string); |
133 ASSERT_TRUE(wide_string_c3 != wide_string); | 220 EXPECT_TRUE(wide_string_c3 != wide_string); |
| 221 |
| 222 const wchar_t* c_null_string = nullptr; |
| 223 const wchar_t* c_empty_string = L""; |
| 224 EXPECT_FALSE(null_string != c_null_string); |
| 225 EXPECT_FALSE(null_string != c_empty_string); |
| 226 EXPECT_FALSE(empty_string != c_null_string); |
| 227 EXPECT_FALSE(empty_string != c_empty_string); |
| 228 EXPECT_FALSE(deleted_string != c_null_string); |
| 229 EXPECT_FALSE(deleted_string != c_empty_string); |
| 230 EXPECT_FALSE(c_null_string != null_string); |
| 231 EXPECT_FALSE(c_empty_string != null_string); |
| 232 EXPECT_FALSE(c_null_string != empty_string); |
| 233 EXPECT_FALSE(c_empty_string != empty_string); |
| 234 EXPECT_FALSE(c_null_string != deleted_string); |
| 235 EXPECT_FALSE(c_empty_string != deleted_string); |
134 | 236 |
135 const wchar_t* c_string_same1 = L"hello"; | 237 const wchar_t* c_string_same1 = L"hello"; |
136 ASSERT_FALSE(wide_string != c_string_same1); | 238 EXPECT_FALSE(wide_string != c_string_same1); |
137 ASSERT_FALSE(c_string_same1 != wide_string); | 239 EXPECT_FALSE(c_string_same1 != wide_string); |
138 | 240 |
139 const wchar_t* c_string1 = L"he"; | 241 const wchar_t* c_string1 = L"he"; |
140 const wchar_t* c_string2 = L"hellp"; | 242 const wchar_t* c_string2 = L"hellp"; |
141 const wchar_t* c_string3 = L"hellod"; | 243 const wchar_t* c_string3 = L"hellod"; |
142 ASSERT_TRUE(wide_string != c_string1); | 244 EXPECT_TRUE(wide_string != c_string1); |
143 ASSERT_TRUE(wide_string != c_string2); | 245 EXPECT_TRUE(wide_string != c_string2); |
144 ASSERT_TRUE(wide_string != c_string3); | 246 EXPECT_TRUE(wide_string != c_string3); |
145 | 247 EXPECT_TRUE(c_string1 != wide_string); |
146 ASSERT_TRUE(c_string1 != wide_string); | 248 EXPECT_TRUE(c_string2 != wide_string); |
147 ASSERT_TRUE(c_string2 != wide_string); | 249 EXPECT_TRUE(c_string3 != wide_string); |
148 ASSERT_TRUE(c_string3 != wide_string); | |
149 } | 250 } |
150 | 251 |
151 #define ByteStringLiteral(str) CFX_ByteString(FX_BSTRC(str)) | 252 #define ByteStringLiteral(str) CFX_ByteString(FX_BSTRC(str)) |
152 | 253 |
153 TEST(fxcrt, WideStringUTF16LE_Encode) { | 254 TEST(fxcrt, WideStringUTF16LE_Encode) { |
154 struct UTF16LEEncodeCase { | 255 struct UTF16LEEncodeCase { |
155 CFX_WideString ws; | 256 CFX_WideString ws; |
156 CFX_ByteString bs; | 257 CFX_ByteString bs; |
157 } utf16le_encode_cases[] = { | 258 } utf16le_encode_cases[] = { |
158 { L"", ByteStringLiteral("\0\0") }, | 259 { L"", ByteStringLiteral("\0\0") }, |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 | 305 |
205 EXPECT_TRUE(a < def); | 306 EXPECT_TRUE(a < def); |
206 EXPECT_FALSE(def < a); | 307 EXPECT_FALSE(def < a); |
207 | 308 |
208 EXPECT_TRUE(abc < def); | 309 EXPECT_TRUE(abc < def); |
209 EXPECT_FALSE(def < abc); | 310 EXPECT_FALSE(def < abc); |
210 } | 311 } |
211 | 312 |
212 TEST(fxcrt, WideStringCOperatorEQ) { | 313 TEST(fxcrt, WideStringCOperatorEQ) { |
213 CFX_WideStringC wide_string_c(L"hello"); | 314 CFX_WideStringC wide_string_c(L"hello"); |
214 ASSERT_TRUE(wide_string_c == wide_string_c); | 315 EXPECT_TRUE(wide_string_c == wide_string_c); |
215 | 316 |
216 CFX_WideStringC wide_string_c_same1(L"hello"); | 317 CFX_WideStringC wide_string_c_same1(L"hello"); |
217 ASSERT_TRUE(wide_string_c == wide_string_c_same1); | 318 EXPECT_TRUE(wide_string_c == wide_string_c_same1); |
218 ASSERT_TRUE(wide_string_c_same1 == wide_string_c); | 319 EXPECT_TRUE(wide_string_c_same1 == wide_string_c); |
219 | 320 |
220 CFX_WideStringC wide_string_c_same2(wide_string_c); | 321 CFX_WideStringC wide_string_c_same2(wide_string_c); |
221 ASSERT_TRUE(wide_string_c == wide_string_c_same2); | 322 EXPECT_TRUE(wide_string_c == wide_string_c_same2); |
222 ASSERT_TRUE(wide_string_c_same2 == wide_string_c); | 323 EXPECT_TRUE(wide_string_c_same2 == wide_string_c); |
223 | 324 |
224 CFX_WideStringC wide_string_c1(L"he"); | 325 CFX_WideStringC wide_string_c1(L"he"); |
225 CFX_WideStringC wide_string_c2(L"hellp"); | 326 CFX_WideStringC wide_string_c2(L"hellp"); |
226 CFX_WideStringC wide_string_c3(L"hellod"); | 327 CFX_WideStringC wide_string_c3(L"hellod"); |
227 ASSERT_FALSE(wide_string_c == wide_string_c1); | 328 EXPECT_FALSE(wide_string_c == wide_string_c1); |
228 ASSERT_FALSE(wide_string_c == wide_string_c2); | 329 EXPECT_FALSE(wide_string_c == wide_string_c2); |
229 ASSERT_FALSE(wide_string_c == wide_string_c3); | 330 EXPECT_FALSE(wide_string_c == wide_string_c3); |
230 ASSERT_FALSE(wide_string_c1 == wide_string_c); | 331 EXPECT_FALSE(wide_string_c1 == wide_string_c); |
231 ASSERT_FALSE(wide_string_c2 == wide_string_c); | 332 EXPECT_FALSE(wide_string_c2 == wide_string_c); |
232 ASSERT_FALSE(wide_string_c3 == wide_string_c); | 333 EXPECT_FALSE(wide_string_c3 == wide_string_c); |
233 | 334 |
234 CFX_WideString wide_string_same1(L"hello"); | 335 CFX_WideString wide_string_same1(L"hello"); |
235 ASSERT_TRUE(wide_string_c == wide_string_same1); | 336 EXPECT_TRUE(wide_string_c == wide_string_same1); |
236 ASSERT_TRUE(wide_string_same1 == wide_string_c); | 337 EXPECT_TRUE(wide_string_same1 == wide_string_c); |
237 | 338 |
238 CFX_WideString wide_string1(L"he"); | 339 CFX_WideString wide_string1(L"he"); |
239 CFX_WideString wide_string2(L"hellp"); | 340 CFX_WideString wide_string2(L"hellp"); |
240 CFX_WideString wide_string3(L"hellod"); | 341 CFX_WideString wide_string3(L"hellod"); |
241 ASSERT_FALSE(wide_string_c == wide_string1); | 342 EXPECT_FALSE(wide_string_c == wide_string1); |
242 ASSERT_FALSE(wide_string_c == wide_string2); | 343 EXPECT_FALSE(wide_string_c == wide_string2); |
243 ASSERT_FALSE(wide_string_c == wide_string3); | 344 EXPECT_FALSE(wide_string_c == wide_string3); |
244 ASSERT_FALSE(wide_string1 == wide_string_c); | 345 EXPECT_FALSE(wide_string1 == wide_string_c); |
245 ASSERT_FALSE(wide_string2 == wide_string_c); | 346 EXPECT_FALSE(wide_string2 == wide_string_c); |
246 ASSERT_FALSE(wide_string3 == wide_string_c); | 347 EXPECT_FALSE(wide_string3 == wide_string_c); |
247 | 348 |
248 const wchar_t* c_string_same1 = L"hello"; | 349 const wchar_t* c_string_same1 = L"hello"; |
249 ASSERT_TRUE(wide_string_c == c_string_same1); | 350 EXPECT_TRUE(wide_string_c == c_string_same1); |
250 ASSERT_TRUE(c_string_same1 == wide_string_c); | 351 EXPECT_TRUE(c_string_same1 == wide_string_c); |
251 | 352 |
252 const wchar_t* c_string1 = L"he"; | 353 const wchar_t* c_string1 = L"he"; |
253 const wchar_t* c_string2 = L"hellp"; | 354 const wchar_t* c_string2 = L"hellp"; |
254 const wchar_t* c_string3 = L"hellod"; | 355 const wchar_t* c_string3 = L"hellod"; |
255 ASSERT_FALSE(wide_string_c == c_string1); | 356 EXPECT_FALSE(wide_string_c == c_string1); |
256 ASSERT_FALSE(wide_string_c == c_string2); | 357 EXPECT_FALSE(wide_string_c == c_string2); |
257 ASSERT_FALSE(wide_string_c == c_string3); | 358 EXPECT_FALSE(wide_string_c == c_string3); |
258 | 359 |
259 ASSERT_FALSE(c_string1 == wide_string_c); | 360 EXPECT_FALSE(c_string1 == wide_string_c); |
260 ASSERT_FALSE(c_string2 == wide_string_c); | 361 EXPECT_FALSE(c_string2 == wide_string_c); |
261 ASSERT_FALSE(c_string3 == wide_string_c); | 362 EXPECT_FALSE(c_string3 == wide_string_c); |
262 } | 363 } |
263 | 364 |
264 TEST(fxcrt, WideStringCOperatorNE) { | 365 TEST(fxcrt, WideStringCOperatorNE) { |
265 CFX_WideStringC wide_string_c(L"hello"); | 366 CFX_WideStringC wide_string_c(L"hello"); |
266 ASSERT_FALSE(wide_string_c != wide_string_c); | 367 EXPECT_FALSE(wide_string_c != wide_string_c); |
267 | 368 |
268 CFX_WideStringC wide_string_c_same1(L"hello"); | 369 CFX_WideStringC wide_string_c_same1(L"hello"); |
269 ASSERT_FALSE(wide_string_c != wide_string_c_same1); | 370 EXPECT_FALSE(wide_string_c != wide_string_c_same1); |
270 ASSERT_FALSE(wide_string_c_same1 != wide_string_c); | 371 EXPECT_FALSE(wide_string_c_same1 != wide_string_c); |
271 | 372 |
272 CFX_WideStringC wide_string_c_same2(wide_string_c); | 373 CFX_WideStringC wide_string_c_same2(wide_string_c); |
273 ASSERT_FALSE(wide_string_c != wide_string_c_same2); | 374 EXPECT_FALSE(wide_string_c != wide_string_c_same2); |
274 ASSERT_FALSE(wide_string_c_same2 != wide_string_c); | 375 EXPECT_FALSE(wide_string_c_same2 != wide_string_c); |
275 | 376 |
276 CFX_WideStringC wide_string_c1(L"he"); | 377 CFX_WideStringC wide_string_c1(L"he"); |
277 CFX_WideStringC wide_string_c2(L"hellp"); | 378 CFX_WideStringC wide_string_c2(L"hellp"); |
278 CFX_WideStringC wide_string_c3(L"hellod"); | 379 CFX_WideStringC wide_string_c3(L"hellod"); |
279 ASSERT_TRUE(wide_string_c != wide_string_c1); | 380 EXPECT_TRUE(wide_string_c != wide_string_c1); |
280 ASSERT_TRUE(wide_string_c != wide_string_c2); | 381 EXPECT_TRUE(wide_string_c != wide_string_c2); |
281 ASSERT_TRUE(wide_string_c != wide_string_c3); | 382 EXPECT_TRUE(wide_string_c != wide_string_c3); |
282 ASSERT_TRUE(wide_string_c1 != wide_string_c); | 383 EXPECT_TRUE(wide_string_c1 != wide_string_c); |
283 ASSERT_TRUE(wide_string_c2 != wide_string_c); | 384 EXPECT_TRUE(wide_string_c2 != wide_string_c); |
284 ASSERT_TRUE(wide_string_c3 != wide_string_c); | 385 EXPECT_TRUE(wide_string_c3 != wide_string_c); |
285 | 386 |
286 CFX_WideString wide_string_same1(L"hello"); | 387 CFX_WideString wide_string_same1(L"hello"); |
287 ASSERT_FALSE(wide_string_c != wide_string_same1); | 388 EXPECT_FALSE(wide_string_c != wide_string_same1); |
288 ASSERT_FALSE(wide_string_same1 != wide_string_c); | 389 EXPECT_FALSE(wide_string_same1 != wide_string_c); |
289 | 390 |
290 CFX_WideString wide_string1(L"he"); | 391 CFX_WideString wide_string1(L"he"); |
291 CFX_WideString wide_string2(L"hellp"); | 392 CFX_WideString wide_string2(L"hellp"); |
292 CFX_WideString wide_string3(L"hellod"); | 393 CFX_WideString wide_string3(L"hellod"); |
293 ASSERT_TRUE(wide_string_c != wide_string1); | 394 EXPECT_TRUE(wide_string_c != wide_string1); |
294 ASSERT_TRUE(wide_string_c != wide_string2); | 395 EXPECT_TRUE(wide_string_c != wide_string2); |
295 ASSERT_TRUE(wide_string_c != wide_string3); | 396 EXPECT_TRUE(wide_string_c != wide_string3); |
296 ASSERT_TRUE(wide_string1 != wide_string_c); | 397 EXPECT_TRUE(wide_string1 != wide_string_c); |
297 ASSERT_TRUE(wide_string2 != wide_string_c); | 398 EXPECT_TRUE(wide_string2 != wide_string_c); |
298 ASSERT_TRUE(wide_string3 != wide_string_c); | 399 EXPECT_TRUE(wide_string3 != wide_string_c); |
299 | 400 |
300 const wchar_t* c_string_same1 = L"hello"; | 401 const wchar_t* c_string_same1 = L"hello"; |
301 ASSERT_FALSE(wide_string_c != c_string_same1); | 402 EXPECT_FALSE(wide_string_c != c_string_same1); |
302 ASSERT_FALSE(c_string_same1 != wide_string_c); | 403 EXPECT_FALSE(c_string_same1 != wide_string_c); |
303 | 404 |
304 const wchar_t* c_string1 = L"he"; | 405 const wchar_t* c_string1 = L"he"; |
305 const wchar_t* c_string2 = L"hellp"; | 406 const wchar_t* c_string2 = L"hellp"; |
306 const wchar_t* c_string3 = L"hellod"; | 407 const wchar_t* c_string3 = L"hellod"; |
307 ASSERT_TRUE(wide_string_c != c_string1); | 408 EXPECT_TRUE(wide_string_c != c_string1); |
308 ASSERT_TRUE(wide_string_c != c_string2); | 409 EXPECT_TRUE(wide_string_c != c_string2); |
309 ASSERT_TRUE(wide_string_c != c_string3); | 410 EXPECT_TRUE(wide_string_c != c_string3); |
310 | 411 |
311 ASSERT_TRUE(c_string1 != wide_string_c); | 412 EXPECT_TRUE(c_string1 != wide_string_c); |
312 ASSERT_TRUE(c_string2 != wide_string_c); | 413 EXPECT_TRUE(c_string2 != wide_string_c); |
313 ASSERT_TRUE(c_string3 != wide_string_c); | 414 EXPECT_TRUE(c_string3 != wide_string_c); |
314 } | 415 } |
OLD | NEW |