summaryrefslogtreecommitdiffstats
path: root/util/system/hi_lo_ut.cpp
diff options
context:
space:
mode:
authorAnton Samokhvalov <[email protected]>2022-02-10 16:45:15 +0300
committerDaniil Cherednik <[email protected]>2022-02-10 16:45:15 +0300
commit72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch)
treeda2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /util/system/hi_lo_ut.cpp
parent778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff)
Restoring authorship annotation for Anton Samokhvalov <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'util/system/hi_lo_ut.cpp')
-rw-r--r--util/system/hi_lo_ut.cpp98
1 files changed, 49 insertions, 49 deletions
diff --git a/util/system/hi_lo_ut.cpp b/util/system/hi_lo_ut.cpp
index 850c12327db..a62f228a5ce 100644
--- a/util/system/hi_lo_ut.cpp
+++ b/util/system/hi_lo_ut.cpp
@@ -5,65 +5,65 @@
#include "defaults.h"
Y_UNIT_TEST_SUITE(HiLo) {
- Y_UNIT_TEST(HiLo32) {
- ui64 x = 0;
- Lo32(x) = 18;
- UNIT_ASSERT_VALUES_EQUAL(x, 18);
+ Y_UNIT_TEST(HiLo32) {
+ ui64 x = 0;
+ Lo32(x) = 18;
+ UNIT_ASSERT_VALUES_EQUAL(x, 18);
- Hi32(x) = 33;
- UNIT_ASSERT_VALUES_EQUAL(x, 141733920786);
+ Hi32(x) = 33;
+ UNIT_ASSERT_VALUES_EQUAL(x, 141733920786);
- const ui64 y = 0x33c06196e94c03ab;
- UNIT_ASSERT_VALUES_EQUAL(Lo32(y).Get(), 0xe94c03ab);
- UNIT_ASSERT_VALUES_EQUAL(Hi32(y).Get(), 0x33c06196);
- }
+ const ui64 y = 0x33c06196e94c03ab;
+ UNIT_ASSERT_VALUES_EQUAL(Lo32(y).Get(), 0xe94c03ab);
+ UNIT_ASSERT_VALUES_EQUAL(Hi32(y).Get(), 0x33c06196);
+ }
- Y_UNIT_TEST(HiLo16) {
- ui32 x = 0;
- Lo16(x) = 18;
- UNIT_ASSERT_VALUES_EQUAL(x, 18);
+ Y_UNIT_TEST(HiLo16) {
+ ui32 x = 0;
+ Lo16(x) = 18;
+ UNIT_ASSERT_VALUES_EQUAL(x, 18);
- Hi16(x) = 33;
- UNIT_ASSERT_VALUES_EQUAL(x, 2162706);
+ Hi16(x) = 33;
+ UNIT_ASSERT_VALUES_EQUAL(x, 2162706);
- const ui32 y = 0xe94c03ab;
- UNIT_ASSERT_VALUES_EQUAL(Lo16(y).Get(), 0x03ab);
- UNIT_ASSERT_VALUES_EQUAL(Hi16(y).Get(), 0xe94c);
- }
+ const ui32 y = 0xe94c03ab;
+ UNIT_ASSERT_VALUES_EQUAL(Lo16(y).Get(), 0x03ab);
+ UNIT_ASSERT_VALUES_EQUAL(Hi16(y).Get(), 0xe94c);
+ }
- Y_UNIT_TEST(HiLo8) {
- ui16 x = 0;
- Lo8(x) = 18;
- UNIT_ASSERT_VALUES_EQUAL(x, 18);
+ Y_UNIT_TEST(HiLo8) {
+ ui16 x = 0;
+ Lo8(x) = 18;
+ UNIT_ASSERT_VALUES_EQUAL(x, 18);
- Hi8(x) = 33;
- UNIT_ASSERT_VALUES_EQUAL(x, 8466);
+ Hi8(x) = 33;
+ UNIT_ASSERT_VALUES_EQUAL(x, 8466);
- const ui16 y = 0x03ab;
- UNIT_ASSERT_VALUES_EQUAL(Lo8(y).Get(), 0xab);
- UNIT_ASSERT_VALUES_EQUAL(Hi8(y).Get(), 0x03);
- }
+ const ui16 y = 0x03ab;
+ UNIT_ASSERT_VALUES_EQUAL(Lo8(y).Get(), 0xab);
+ UNIT_ASSERT_VALUES_EQUAL(Hi8(y).Get(), 0x03);
+ }
- Y_UNIT_TEST(Combined) {
- ui32 x = 0;
- Lo8(Lo16(x)) = 18;
- UNIT_ASSERT_VALUES_EQUAL(x, 18);
+ Y_UNIT_TEST(Combined) {
+ ui32 x = 0;
+ Lo8(Lo16(x)) = 18;
+ UNIT_ASSERT_VALUES_EQUAL(x, 18);
- Hi8(Lo16(x)) = 33;
- UNIT_ASSERT_VALUES_EQUAL(x, 8466);
+ Hi8(Lo16(x)) = 33;
+ UNIT_ASSERT_VALUES_EQUAL(x, 8466);
- const ui32 y = 0xe94c03ab;
- UNIT_ASSERT_VALUES_EQUAL(Lo8(Lo16(y)).Get(), 0xab);
- UNIT_ASSERT_VALUES_EQUAL(Hi8(Lo16(y)).Get(), 0x03);
- }
+ const ui32 y = 0xe94c03ab;
+ UNIT_ASSERT_VALUES_EQUAL(Lo8(Lo16(y)).Get(), 0xab);
+ UNIT_ASSERT_VALUES_EQUAL(Hi8(Lo16(y)).Get(), 0x03);
+ }
- Y_UNIT_TEST(NarrowFromWide) {
- const ui64 x = 0x1122334455667788ull;
- UNIT_ASSERT_VALUES_EQUAL(Lo8(x).Get(), 0x88);
- UNIT_ASSERT_VALUES_EQUAL(Hi8(x).Get(), 0x11);
- UNIT_ASSERT_VALUES_EQUAL(Lo16(x).Get(), 0x7788);
- UNIT_ASSERT_VALUES_EQUAL(Hi16(x).Get(), 0x1122);
- UNIT_ASSERT_VALUES_EQUAL(Lo32(x).Get(), 0x55667788);
- UNIT_ASSERT_VALUES_EQUAL(Hi32(x).Get(), 0x11223344);
- }
+ Y_UNIT_TEST(NarrowFromWide) {
+ const ui64 x = 0x1122334455667788ull;
+ UNIT_ASSERT_VALUES_EQUAL(Lo8(x).Get(), 0x88);
+ UNIT_ASSERT_VALUES_EQUAL(Hi8(x).Get(), 0x11);
+ UNIT_ASSERT_VALUES_EQUAL(Lo16(x).Get(), 0x7788);
+ UNIT_ASSERT_VALUES_EQUAL(Hi16(x).Get(), 0x1122);
+ UNIT_ASSERT_VALUES_EQUAL(Lo32(x).Get(), 0x55667788);
+ UNIT_ASSERT_VALUES_EQUAL(Hi32(x).Get(), 0x11223344);
+ }
}