| 588 | } |
| 589 | |
| 590 | void TConversionTest::TestGetNumOfUTF8Chars() { |
| 591 | size_t n = 0; |
| 592 | bool result = GetNumberOfUTF8Chars(Utf8Text_.c_str(), Utf8Text_.size(), n); |
| 593 | UNIT_ASSERT(result); |
| 594 | UNIT_ASSERT(n == 256); |
| 595 | |
| 596 | n = 0; |
| 597 | result = GetNumberOfUTF8Chars(utext, 5, n); |
| 598 | UNIT_ASSERT(!result); |
| 599 | UNIT_ASSERT(n == 2); |
| 600 | |
| 601 | n = 0; |
| 602 | result = GetNumberOfUTF8Chars(utext, 1, n); |
| 603 | UNIT_ASSERT(!result); |
| 604 | UNIT_ASSERT(n == 0); |
| 605 | |
| 606 | UNIT_ASSERT_EQUAL(GetNumberOfUTF8Chars("привет!"), 7); |
| 607 | } |
| 608 | |
| 609 | void TConversionTest::TestSubstrUTF8() { |
| 610 | TStringBuf utextBuf(utext, sizeof(utext)); |
nothing calls this directly
no test coverage detected