summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h
diff options
context:
space:
mode:
authorBardur Arantsson <bardur@scientician.net>2015-10-27 19:25:50 +0100
committerBardur Arantsson <bardur@scientician.net>2015-10-27 19:25:50 +0100
commit867823f4429b1215cd5c3aa6d2415fb324429891 (patch)
tree2915f6c2e0acae69ad2b738e0038766354d60856 /vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h
parentf005efee43bdb2e9749b02f73b876bf2c1145f1b (diff)
parent47fb7807d77c92fa6e72017501d9355d780adf40 (diff)
Merge branch 'cpp'
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h')
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h b/vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h
new file mode 100644
index 00000000..6e034d10
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/matchers/BeNull.h
@@ -0,0 +1,29 @@
+#ifndef BANDIT_BENULL_H
+#define BANDIT_BENULL_H
+
+#include "Matcher.h"
+
+namespace bandit { namespace Matchers {
+
+ class BeNull : public Matcher
+ {
+ public:
+ BeNull() : Matcher() {}
+
+ template<typename U>
+ bool matches(U *const & actualValue) const
+ {
+ return !actualValue;
+ }
+
+ protected:
+ std::string failure_message_end() const
+ {
+ return std::string("be nil");
+ }
+ };
+
+ static const BeNull be_null = BeNull();
+}}
+
+#endif // BANDIT_BENULL_H