1 #ifndef HAMCRESTQT_ISNOT_H
2 #define HAMCRESTQT_ISNOT_H
4 #include <QSharedPointer>
6 #include "basematcher.h"
22 return !matcher->matches(item);
31 QSharedPointer<Matcher<T> > matcher;
48 return QSharedPointer<Matcher<T> >(
new IsNot<T>(matcher));
63 QSharedPointer<Matcher<T> >
_not(
const T &operand)
65 return _not(equalTo(operand));
69 inline QSharedPointer<Matcher<const char*> >
_not(
const char *operand)
71 return QSharedPointer<Matcher<const char*> >(
new IsNot<const char*>(equalTo(operand)));
76 #endif // HAMCRESTQT_ISNOT_H
A description of a Matcher.
Definition: description.h:17
A matcher over acceptable values.
Definition: matcher.h:21
virtual bool matches(const T &item) const
Evaluates the matcher for argument item.
Definition: isnot.h:20
BaseClass for all Matcher implementations.
Definition: basematcher.h:17
virtual void describeTo(Description &description) const
Generates a description of the object.
Definition: isnot.h:25
virtual Description & appendText(const QString &text)=0
Appends some plain text to the description.
Calculates the logical negation of a matcher.
Definition: isnot.h:15
virtual Description & appendDescriptionOf(const SelfDescribing &value)=0
Appends the description of a SelfDescribing value to this description.
QSharedPointer< Matcher< T > > _not(const QSharedPointer< Matcher< T > > &matcher)
Creates a matcher that wraps an existing matcher, but inverts the logic by which it will match...
Definition: isnot.h:46