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

Method isOp

test/testtoken.cpp:898–923  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

896 }
897
898 void isOp() const {
899 std::vector<std::string> test_ops;
900 append_vector(test_ops, arithmeticalOps);
901 append_vector(test_ops, bitOps);
902 append_vector(test_ops, comparisonOps);
903 append_vector(test_ops, logicalOps);
904 append_vector(test_ops, assignmentOps);
905
906 for (auto test_op = test_ops.cbegin(); test_op != test_ops.cend(); ++test_op) {
907 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
908 Token tok(list, std::move(tokensFrontBack));
909 tok.str(*test_op);
910 ASSERT_EQUALS(true, tok.isOp());
911 }
912
913 // Negative test against other operators
914 std::vector<std::string> other_ops;
915 append_vector(other_ops, extendedOps);
916
917 for (auto other_op = other_ops.cbegin(); other_op != other_ops.cend(); ++other_op) {
918 auto tokensFrontBack = std::make_shared<TokensFrontBack>();
919 Token tok(list, std::move(tokensFrontBack));
920 tok.str(*other_op);
921 ASSERT_EQUALS_MSG(false, tok.isOp(), "Failing normal operator: " + *other_op);
922 }
923 }
924
925 void isConstOp() const {
926 std::vector<std::string> test_ops;

Callers 10

iscastFunction · 0.80
templateParametersMethod · 0.80
multiComparePercentFunction · 0.80
setVarIdPass1Method · 0.80
dumpMethod · 0.80

Calls 1

strMethod · 0.45

Tested by

no test coverage detected