MCPcopy Create free account
hub / github.com/apache/qpid-proton / test_new

Function test_new

c/tests/object_test.cpp:161–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161static void test_new(size_t size, const pn_class_t *clazz) {
162 INFO("class=" << pn_class_name(clazz) << " size=" << size);
163 void *obj = pn_class_new(clazz, size);
164 REQUIRE(obj);
165 CHECK(pn_refcount(obj) == 1);
166 CHECK(pn_class(obj) == clazz);
167 char *bytes = (char *)obj;
168 for (size_t i = 0; i < size; i++) {
169 // touch everything for valgrind
170 bytes[i] = i;
171 }
172 pn_free(obj);
173}
174
175TEST_CASE("object_class new") {
176 test_new(0, PN_DEFAULT);

Callers 1

object_test.cppFile · 0.85

Calls 5

pn_class_nameFunction · 0.85
pn_class_newFunction · 0.85
pn_refcountFunction · 0.85
pn_classFunction · 0.85
pn_freeFunction · 0.85

Tested by

no test coverage detected