| 1363 | } |
| 1364 | |
| 1365 | void TestToUpperStr() { |
| 1366 | { |
| 1367 | TUtf16String s; |
| 1368 | auto writableCopy = s; |
| 1369 | const auto copy = s; |
| 1370 | const TUtf16String upper; |
| 1371 | |
| 1372 | UNIT_ASSERT(!ToUpper(s)); |
| 1373 | UNIT_ASSERT(s == upper); |
| 1374 | #ifndef TSTRING_IS_STD_STRING |
| 1375 | UNIT_ASSERT(s.data() == copy.data()); |
| 1376 | #endif |
| 1377 | |
| 1378 | UNIT_ASSERT(!ToUpper(writableCopy.Detach(), writableCopy.size())); |
| 1379 | UNIT_ASSERT(writableCopy == upper); |
| 1380 | |
| 1381 | UNIT_ASSERT(!ToUpper(copy.data(), copy.size(), writableCopy.Detach())); |
| 1382 | UNIT_ASSERT(writableCopy == upper); |
| 1383 | |
| 1384 | UNIT_ASSERT(ToUpperRet(copy) == upper); |
| 1385 | UNIT_ASSERT(ToUpperRet(TWtringBuf(copy)) == upper); |
| 1386 | } |
| 1387 | { |
| 1388 | auto s = UTF8ToWide(""); |
| 1389 | auto writableCopy = s; |
| 1390 | const auto copy = s; |
| 1391 | const TUtf16String upper; |
| 1392 | |
| 1393 | UNIT_ASSERT(!ToUpper(s)); |
| 1394 | UNIT_ASSERT(s == upper); |
| 1395 | #ifndef TSTRING_IS_STD_STRING |
| 1396 | UNIT_ASSERT(s.data() == copy.data()); |
| 1397 | #endif |
| 1398 | |
| 1399 | UNIT_ASSERT(!ToUpper(writableCopy.Detach(), writableCopy.size())); |
| 1400 | UNIT_ASSERT(writableCopy == upper); |
| 1401 | |
| 1402 | UNIT_ASSERT(!ToUpper(copy.data(), copy.size(), writableCopy.Detach())); |
| 1403 | UNIT_ASSERT(writableCopy == upper); |
| 1404 | |
| 1405 | UNIT_ASSERT(ToUpperRet(copy) == upper); |
| 1406 | UNIT_ASSERT(ToUpperRet(TWtringBuf(copy)) == upper); |
| 1407 | } |
| 1408 | { |
| 1409 | TUtf16String s; |
| 1410 | auto writableCopy = s; |
| 1411 | const auto copy = s; |
| 1412 | const TUtf16String upper; |
| 1413 | |
| 1414 | UNIT_ASSERT(!ToUpper(s, 100500)); |
| 1415 | UNIT_ASSERT(s == upper); |
| 1416 | #ifndef TSTRING_IS_STD_STRING |
| 1417 | UNIT_ASSERT(s.data() == copy.data()); |
| 1418 | #endif |
| 1419 | |
| 1420 | UNIT_ASSERT(!ToUpper(writableCopy.Detach(), writableCopy.size())); |
| 1421 | UNIT_ASSERT(writableCopy == upper); |
| 1422 |
nothing calls this directly
no test coverage detected