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

Method isAssignmentOp

test/testtoken.cpp:976–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

974 }
975
976 void isAssignmentOp() const {
977 for (auto test_op = assignmentOps.cbegin(); test_op != assignmentOps.cend(); ++test_op) {
978 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
979 Token tok(list, std::move(tokensFrontBack));
980 tok.str(*test_op);
981 ASSERT_EQUALS(true, tok.isAssignmentOp());
982 }
983
984 // Negative test against other operators
985 std::vector<std::string> other_ops;
986 append_vector(other_ops, arithmeticalOps);
987 append_vector(other_ops, bitOps);
988 append_vector(other_ops, comparisonOps);
989 append_vector(other_ops, logicalOps);
990 append_vector(other_ops, extendedOps);
991
992 for (auto other_op = other_ops.cbegin(); other_op != other_ops.cend(); ++other_op) {
993 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
994 Token tok(list, std::move(tokensFrontBack));
995 tok.str(*other_op);
996 ASSERT_EQUALS_MSG(false, tok.isAssignmentOp(), "Failing assignment operator: " + *other_op);
997 }
998 }
999
1000 void operators() const {
1001 for (auto test_op = extendedOps.cbegin(); test_op != extendedOps.cend(); ++test_op) {

Callers 15

isUnchangedFunction · 0.80
doAssignmentFunction · 0.80
assertWithSideEffectsMethod · 0.80
compileAssignTernaryFunction · 0.80
validateAstMethod · 0.80
setParentExprIdFunction · 0.80
setValueTypeMethod · 0.80
getEnumTypeFunction · 0.80

Calls 1

strMethod · 0.45

Tested by

no test coverage detected