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

Method testSpecial

test/value.cpp:86–353  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

84 //------------------------------------------------------
85
86 void
87 testSpecial()
88 {
89 auto dsp = storage_ptr{};
90 auto sp = make_shared_resource<unique_resource>();
91
92 // ~value()
93 {
94 value(object{});
95 value(array{});
96 value(string{});
97 value(std::int64_t(0));
98 value(std::uint64_t(0));
99 value(double(0));
100 value(true);
101 value(nullptr);
102 }
103
104 // value()
105 {
106 value jv;
107 BOOST_TEST(*jv.storage() == *dsp);
108 }
109
110 // value(storage_ptr)
111 {
112 value jv(sp);
113 BOOST_TEST(*jv.storage() == *sp);
114 }
115
116 // value(pilfered<value>)
117 {
118 {
119 value jv1(object{});
120 value jv2(pilfer(jv1));
121 BOOST_TEST(jv2.is_object());
122 }
123 {
124 value jv1(array{});
125 value jv2(pilfer(jv1));
126 BOOST_TEST(jv2.is_array());
127 }
128 {
129 value jv1(string{});
130 value jv2(pilfer(jv1));
131 BOOST_TEST(jv2.is_string());
132 }
133 {
134 value jv1(std::int64_t{});
135 value jv2(pilfer(jv1));
136 BOOST_TEST(jv2.is_int64());
137 }
138 {
139 value jv1(std::uint64_t{});
140 value jv2(pilfer(jv1));
141 BOOST_TEST(jv2.is_uint64());
142 }
143 {

Callers

nothing calls this directly

Calls 14

int64_tClass · 0.85
uint64_tClass · 0.85
pilferFunction · 0.85
is_objectMethod · 0.80
is_arrayMethod · 0.80
is_stringMethod · 0.80
is_int64Method · 0.80
is_uint64Method · 0.80
is_doubleMethod · 0.80
is_boolMethod · 0.80
is_nullMethod · 0.80
valueClass · 0.70

Tested by

no test coverage detected