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

Method isArithmeticalOp

test/testtoken.cpp:874–896  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

872
873
874 void isArithmeticalOp() const {
875 for (auto test_op = arithmeticalOps.cbegin(); test_op != arithmeticalOps.cend(); ++test_op) {
876 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
877 Token tok(list, std::move(tokensFrontBack));
878 tok.str(*test_op);
879 ASSERT_EQUALS(true, tok.isArithmeticalOp());
880 }
881
882 // Negative test against other operators
883 std::vector<std::string> other_ops;
884 append_vector(other_ops, bitOps);
885 append_vector(other_ops, comparisonOps);
886 append_vector(other_ops, logicalOps);
887 append_vector(other_ops, extendedOps);
888 append_vector(other_ops, assignmentOps);
889
890 for (auto other_op = other_ops.cbegin(); other_op != other_ops.cend(); ++other_op) {
891 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
892 Token tok(list, std::move(tokensFrontBack));
893 tok.str(*other_op);
894 ASSERT_EQUALS_MSG(false, tok.isArithmeticalOp(), "Failing arithmetical operator: " + *other_op);
895 }
896 }
897
898 void isOp() const {
899 std::vector<std::string> test_ops;

Callers 15

checkIntegerOverflowMethod · 0.80
checkSignConversionMethod · 0.80
setTokenValueFunction · 0.80
setValueTypeMethod · 0.80
alwaysTrueFalseMethod · 0.80
clarifyCalculationMethod · 0.80
isSimpleExprFunction · 0.80
canReplaceMethod · 0.80
dumpMethod · 0.80

Calls 1

strMethod · 0.45

Tested by

no test coverage detected