aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/charset/codepage_ut.cpp
diff options
context:
space:
mode:
authoralzobnin <alzobnin@yandex-team.ru>2022-02-10 16:46:50 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:46:50 +0300
commit5085152b94bf621933243a498def7f37d2e76b58 (patch)
tree49e222ea1c5804306084bb3ae065bb702625360f /library/cpp/charset/codepage_ut.cpp
parentc9317148cc3e9f1b0bc0ce95172f47e099f2c554 (diff)
downloadydb-5085152b94bf621933243a498def7f37d2e76b58.tar.gz
Restoring authorship annotation for <alzobnin@yandex-team.ru>. Commit 2 of 2.
Diffstat (limited to 'library/cpp/charset/codepage_ut.cpp')
-rw-r--r--library/cpp/charset/codepage_ut.cpp26
1 files changed, 13 insertions, 13 deletions
diff --git a/library/cpp/charset/codepage_ut.cpp b/library/cpp/charset/codepage_ut.cpp
index 7a16499996..c3ac3ac478 100644
--- a/library/cpp/charset/codepage_ut.cpp
+++ b/library/cpp/charset/codepage_ut.cpp
@@ -1,10 +1,10 @@
-#include "codepage.h"
-#include "recyr.hh"
+#include "codepage.h"
+#include "recyr.hh"
#include "wide.h"
#include <library/cpp/testing/unittest/registar.h>
-#include <util/charset/utf8.h>
+#include <util/charset/utf8.h>
#include <util/system/yassert.h>
#if defined(_MSC_VER)
@@ -76,7 +76,7 @@ public:
UNIT_TEST_SUITE_REGISTRATION(TCodepageTest);
void TCodepageTest::TestUTF() {
- for (wchar32 i = 0; i <= 0x10FFFF; i++) {
+ for (wchar32 i = 0; i <= 0x10FFFF; i++) {
unsigned char buffer[32];
Zero(buffer);
size_t rune_len;
@@ -91,32 +91,32 @@ void TCodepageTest::TestUTF() {
else
ref_len = 4;
- RECODE_RESULT res = SafeWriteUTF8Char(i, rune_len, buffer, buffer + 32);
+ RECODE_RESULT res = SafeWriteUTF8Char(i, rune_len, buffer, buffer + 32);
UNIT_ASSERT(res == RECODE_OK);
UNIT_ASSERT(rune_len == ref_len);
- res = SafeWriteUTF8Char(i, rune_len, buffer, buffer + ref_len - 1);
+ res = SafeWriteUTF8Char(i, rune_len, buffer, buffer + ref_len - 1);
UNIT_ASSERT(res == RECODE_EOOUTPUT);
wchar32 rune;
- res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + 32);
+ res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + 32);
UNIT_ASSERT(res == RECODE_OK);
UNIT_ASSERT(rune == i);
UNIT_ASSERT(rune_len == ref_len);
- res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len - 1);
+ res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len - 1);
UNIT_ASSERT(res == RECODE_EOINPUT);
if (ref_len > 1) {
- res = SafeReadUTF8Char(rune, rune_len, buffer + 1, buffer + ref_len);
+ res = SafeReadUTF8Char(rune, rune_len, buffer + 1, buffer + ref_len);
UNIT_ASSERT(res == RECODE_BROKENSYMBOL);
buffer[1] |= 0xC0;
- res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len);
+ res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len);
UNIT_ASSERT(res == RECODE_BROKENSYMBOL);
buffer[1] &= 0x3F;
- res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len);
+ res = SafeReadUTF8Char(rune, rune_len, buffer, buffer + ref_len);
UNIT_ASSERT(res == RECODE_BROKENSYMBOL);
}
}
@@ -124,7 +124,7 @@ void TCodepageTest::TestUTF() {
"\xfe",
"\xff",
"\xcc\xc0",
- "\xf4\x90\x80\x80",
+ "\xf4\x90\x80\x80",
//overlong:
"\xfe\xfe\xff\xff",
"\xc0\xaf",
@@ -155,7 +155,7 @@ void TCodepageTest::TestUTF() {
wchar32 rune;
const ui8* p = (const ui8*)badStrings[i];
size_t len;
- RECODE_RESULT res = SafeReadUTF8Char(rune, len, p, p + strlen(badStrings[i]));
+ RECODE_RESULT res = SafeReadUTF8Char(rune, len, p, p + strlen(badStrings[i]));
UNIT_ASSERT(res == RECODE_BROKENSYMBOL);
}
}