@@ -68,6 +68,7 @@ class TestToken : public TestFixture {
6868
6969 TEST_CASE (isArithmeticalOp);
7070 TEST_CASE (isOp);
71+ TEST_CASE (isConstOp);
7172 TEST_CASE (isExtendedOp);
7273 TEST_CASE (isAssignmentOp);
7374 TEST_CASE (isStandardType);
@@ -569,6 +570,7 @@ class TestToken : public TestFixture {
569570 append_vector (test_ops, bitOps);
570571 append_vector (test_ops, comparisonOps);
571572 append_vector (test_ops, logicalOps);
573+ append_vector (test_ops, assignmentOps);
572574
573575 std::vector<std::string>::const_iterator test_op, test_ops_end = test_ops.end ();
574576 for (test_op = test_ops.begin (); test_op != test_ops_end; ++test_op) {
@@ -580,7 +582,6 @@ class TestToken : public TestFixture {
580582 // Negative test against other operators
581583 std::vector<std::string> other_ops;
582584 append_vector (other_ops, extendedOps);
583- append_vector (other_ops, assignmentOps);
584585
585586 std::vector<std::string>::const_iterator other_op, other_ops_end = other_ops.end ();
586587 for (other_op = other_ops.begin (); other_op != other_ops_end; ++other_op) {
@@ -590,6 +591,33 @@ class TestToken : public TestFixture {
590591 }
591592 }
592593
594+ void isConstOp () {
595+ std::vector<std::string> test_ops;
596+ append_vector (test_ops, arithmeticalOps);
597+ append_vector (test_ops, bitOps);
598+ append_vector (test_ops, comparisonOps);
599+ append_vector (test_ops, logicalOps);
600+
601+ std::vector<std::string>::const_iterator test_op, test_ops_end = test_ops.end ();
602+ for (test_op = test_ops.begin (); test_op != test_ops_end; ++test_op) {
603+ Token tok (NULL );
604+ tok.str (*test_op);
605+ ASSERT_EQUALS (true , tok.isConstOp ());
606+ }
607+
608+ // Negative test against other operators
609+ std::vector<std::string> other_ops;
610+ append_vector (other_ops, extendedOps);
611+ append_vector (other_ops, assignmentOps);
612+
613+ std::vector<std::string>::const_iterator other_op, other_ops_end = other_ops.end ();
614+ for (other_op = other_ops.begin (); other_op != other_ops_end; ++other_op) {
615+ Token tok (NULL );
616+ tok.str (*other_op);
617+ ASSERT_EQUALS_MSG (false , tok.isConstOp (), " Failing normal operator: " + *other_op);
618+ }
619+ }
620+
593621 void isExtendedOp () {
594622 std::vector<std::string> test_ops;
595623 append_vector (test_ops, arithmeticalOps);
0 commit comments