| 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; |
no test coverage detected