MCPcopy Create free account
hub / github.com/boostorg/json / testPmr

Method testPmr

test/memory_resource.cpp:53–95  ·  view source on GitHub ↗

These are here instead of the type-specific test TUs, so that we only need to link to Boost.Container from one file.

Source from the content-addressed store, hash-verified

51 // test TUs, so that we only need to link to
52 // Boost.Container from one file.
53 void
54 testPmr()
55 {
56 // array
57 {
58 // get_allocator
59 {
60 monotonic_resource mr;
61 array a(&mr);
62 BOOST_TEST(a.get_allocator().resource() == &mr);
63 }
64 }
65
66 // object
67 {
68 // get_allocator
69 {
70 monotonic_resource mr;
71 object o(&mr);
72 BOOST_TEST(o.get_allocator().resource() == &mr);
73 }
74 }
75
76 // string
77 {
78 // get_allocator
79 {
80 monotonic_resource mr;
81 string s(&mr);
82 BOOST_TEST(s.get_allocator().resource() == &mr);
83 }
84 }
85
86 // value
87 {
88 // get_allocator
89 {
90 monotonic_resource mr;
91 value jv(&mr);
92 BOOST_TEST(jv.get_allocator().resource() == &mr);
93 }
94 }
95 }
96
97 void
98 run()

Callers

nothing calls this directly

Calls 1

get_allocatorMethod · 0.45

Tested by

no test coverage detected