aboutsummaryrefslogtreecommitdiffstats
path: root/util/system/unaligned_mem_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <pg83@yandex.ru>2022-02-10 16:45:17 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:17 +0300
commitd3a398281c6fd1d3672036cb2d63f842d2cb28c5 (patch)
treedd4bd3ca0f36b817e96812825ffaf10d645803f2 /util/system/unaligned_mem_ut.cpp
parent72cb13b4aff9bc9cf22e49251bc8fd143f82538f (diff)
downloadydb-d3a398281c6fd1d3672036cb2d63f842d2cb28c5.tar.gz
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 2 of 2.
Diffstat (limited to 'util/system/unaligned_mem_ut.cpp')
-rw-r--r--util/system/unaligned_mem_ut.cpp16
1 files changed, 8 insertions, 8 deletions
diff --git a/util/system/unaligned_mem_ut.cpp b/util/system/unaligned_mem_ut.cpp
index d8c799d727..9de3f3e931 100644
--- a/util/system/unaligned_mem_ut.cpp
+++ b/util/system/unaligned_mem_ut.cpp
@@ -1,8 +1,8 @@
-#include "unaligned_mem.h"
-
+#include "unaligned_mem.h"
+
#include <library/cpp/testing/benchmark/bench.h>
#include <library/cpp/testing/unittest/registar.h>
-
+
#include <util/system/compiler.h>
#ifdef Y_HAVE_INT128
@@ -21,7 +21,7 @@ namespace {
}
static TUInt128 Max() {
- return {~(__uint128_t)0};
+ return {~(__uint128_t)0};
}
__uint128_t x;
@@ -32,15 +32,15 @@ namespace {
Y_UNIT_TEST_SUITE(UnalignedMem) {
Y_UNIT_TEST(TestReadWrite) {
alignas(ui64) char buf[100];
-
+
WriteUnaligned<ui16>(buf + 1, (ui16)1);
WriteUnaligned<ui32>(buf + 1 + 2, (ui32)2);
WriteUnaligned<ui64>(buf + 1 + 2 + 4, (ui64)3);
-
+
UNIT_ASSERT_VALUES_EQUAL(ReadUnaligned<ui16>(buf + 1), 1);
UNIT_ASSERT_VALUES_EQUAL(ReadUnaligned<ui32>(buf + 1 + 2), 2);
UNIT_ASSERT_VALUES_EQUAL(ReadUnaligned<ui64>(buf + 1 + 2 + 4), 3);
- }
+ }
Y_UNIT_TEST(TestReadWriteRuntime) {
// Unlike the test above, this test avoids compile-time execution by a smart compiler.
@@ -93,4 +93,4 @@ Y_UNIT_TEST_SUITE(UnalignedMem) {
UNIT_ASSERT(val == TUInt128::Max());
}
#endif
-}
+}