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

Method array

test/testsymboldatabase.cpp:640–651  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

638 }
639
640 void array() {
641 GET_SYMBOL_DB_C("int a[10+2];");
642 ASSERT(db != nullptr);
643
644 ASSERT(db->variableList().size() == 2); // the first one is not used
645 const Variable * v = db->getVariableFromVarId(1);
646 ASSERT(v != nullptr);
647
648 ASSERT(v->isArray());
649 ASSERT_EQUALS(1U, v->dimensions().size());
650 ASSERT_EQUALS(12U, v->dimension(0));
651 }
652
653 void array_ptr() {
654 GET_SYMBOL_DB("const char* a[] = { \"abc\" };\n"

Callers

nothing calls this directly

Calls 2

isArrayMethod · 0.80
sizeMethod · 0.45

Tested by

no test coverage detected