MCPcopy Create free account
hub / github.com/catboost/catboost / Y_UNIT_TEST

Function Y_UNIT_TEST

util/stream/aligned_ut.cpp:37–62  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

35
36Y_UNIT_TEST_SUITE(TAlignedTest) {
37 Y_UNIT_TEST(AlignInput) {
38 TNastyInputStream input0;
39 TAlignedInput alignedInput(&input0);
40
41 char c = '\1';
42
43 alignedInput.Align(2);
44 alignedInput.ReadChar(c);
45 UNIT_ASSERT_VALUES_EQUAL(c, '\x0');
46
47 alignedInput.Align(2);
48 alignedInput.ReadChar(c);
49 UNIT_ASSERT_VALUES_EQUAL(c, '\x2');
50
51 alignedInput.Align(4);
52 alignedInput.ReadChar(c);
53 UNIT_ASSERT_VALUES_EQUAL(c, '\x4');
54
55 alignedInput.Align(16);
56 alignedInput.ReadChar(c);
57 UNIT_ASSERT_VALUES_EQUAL(c, '\x10');
58
59 alignedInput.Align(128);
60 alignedInput.ReadChar(c);
61 UNIT_ASSERT_VALUES_EQUAL(c, '\x80');
62 }
63} // Y_UNIT_TEST_SUITE(TAlignedTest)

Callers

nothing calls this directly

Calls 2

ReadCharMethod · 0.80
AlignMethod · 0.45

Tested by

no test coverage detected