aboutsummaryrefslogtreecommitdiffstats
path: root/util/generic/string_ut.h
diff options
context:
space:
mode:
authorArslan Urtashev <urtashev@gmail.com>2022-02-10 16:48:55 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:48:55 +0300
commit1136f2ce7cce7bcc84e695272c0d92d4eb900c2b (patch)
tree5d5cb817648f650d76cf1076100726fd9b8448e8 /util/generic/string_ut.h
parentb97740540e7302cec9efa181e106ae1990a0cc1c (diff)
downloadydb-1136f2ce7cce7bcc84e695272c0d92d4eb900c2b.tar.gz
Restoring authorship annotation for Arslan Urtashev <urtashev@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/generic/string_ut.h')
-rw-r--r--util/generic/string_ut.h44
1 files changed, 22 insertions, 22 deletions
diff --git a/util/generic/string_ut.h b/util/generic/string_ut.h
index 99ce4999db..44bb10bdeb 100644
--- a/util/generic/string_ut.h
+++ b/util/generic/string_ut.h
@@ -997,37 +997,37 @@ public:
UNIT_ASSERT_EQUAL(str.StartsWith(emptyStr), true);
UNIT_ASSERT_EQUAL(str.EndsWith(emptyStr), true);
}
-
+
#ifndef TSTRING_IS_STD_STRING
- void TestCharRef() {
+ void TestCharRef() {
const char_type abc[] = {'a', 'b', 'c', 0};
const char_type bbc[] = {'b', 'b', 'c', 0};
const char_type cbc[] = {'c', 'b', 'c', 0};
-
+
TStringType s0 = abc;
TStringType s1 = s0;
-
- UNIT_ASSERT(!s0.IsDetached());
- UNIT_ASSERT(!s1.IsDetached());
-
- /* Read access shouldn't detach. */
+
+ UNIT_ASSERT(!s0.IsDetached());
+ UNIT_ASSERT(!s1.IsDetached());
+
+ /* Read access shouldn't detach. */
UNIT_ASSERT_VALUES_EQUAL(s0[0], (ui8)'a');
- UNIT_ASSERT(!s0.IsDetached());
- UNIT_ASSERT(!s1.IsDetached());
-
- /* Writing should detach. */
+ UNIT_ASSERT(!s0.IsDetached());
+ UNIT_ASSERT(!s1.IsDetached());
+
+ /* Writing should detach. */
s1[0] = (ui8)'b';
TStringType s2 = s0;
s0[0] = (ui8)'c';
-
- UNIT_ASSERT_VALUES_EQUAL(s0, cbc);
- UNIT_ASSERT_VALUES_EQUAL(s1, bbc);
- UNIT_ASSERT_VALUES_EQUAL(s2, abc);
- UNIT_ASSERT(s0.IsDetached());
- UNIT_ASSERT(s1.IsDetached());
- UNIT_ASSERT(s2.IsDetached());
-
- /* Accessing null terminator is OK. Note that writing into it is UB. */
+
+ UNIT_ASSERT_VALUES_EQUAL(s0, cbc);
+ UNIT_ASSERT_VALUES_EQUAL(s1, bbc);
+ UNIT_ASSERT_VALUES_EQUAL(s2, abc);
+ UNIT_ASSERT(s0.IsDetached());
+ UNIT_ASSERT(s1.IsDetached());
+ UNIT_ASSERT(s2.IsDetached());
+
+ /* Accessing null terminator is OK. Note that writing into it is UB. */
UNIT_ASSERT_VALUES_EQUAL(s0[3], (ui8)'\0');
UNIT_ASSERT_VALUES_EQUAL(s1[3], (ui8)'\0');
UNIT_ASSERT_VALUES_EQUAL(s2[3], (ui8)'\0');
@@ -1044,7 +1044,7 @@ public:
}
UNIT_ASSERT_VALUES_EQUAL(s1, red_eared);
}
- }
+ }
#endif
void TestBack() {