diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-08-01 16:35:25 +0200 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-09-14 05:58:27 +0200 |
commit | 7b9f4e4e8169ca2fad3a1c7ca03f07ecfc46678e (patch) | |
tree | 0cef1ac0dc228b621afc90bc94e4e0dddcb90c82 /vendor/bandit/bandit/assertion_frameworks/matchers/must.h | |
parent | c6196b25d119a10e79deedef26a73e0d5a021b0e (diff) |
Bandit 2.0.0
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/must.h')
-rw-r--r-- | vendor/bandit/bandit/assertion_frameworks/matchers/must.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/matchers/must.h b/vendor/bandit/bandit/assertion_frameworks/matchers/must.h new file mode 100644 index 00000000..54eedb7f --- /dev/null +++ b/vendor/bandit/bandit/assertion_frameworks/matchers/must.h @@ -0,0 +1,36 @@ +#ifndef BANDIT_MUST_H +#define BANDIT_MUST_H + +#include "ValueProxy.h" + +namespace bandit { namespace Matchers +{ + struct ValueMarker + { + const char* filename; + int lineNumber; + }; + + template<typename T> + const ValueProxy<T> operator,(const T& value, const ValueMarker& marker) + { + return ValueProxy<T>(marker.filename, marker.lineNumber, value); + } + + template<typename T> + const MatchProxy<T> operator,(const ValueProxy<T>& value, bool negate) + { + return negate ? value.to_not : value.to; + } + + template<typename T, typename MatcherType> + void operator,(const MatchProxy<T>& matchProxy, const MatcherType& matcher) + { + matchProxy(matcher); + } +}} + +#define must ,(bandit::Matchers::ValueMarker){__FILE__, __LINE__},false, +#define must_not ,(bandit::Matchers::ValueMarker){__FILE__, __LINE__},true, + +#endif //BANDIT_MUST_H |