MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / memory3

Method memory3

test/testlibrary.cpp:689–706  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

687 ASSERT_EQUALS(library.deallocId("free"), library.allocId("foo"));
688 }
689 void memory3() const {
690 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
691 "<def>\n"
692 " <memory>\n"
693 " <alloc arg=\"5\" init=\"false\">CreateX</alloc>\n"
694 " <dealloc arg=\"2\">DeleteX</dealloc>\n"
695 " </memory>\n"
696 "</def>";
697
698 Library library;
699 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
700 ASSERT(library.functions().empty());
701
702 const Library::AllocFunc* af = library.getAllocFuncInfo("CreateX");
703 ASSERT(af && af->arg == 5 && !af->initData);
704 const Library::AllocFunc* df = library.getDeallocFuncInfo("DeleteX");
705 ASSERT(df && df->arg == 2);
706 }
707
708 void resource() const {
709 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"

Callers

nothing calls this directly

Calls 3

getAllocFuncInfoMethod · 0.80
getDeallocFuncInfoMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected