1 #ifndef HAMCRESTQT_ANYOF_H
2 #define HAMCRESTQT_ANYOF_H
5 #include <QSharedPointer>
7 #include "shortcutcombination.h"
42 QSharedPointer<Matcher<T> >
anyOf(
const QList<QSharedPointer<
Matcher<T> > > &matchers)
44 return QSharedPointer<Matcher<T> >(
new AnyOf<T>(matchers));
48 QSharedPointer<Matcher<T> >
anyOf(
const QSharedPointer<Matcher<T> > &first,
49 const QSharedPointer<Matcher<T> > &second)
51 QList<QSharedPointer<Matcher<T> > > matchers;
52 matchers.append(first);
53 matchers.append(second);
54 return anyOf(matchers);
58 QSharedPointer<Matcher<T> >
anyOf(
const QSharedPointer<Matcher<T> > &first,
59 const QSharedPointer<Matcher<T> > &second,
60 const QSharedPointer<Matcher<T> > &third)
62 QList<QSharedPointer<Matcher<T> > > matchers;
63 matchers.append(first);
64 matchers.append(second);
65 matchers.append(third);
66 return anyOf(matchers);
70 QSharedPointer<Matcher<T> >
anyOf(
const QSharedPointer<Matcher<T> > &first,
71 const QSharedPointer<Matcher<T> > &second,
72 const QSharedPointer<Matcher<T> > &third,
73 const QSharedPointer<Matcher<T> > &fourth)
75 QList<QSharedPointer<Matcher<T> > > matchers;
76 matchers.append(first);
77 matchers.append(second);
78 matchers.append(third);
79 matchers.append(fourth);
80 return anyOf(matchers);
84 QSharedPointer<Matcher<T> >
anyOf(
const QSharedPointer<Matcher<T> > &first,
85 const QSharedPointer<Matcher<T> > &second,
86 const QSharedPointer<Matcher<T> > &third,
87 const QSharedPointer<Matcher<T> > &fourth,
88 const QSharedPointer<Matcher<T> > &fifth)
90 QList<QSharedPointer<Matcher<T> > > matchers;
91 matchers.append(first);
92 matchers.append(second);
93 matchers.append(third);
94 matchers.append(fourth);
95 matchers.append(fifth);
96 return anyOf(matchers);
100 QSharedPointer<Matcher<T> >
anyOf(
const QSharedPointer<Matcher<T> > &first,
101 const QSharedPointer<Matcher<T> > &second,
102 const QSharedPointer<Matcher<T> > &third,
103 const QSharedPointer<Matcher<T> > &fourth,
104 const QSharedPointer<Matcher<T> > &fifth,
105 const QSharedPointer<Matcher<T> > &sixth)
107 QList<QSharedPointer<Matcher<T> > > matchers;
108 matchers.append(first);
109 matchers.append(second);
110 matchers.append(third);
111 matchers.append(fourth);
112 matchers.append(fifth);
113 matchers.append(sixth);
114 return anyOf(matchers);
119 #endif // HAMCRESTQT_ANYOF_H
QSharedPointer< Matcher< T > > anyOf(const QList< QSharedPointer< Matcher< T > > > &matchers)
Creates a matcher that matches if the examined object matches ANY of the specified matchers...
Definition: anyof.h:42
virtual void describeTo(Description &description) const
Generates a description of the object.
Definition: anyof.h:26
A description of a Matcher.
Definition: description.h:17
Calculates the logical disjunction of multiple matchers.
Definition: anyof.h:16
A matcher over acceptable values.
Definition: matcher.h:21
virtual bool matches(const T &item) const
Evaluates the matcher for argument item.
Definition: anyof.h:21
Definition: shortcutcombination.h:12