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

Method memory

test/testlibrary.cpp:646–665  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

644 }
645
646 void memory() const {
647 constexpr char xmldata[] = "<?xml version=\"1.0\"?>\n"
648 "<def>\n"
649 " <memory>\n"
650 " <alloc>CreateX</alloc>\n"
651 " <dealloc>DeleteX</dealloc>\n"
652 " </memory>\n"
653 "</def>";
654
655 Library library;
656 ASSERT(LibraryHelper::loadxmldata(library, xmldata, sizeof(xmldata)));
657 ASSERT(library.functions().empty());
658
659 const Library::AllocFunc* af = library.getAllocFuncInfo("CreateX");
660 ASSERT(af && af->arg == -1);
661 ASSERT(Library::ismemory(af));
662 ASSERT_EQUALS(library.allocId("CreateX"), library.deallocId("DeleteX"));
663 const Library::AllocFunc* df = library.getDeallocFuncInfo("DeleteX");
664 ASSERT(df && df->arg == 1);
665 }
666 void memory2() const {
667 constexpr char xmldata1[] = "<?xml version=\"1.0\"?>\n"
668 "<def>\n"

Callers

nothing calls this directly

Calls 6

ismemoryFunction · 0.85
getAllocFuncInfoMethod · 0.80
allocIdMethod · 0.80
deallocIdMethod · 0.80
getDeallocFuncInfoMethod · 0.80
emptyMethod · 0.45

Tested by

no test coverage detected