MCPcopy Create free account
hub / github.com/baidu/babylon / TEST

Function TEST

test/reusable/test_allocator.cpp:26–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24using ::google::protobuf::Arena;
25
26TEST(UsesAllocatorConstructor, constructible_with_raw_args) {
27 struct S {
28 S() = default;
29 S(int) {
30 v = 1;
31 }
32 int v {0};
33 } s;
34 ASSERT_TRUE((Constructible<S, ::std::allocator<void>, int>::value));
35 ASSERT_FALSE((Constructible<S, ::std::allocator<void>, int>::USES_ALLOCATOR));
36 ASSERT_FALSE((Constructible<S, ::std::allocator<void>, int, int>::value));
37 ASSERT_FALSE(
38 (Constructible<S, ::std::allocator<void>, int, int>::USES_ALLOCATOR));
39 s.~S();
40 UsesAllocatorConstructor::construct(&s, ::std::allocator<void>(), 2);
41 ASSERT_EQ(1, s.v);
42}
43
44TEST(UsesAllocatorConstructor, constructible_with_allocator) {
45 struct S {

Callers

nothing calls this directly

Calls 15

allocate_bytesMethod · 0.80
delete_objectMethod · 0.80
emplace_backMethod · 0.80
resourceMethod · 0.80
get_allocatorMethod · 0.80
AClass · 0.50
~SMethod · 0.45
allocateMethod · 0.45
createMethod · 0.45
backMethod · 0.45
releaseMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected