aboutsummaryrefslogtreecommitdiffstats
path: root/library/cpp/yt/memory/unittests/range_protobuf_repeated_field_ut.cpp
blob: 35581468a4ecefb084975d438c08bfbc7b248e68 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#include <library/cpp/testing/gtest/gtest.h>

#include <library/cpp/testing/gtest_extensions/assertions.h>

#include <library/cpp/yt/memory/range.h>
#include <vector>

namespace {

////////////////////////////////////////////////////////////////////////////////

/*
    Test build
    https://a.yandex-team.ru/arcadia/yt/yt/library/backtrace_introspector/introspect.cpp?rev=r14560536#L165
*/

TEST(TRangeVector, ImmutableRange)
{
    std::vector<const void*> backtrace;
    [[maybe_unused]] auto range = NYT::TRange(backtrace);
}

TEST(TRangeVector, MutableRange)
{
    std::vector<const void*> backtrace;
    [[maybe_unused]] auto range = NYT::TMutableRange(backtrace);
}

////////////////////////////////////////////////////////////////////////////////

/*
    Test build
    https://a.yandex-team.ru/arcadia/yt/yt/library/oom/oom.cpp?rev=r14560536#L112
*/

static const char* TDummyStringArray[] = {
    "xxx",
    "yyy",
    "zzz",
};

TEST(TRangeArrayOfStrings, ImmutableRange)
{
    [[maybe_unused]] auto range = NYT::TRange(TDummyStringArray);
}

TEST(TRangeArrayOfStrings, MutableRange)
{
    [[maybe_unused]] auto range = NYT::TMutableRange(TDummyStringArray);
}

////////////////////////////////////////////////////////////////////////////////

/*
    Test build
    https://a.yandex-team.ru/arcadia/yt/yt/orm/server/access_control/object_cluster.cpp?rev=r14560536#L188
*/

TEST(TRangeRawPtr, ImmutableRange)
{
    struct TDummyData{};
    TDummyData** ptr = nullptr;
    constexpr int size = 0x10;
    [[maybe_unused]] auto range = NYT::TRange<TDummyData*>(ptr, size);
}

TEST(TRangeRawPtr, MutableRange)
{
    struct TDummyData{};
    TDummyData** ptr = nullptr;
    constexpr int size = 0x10;
    [[maybe_unused]] auto range = NYT::TMutableRange<TDummyData*>(ptr, size);
}

////////////////////////////////////////////////////////////////////////////////
} // namespace