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

Method testCtors

test/array.cpp:82–318  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

80 }
81
82 void
83 testCtors()
84 {
85 // ~array()
86 {
87 // implied
88 }
89
90 // array()
91 {
92 array a;
93 BOOST_TEST(a.empty());
94 BOOST_TEST(a.size() == 0);
95 }
96
97 // array(storage_ptr)
98 {
99 array a(storage_ptr{});
100 check_storage(a, storage_ptr{});
101 }
102
103 // array(size_type, value, storage)
104 {
105 // default storage
106 {
107 array a(3, true);
108 BOOST_TEST(a.size() == 3);
109 for(auto const& v : a)
110 BOOST_TEST(v.is_bool());
111 check_storage(a, storage_ptr{});
112 }
113
114 // construct with zero `true` values
115 {
116 array(0, true);
117 }
118
119 // construct with three `true` values
120 fail_loop([&](storage_ptr const& sp)
121 {
122 array a(3, true, sp);
123 BOOST_TEST(a.size() == 3);
124 check_storage(a, sp);
125 });
126 }
127
128 // array(size_type, storage)
129 {
130 // default storage
131 {
132 array a(3);
133 BOOST_TEST(a.size() == 3);
134 for(auto const& v : a)
135 BOOST_TEST(v.is_null());
136 check_storage(a, storage_ptr{});
137 }
138
139 // zero size

Callers

nothing calls this directly

Calls 14

check_storageFunction · 0.85
fail_loopFunction · 0.85
make_input_iteratorFunction · 0.85
checkFunction · 0.85
pilferFunction · 0.85
is_boolMethod · 0.80
is_nullMethod · 0.80
arrayClass · 0.50
storage_ptrClass · 0.50
emptyMethod · 0.45
sizeMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected