* This simply returns the negation of whatever returns the subexpression.
*/
template<typename Context>
-class NotCheck : public CompoundCheck<Context> {
+class NotOperator : public CompoundCheck<Context> {
public:
/**
* \brief Constructor
*
* \param expr The subexpression to be negated by this NOT.
*/
- NotCheck(const boost::shared_ptr<Check<Context> >& expr) :
+ NotOperator(const boost::shared_ptr<Check<Context> >& expr) :
expr_(expr)
{ }
/**
const Loader<Context,
Action>& loader)
{
- return (boost::shared_ptr<Check<Context> >(new NotCheck<Context>(
+ return (boost::shared_ptr<Check<Context> >(new NotOperator<Context>(
loader.loadCheck(definition))));
}
/**
}
void notTest(bool value) {
- NotCheck<Log> notOp(shared_ptr<Check<Log> >(new ConstCheck(value, 0)));
+ NotOperator<Log> notOp(shared_ptr<Check<Log> >(new ConstCheck(value, 0)));
Log log;
// It returns negated value
EXPECT_EQ(!value, notOp.matches(log));
}
TEST_F(LogicCreatorTest, notValid) {
- shared_ptr<NotCheck<Log> > notOp(load<NotCheck<Log> >("{\"NOT\":"
- " {\"logcheck\":"
- " [0, true]}}"));
+ shared_ptr<NotOperator<Log> > notOp(load<NotOperator<Log> >("{\"NOT\":"
+ " {\"logcheck\":"
+ " [0, true]}}"));
EXPECT_FALSE(notOp->matches(log_));
log_.checkFirst(1);
}