summaryrefslogtreecommitdiff
path: root/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse
diff options
context:
space:
mode:
Diffstat (limited to 'vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse')
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assert.h126
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h58
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertmacro.h22
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/constraints.h23
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/containsconstraint.h80
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/endswithconstraint.h53
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalsconstraint.h83
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalscontainerconstraint.h80
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalswithdeltaconstraint.h51
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h46
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression.h38
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression_fwd.h15
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/notexpression.h44
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/orexpression.h46
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/fulfillsconstraint.h51
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/haslengthconstraint.h60
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanconstraint.h55
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanorequaltoconstraint.h55
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanconstraint.h54
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanorequaltoconstraint.h55
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/startswithconstraint.h52
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/exceptions.h120
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintadapter.h39
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintlist.h91
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/expressionbuilder.h357
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/fluent.h38
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/andoperator.h54
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/alloperator.h35
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atleastoperator.h41
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atmostoperator.h39
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h113
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionoperator.h24
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/exactlyoperator.h39
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/noneoperator.h33
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/constraintoperator.h70
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/invalidexpressionexception.h28
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/notoperator.h53
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/oroperator.h55
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/snowhouse.h33
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringize.h104
-rw-r--r--vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringizers.h60
41 files changed, 2573 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assert.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assert.h
new file mode 100644
index 00000000..64981094
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assert.h
@@ -0,0 +1,126 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ASSERT_H
+#define IGLOO_ASSERT_H
+
+#include "stringize.h"
+#include "stringizers.h"
+
+namespace snowhouse {
+
+ struct DefaultFailureHandler
+ {
+ template <class ExpectedType, class ActualType>
+ static void Handle(const ExpectedType& expected, const ActualType& actual, const char* file_name, int line_number)
+ {
+ std::ostringstream str;
+
+ str << "Expected: " << snowhouse::Stringize(expected) << std::endl;
+ str << "Actual: " << snowhouse::Stringize(actual) << std::endl;
+
+ throw AssertionException(str.str(), file_name, line_number);
+ }
+
+ static void Handle(const std::string& message)
+ {
+ throw AssertionException(message);
+ }
+ };
+
+ template<typename FailureHandler>
+ class ConfigurableAssert
+ {
+ public:
+
+ template <typename ActualType, typename ConstraintListType>
+ static void That(const ActualType& actual, ExpressionBuilder<ConstraintListType> expression)
+ {
+ const char* no_file = "";
+ int line_number = 0;
+
+ ConfigurableAssert<FailureHandler>::That(actual, expression, no_file, line_number);
+ }
+
+ template <typename ActualType, typename ConstraintListType>
+ static void That(const ActualType& actual, ExpressionBuilder<ConstraintListType> expression, const char* file_name, int line_number)
+ {
+ try
+ {
+ ResultStack result;
+ OperatorStack operators;
+ expression.Evaluate(result, operators, actual);
+
+ while (!operators.empty())
+ {
+ ConstraintOperator* op = operators.top();
+ op->PerformOperation(result);
+ operators.pop();
+ }
+
+ if (result.empty())
+ {
+ throw InvalidExpressionException("The expression did not yield any result");
+ }
+
+ if (!result.top())
+ {
+ FailureHandler::Handle(expression, actual, file_name, line_number);
+ }
+ }
+ catch (const InvalidExpressionException& e)
+ {
+ FailureHandler::Handle("Malformed expression: \"" + snowhouse::Stringize(expression) + "\"\n" + e.Message());
+ }
+ }
+
+ template <typename ConstraintListType>
+ static void That(const char* actual, ExpressionBuilder<ConstraintListType> expression)
+ {
+ return That(std::string(actual), expression);
+ }
+
+ template <typename ActualType, typename ExpressionType>
+ static void That(const ActualType& actual, const ExpressionType& expression)
+ {
+ const char* no_file = "";
+ int no_line = 0;
+ That(actual, expression, no_file, no_line);
+ }
+
+ template <typename ActualType, typename ExpressionType>
+ static void That(const ActualType& actual, const ExpressionType& expression, const char* file_name, int line_number)
+ {
+ if (!expression(actual))
+ {
+ FailureHandler::Handle(expression, actual, file_name, line_number);
+ }
+ }
+
+ template <typename ExpressionType>
+ static void That(const char* actual, const ExpressionType& expression)
+ {
+ return That(std::string(actual), expression);
+ }
+
+ static void That(bool actual)
+ {
+ if (!actual)
+ {
+ FailureHandler::Handle("Expected: true\nActual: false");
+ }
+ }
+
+ static void Failure(const std::string& message)
+ {
+ FailureHandler::Handle(message);
+ }
+ };
+
+ typedef ConfigurableAssert<DefaultFailureHandler> Assert;
+}
+
+#endif // IGLOO_ASSERT_H
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h
new file mode 100644
index 00000000..d0747742
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertionexception.h
@@ -0,0 +1,58 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ASSERTIONEXCEPTION_H
+#define IGLOO_ASSERTIONEXCEPTION_H
+
+namespace snowhouse {
+ class AssertionException : public std::exception
+ {
+ public:
+ AssertionException(const std::string& message)
+ : m_message(message), m_fileName(""), m_line(0)
+ {}
+
+ AssertionException(const std::string& message, const std::string& fileName, unsigned int line)
+ : m_message(message), m_fileName(fileName), m_line(line)
+ {}
+
+#if __cplusplus > 199711L
+ AssertionException(const AssertionException&) = default;
+#endif
+
+#if __cplusplus > 199711L
+ virtual ~AssertionException() noexcept
+ {
+ }
+#else
+ virtual ~AssertionException() throw()
+ {
+ }
+#endif
+
+ std::string GetMessage() const
+ {
+ return m_message;
+ }
+
+ std::string GetFilename() const
+ {
+ return m_fileName;
+ }
+
+ unsigned int GetLineNumber() const
+ {
+ return m_line;
+ }
+
+ private:
+ std::string m_message;
+ std::string m_fileName;
+ unsigned int m_line;
+ };
+}
+
+#endif // IGLOO_ASSERTIONEXCEPTION_H
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertmacro.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertmacro.h
new file mode 100644
index 00000000..df5b4b34
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/assertmacro.h
@@ -0,0 +1,22 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ASSERTMACRO_H
+#define IGLOO_ASSERTMACRO_H
+
+#include "assert.h"
+
+#define SNOWHOUSE_ASSERT_THAT(p1,p2,FAILURE_HANDLER)\
+ ::snowhouse::ConfigurableAssert<FAILURE_HANDLER>::That((p1), (p2), __FILE__, __LINE__);\
+
+#ifndef SNOWHOUSE_NO_MACROS
+
+#define AssertThat(p1,p2)\
+ SNOWHOUSE_ASSERT_THAT((p1), (p2), ::snowhouse::DefaultFailureHandler);\
+
+#endif // SNOWHOUSE_NO_MACROS
+
+#endif // IGLOO_ASSERTMACRO_H
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/constraints.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/constraints.h
new file mode 100644
index 00000000..a12433d1
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/constraints.h
@@ -0,0 +1,23 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_CONSTRAINTS_H
+#define IGLOO_CONSTRAINTS_H
+
+#include "containsconstraint.h"
+#include "endswithconstraint.h"
+#include "equalsconstraint.h"
+#include "haslengthconstraint.h"
+#include "isgreaterthanconstraint.h"
+#include "isgreaterthanorequaltoconstraint.h"
+#include "islessthanconstraint.h"
+#include "islessthanorequaltoconstraint.h"
+#include "startswithconstraint.h"
+#include "fulfillsconstraint.h"
+#include "equalswithdeltaconstraint.h"
+#include "equalscontainerconstraint.h"
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/containsconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/containsconstraint.h
new file mode 100644
index 00000000..f20d6800
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/containsconstraint.h
@@ -0,0 +1,80 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_CONTAINSCONSTRAINT_H
+#define IGLOO_CONTAINSCONSTRAINT_H
+
+#include <algorithm>
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template <typename ContainerType>
+ struct find_in_container_traits
+ {
+ template <typename ExpectedType>
+ static bool find(const ContainerType& container, const ExpectedType& expected)
+ {
+ return std::find(container.begin(), container.end(), expected) != container.end();
+ }
+ };
+
+ template <typename KeyType, typename ValueType>
+ struct find_in_container_traits<std::map<KeyType, ValueType> >
+ {
+ template <typename ExpectedType>
+ static bool find(const std::map<KeyType, ValueType>& container, const ExpectedType& expected)
+ {
+ return container.find(expected) != container.end();
+ }
+ };
+
+ template <typename ExpectedType>
+ struct ContainsConstraint : Expression< ContainsConstraint<ExpectedType> >
+ {
+ ContainsConstraint(const ExpectedType& expected)
+ : m_expected(expected) {}
+
+ template <typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return find_in_container_traits<ActualType>::find(actual, m_expected);
+ }
+
+ bool operator()(const std::string& actual) const
+ {
+ return actual.find(m_expected) != actual.npos;
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline ContainsConstraint<ExpectedType> Contains(const ExpectedType& expected)
+ {
+ return ContainsConstraint<ExpectedType>(expected);
+ }
+
+ inline ContainsConstraint<std::string> Contains(const char* expected)
+ {
+ return ContainsConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< ContainsConstraint< ExpectedType > >
+ {
+ static std::string ToString(const ContainsConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "contains " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/endswithconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/endswithconstraint.h
new file mode 100644
index 00000000..c867e203
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/endswithconstraint.h
@@ -0,0 +1,53 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ENDSWITHCONSTRAINT_H
+#define IGLOO_ENDSWITHCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template <typename ExpectedType>
+ struct EndsWithConstraint : Expression< EndsWithConstraint<ExpectedType> >
+ {
+ EndsWithConstraint(const ExpectedType& expected)
+ : m_expected(expected) {}
+
+ bool operator()(const std::string& actual) const
+ {
+ size_t expectedPos = actual.length() - m_expected.length();
+ return actual.find(m_expected) == expectedPos;
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline EndsWithConstraint<ExpectedType> EndsWith(const ExpectedType& expected)
+ {
+ return EndsWithConstraint<ExpectedType>(expected);
+ }
+
+ inline EndsWithConstraint<std::string> EndsWith(const char* expected)
+ {
+ return EndsWithConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< EndsWithConstraint< ExpectedType > >
+ {
+ static std::string ToString(const EndsWithConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "ends with " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalsconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalsconstraint.h
new file mode 100644
index 00000000..a47f6bf4
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalsconstraint.h
@@ -0,0 +1,83 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EQUALSCONSTRAINT_H
+#define IGLOO_EQUALSCONSTRAINT_H
+
+#include <cstddef>
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType >
+ struct EqualsConstraint : Expression< EqualsConstraint<ExpectedType> >
+ {
+ EqualsConstraint(const ExpectedType& expected)
+ : m_expected(expected)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return (m_expected == actual);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline EqualsConstraint<ExpectedType> Equals(const ExpectedType& expected)
+ {
+ return EqualsConstraint<ExpectedType>(expected);
+ }
+
+ inline EqualsConstraint<std::string> Equals(const char* expected)
+ {
+ return EqualsConstraint<std::string>(expected);
+ }
+
+ inline EqualsConstraint<bool> IsFalse()
+ {
+ return EqualsConstraint<bool>(false);
+ }
+
+ inline EqualsConstraint<bool> IsTrue()
+ {
+ return EqualsConstraint<bool>(true);
+ }
+
+#if __cplusplus > 199711L
+ inline EqualsConstraint<std::nullptr_t> IsNull()
+ {
+ return EqualsConstraint<std::nullptr_t>(nullptr);
+ }
+#endif
+
+ template <>
+ struct Stringizer< EqualsConstraint< bool > >
+ {
+ static std::string ToString(const EqualsConstraint<bool>& constraint)
+ {
+ return constraint.m_expected ? "true" : "false";
+ }
+ };
+
+ template< typename ExpectedType >
+ struct Stringizer< EqualsConstraint< ExpectedType > >
+ {
+ static std::string ToString(const EqualsConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "equal to " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalscontainerconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalscontainerconstraint.h
new file mode 100644
index 00000000..f8650952
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalscontainerconstraint.h
@@ -0,0 +1,80 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EQUALSCONTAINERCONSTRAINT_H
+#define IGLOO_EQUALSCONTAINERCONSTRAINT_H
+
+namespace snowhouse {
+
+ namespace constraint_internal {
+ template<typename T>
+ inline bool default_comparer(const T& lhs, const T& rhs)
+ {
+ return lhs == rhs;
+ }
+ }
+
+ template< typename ExpectedType, typename BinaryPredicate>
+ struct EqualsContainerConstraint : Expression< EqualsContainerConstraint<ExpectedType, BinaryPredicate> >
+ {
+ EqualsContainerConstraint(const ExpectedType& expected, const BinaryPredicate predicate)
+ : expected_(expected), predicate_(predicate)
+ {}
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ typename ActualType::const_iterator actual_it;
+ typename ExpectedType::const_iterator expected_it;
+
+ for(actual_it = actual.begin(), expected_it = expected_.begin(); actual_it != actual.end() && expected_it != expected_.end(); actual_it++, expected_it++)
+ {
+ if(!predicate_(*actual_it, *expected_it))
+ {
+ return false;
+ }
+ }
+
+ return actual.size() == expected_.size();
+ }
+
+ const ExpectedType expected_;
+ const BinaryPredicate predicate_;
+
+ private:
+
+#if __cplusplus > 199711L
+#else
+ EqualsContainerConstraint& operator=(const EqualsContainerConstraint&) { return *this; }
+#endif
+
+ };
+
+ template< typename ExpectedType>
+ inline EqualsContainerConstraint<ExpectedType, bool (*)(const typename ExpectedType::value_type&, const typename ExpectedType::value_type&)> EqualsContainer(const ExpectedType& expected)
+ {
+ return EqualsContainerConstraint<ExpectedType, bool (*)(const typename ExpectedType::value_type&, const typename ExpectedType::value_type&)>(expected, constraint_internal::default_comparer);
+ }
+
+ template< typename ExpectedType, typename BinaryPredicate >
+ inline EqualsContainerConstraint<ExpectedType, BinaryPredicate> EqualsContainer(const ExpectedType& expected, const BinaryPredicate predicate)
+ {
+ return EqualsContainerConstraint<ExpectedType, BinaryPredicate>(expected, predicate);
+ }
+
+ template< typename ExpectedType, typename BinaryPredicate >
+ struct Stringizer< EqualsContainerConstraint<ExpectedType, BinaryPredicate> >
+ {
+ static std::string ToString(const EqualsContainerConstraint<ExpectedType, BinaryPredicate>& constraint)
+ {
+ std::ostringstream builder;
+ builder << snowhouse::Stringize(constraint.expected_);
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalswithdeltaconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalswithdeltaconstraint.h
new file mode 100644
index 00000000..b54fb74e
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/equalswithdeltaconstraint.h
@@ -0,0 +1,51 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EQUALSWITHDELTACONSTRAINT_H
+#define IGLOO_EQUALSWITHDELTACONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType, typename DeltaType >
+ struct EqualsWithDeltaConstraint : Expression< EqualsWithDeltaConstraint<ExpectedType, DeltaType> >
+ {
+ EqualsWithDeltaConstraint(const ExpectedType& expected, const DeltaType& delta)
+ : m_expected(expected), m_delta(delta)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return ((m_expected <= (actual + m_delta)) && (m_expected >= (actual - m_delta)));
+ }
+
+ ExpectedType m_expected;
+ DeltaType m_delta;
+ };
+
+ template< typename ExpectedType, typename DeltaType >
+ inline EqualsWithDeltaConstraint<ExpectedType, DeltaType> EqualsWithDelta(const ExpectedType& expected, const DeltaType& delta)
+ {
+ return EqualsWithDeltaConstraint<ExpectedType, DeltaType>(expected, delta);
+ }
+
+ template< typename ExpectedType, typename DeltaType >
+ struct Stringizer< EqualsWithDeltaConstraint< ExpectedType, DeltaType > >
+ {
+ static std::string ToString(const EqualsWithDeltaConstraint<ExpectedType, DeltaType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "equal to " << snowhouse::Stringize(constraint.m_expected) << " (+/- " << snowhouse::Stringize(constraint.m_delta) << ")";
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
new file mode 100644
index 00000000..8b6b7d12
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/andexpression.h
@@ -0,0 +1,46 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ANDEXPRESSION_H
+#define IGLOO_ANDEXPRESSION_H
+
+#include "./expression_fwd.h"
+
+namespace snowhouse {
+
+ template< typename LeftExpression, typename RightExpression >
+ struct AndExpression : Expression< AndExpression<LeftExpression, RightExpression> >
+ {
+ AndExpression(const LeftExpression& left, const RightExpression& right)
+ : m_left(left)
+ , m_right(right)
+ {
+ }
+
+ template< typename ActualType >
+ bool operator()(const ActualType& actual) const
+ {
+ return (m_left(actual) && m_right(actual));
+ }
+
+ LeftExpression m_left;
+ RightExpression m_right;
+ };
+
+ template< typename LeftExpression, typename RightExpression >
+ struct Stringizer< AndExpression<LeftExpression, RightExpression> >
+ {
+ static std::string ToString(const AndExpression<LeftExpression, RightExpression>& expression)
+ {
+ std::ostringstream builder;
+ builder << Stringize(expression.m_left) << " and " << Stringize(expression.m_right);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression.h
new file mode 100644
index 00000000..fa894818
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression.h
@@ -0,0 +1,38 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EXPRESSION_H
+#define IGLOO_EXPRESSION_H
+
+#include "./notexpression.h"
+#include "./andexpression.h"
+#include "./orexpression.h"
+
+namespace snowhouse {
+
+ template<typename T>
+ struct Expression
+ {
+ NotExpression<T> operator!() const
+ {
+ return NotExpression<T>(static_cast<const T&>(*this));
+ }
+
+ template< typename Right >
+ AndExpression<T, Right> operator&&(const Right& right) const
+ {
+ return AndExpression<T, Right>(static_cast<const T&>(*this), right);
+ }
+
+ template< typename Right >
+ OrExpression<T, Right> operator||(const Right& right) const
+ {
+ return OrExpression<T, Right>(static_cast<const T&>(*this), right);
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression_fwd.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression_fwd.h
new file mode 100644
index 00000000..c0e3706e
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/expression_fwd.h
@@ -0,0 +1,15 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EXPRESSION_FWD_H
+#define IGLOO_EXPRESSION_FWD_H
+
+namespace snowhouse {
+ template<typename T>
+ struct Expression;
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/notexpression.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/notexpression.h
new file mode 100644
index 00000000..4785f07b
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/notexpression.h
@@ -0,0 +1,44 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_NOTEXPRESSION_H
+#define IGLOO_NOTEXPRESSION_H
+
+#include "./expression_fwd.h"
+
+namespace snowhouse {
+
+ template< typename ExpressionType >
+ struct NotExpression : Expression< NotExpression<ExpressionType> >
+ {
+ NotExpression(const ExpressionType& expression)
+ : m_expression(expression)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return !m_expression(actual);
+ }
+
+ ExpressionType m_expression;
+ };
+
+ template< typename ExpressionType >
+ struct Stringizer< NotExpression<ExpressionType> >
+ {
+ static std::string ToString(const NotExpression<ExpressionType>& expression)
+ {
+ std::ostringstream builder;
+ builder << "not " << snowhouse::Stringize(expression.m_expression);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/orexpression.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/orexpression.h
new file mode 100644
index 00000000..c1b6c12b
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/expressions/orexpression.h
@@ -0,0 +1,46 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_OREXPRESSION_H
+#define IGLOO_OREXPRESSION_H
+
+#include "./expression_fwd.h"
+
+namespace snowhouse {
+
+ template< typename LeftExpression, typename RightExpression >
+ struct OrExpression : Expression< OrExpression<LeftExpression, RightExpression> >
+ {
+ OrExpression(const LeftExpression& left, const RightExpression& right)
+ : m_left(left)
+ , m_right(right)
+ {
+ }
+
+ template< typename ActualType >
+ bool operator()(const ActualType& actual) const
+ {
+ return (m_left(actual) || m_right(actual));
+ }
+
+ LeftExpression m_left;
+ RightExpression m_right;
+ };
+
+ template< typename LeftExpression, typename RightExpression >
+ struct Stringizer< OrExpression<LeftExpression, RightExpression> >
+ {
+ static std::string ToString(const OrExpression<LeftExpression, RightExpression>& expression)
+ {
+ std::ostringstream builder;
+ builder << snowhouse::Stringize(expression.m_left) << " or " << snowhouse::Stringize(expression.m_right);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/fulfillsconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/fulfillsconstraint.h
new file mode 100644
index 00000000..577056c1
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/fulfillsconstraint.h
@@ -0,0 +1,51 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef FULFILLSCONSTRAINT_H
+#define FULFILLSCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename MatcherType >
+ struct FulfillsConstraint : Expression< FulfillsConstraint<MatcherType> >
+ {
+ FulfillsConstraint(const MatcherType& matcher)
+ : m_matcher(matcher)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return m_matcher.Matches(actual);
+ }
+
+ MatcherType m_matcher;
+ };
+
+ template< typename MatcherType >
+ inline FulfillsConstraint<MatcherType> Fulfills(const MatcherType& matcher)
+ {
+ return FulfillsConstraint<MatcherType>(matcher);
+ }
+
+ template< typename MatcherType >
+ struct Stringizer< FulfillsConstraint< MatcherType > >
+ {
+ static std::string ToString(const FulfillsConstraint<MatcherType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << snowhouse::Stringize(constraint.m_matcher);
+
+ return builder.str();
+ }
+ };
+
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/haslengthconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/haslengthconstraint.h
new file mode 100644
index 00000000..fb6e7cc9
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/haslengthconstraint.h
@@ -0,0 +1,60 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_HASLENGTHCONSTRAINT_H
+#define IGLOO_HASLENGTHCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template <typename ExpectedType>
+ struct HasLengthConstraint : Expression< HasLengthConstraint<ExpectedType> >
+ {
+ HasLengthConstraint(const ExpectedType& expected)
+ : m_expected(expected) {}
+
+ template <typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ typedef typename ActualType::size_type SizeType;
+ SizeType expectedSize = static_cast<SizeType>(m_expected);
+ return (actual.size() == expectedSize);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline HasLengthConstraint<ExpectedType> HasLength(const ExpectedType& expected)
+ {
+ return HasLengthConstraint<ExpectedType>(expected);
+ }
+
+ inline HasLengthConstraint<int> IsEmpty()
+ {
+ return HasLength<int>(0);
+ }
+
+ inline HasLengthConstraint<std::string> HasLength(const char* expected)
+ {
+ return HasLengthConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< HasLengthConstraint< ExpectedType > >
+ {
+ static std::string ToString(const HasLengthConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "of length " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanconstraint.h
new file mode 100644
index 00000000..e7ef01f8
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanconstraint.h
@@ -0,0 +1,55 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ISGREATERTHANCONSTRAINT_H
+#define IGLOO_ISGREATERTHANCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType >
+ struct IsGreaterThanConstraint : Expression< IsGreaterThanConstraint<ExpectedType> >
+ {
+ IsGreaterThanConstraint(const ExpectedType& expected)
+ : m_expected(expected)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return (actual > m_expected);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline IsGreaterThanConstraint<ExpectedType> IsGreaterThan(const ExpectedType& expected)
+ {
+ return IsGreaterThanConstraint<ExpectedType>(expected);
+ }
+
+ inline IsGreaterThanConstraint<std::string> IsGreaterThan(const char* expected)
+ {
+ return IsGreaterThanConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< IsGreaterThanConstraint< ExpectedType > >
+ {
+ static std::string ToString(const IsGreaterThanConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "greater than " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanorequaltoconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanorequaltoconstraint.h
new file mode 100644
index 00000000..3752887b
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/isgreaterthanorequaltoconstraint.h
@@ -0,0 +1,55 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ISGREATERTHANOREQUALTOCONSTRAINT_H
+#define IGLOO_ISGREATERTHANOREQUALTOCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType >
+ struct IsGreaterThanOrEqualToConstraint : Expression < IsGreaterThanOrEqualToConstraint<ExpectedType> >
+ {
+ IsGreaterThanOrEqualToConstraint(const ExpectedType& expected)
+ : m_expected(expected)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return (actual >= m_expected);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline IsGreaterThanOrEqualToConstraint<ExpectedType> IsGreaterThanOrEqualTo(const ExpectedType& expected)
+ {
+ return IsGreaterThanOrEqualToConstraint<ExpectedType>(expected);
+ }
+
+ inline IsGreaterThanOrEqualToConstraint<std::string> IsGreaterThanOrEqualTo(const char* expected)
+ {
+ return IsGreaterThanOrEqualToConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer < IsGreaterThanOrEqualToConstraint< ExpectedType > >
+ {
+ static std::string ToString(const IsGreaterThanOrEqualToConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "greater than or equal to " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanconstraint.h
new file mode 100644
index 00000000..7379dcf7
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanconstraint.h
@@ -0,0 +1,54 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ISLESSTHANCONSTRAINT_H
+#define IGLOO_ISLESSTHANCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType >
+ struct IsLessThanConstraint : Expression< IsLessThanConstraint<ExpectedType> >
+ {
+ IsLessThanConstraint(const ExpectedType& expected)
+ : m_expected(expected)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return (actual < m_expected);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline IsLessThanConstraint<ExpectedType> IsLessThan(const ExpectedType& expected)
+ {
+ return IsLessThanConstraint<ExpectedType>(expected);
+ }
+
+ inline IsLessThanConstraint<std::string> IsLessThan(const char* expected)
+ {
+ return IsLessThanConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< IsLessThanConstraint< ExpectedType > >
+ {
+ static std::string ToString(const IsLessThanConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "less than " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanorequaltoconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanorequaltoconstraint.h
new file mode 100644
index 00000000..36e02ab4
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/islessthanorequaltoconstraint.h
@@ -0,0 +1,55 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ISLESSTHANOREQUALTOCONSTRAINT_H
+#define IGLOO_ISLESSTHANOREQUALTOCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template< typename ExpectedType >
+ struct IsLessThanOrEqualToConstraint : Expression < IsLessThanOrEqualToConstraint<ExpectedType> >
+ {
+ IsLessThanOrEqualToConstraint(const ExpectedType& expected)
+ : m_expected(expected)
+ {
+ }
+
+ template<typename ActualType>
+ bool operator()(const ActualType& actual) const
+ {
+ return (actual <= m_expected);
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline IsLessThanOrEqualToConstraint<ExpectedType> IsLessThanOrEqualTo(const ExpectedType& expected)
+ {
+ return IsLessThanOrEqualToConstraint<ExpectedType>(expected);
+ }
+
+ inline IsLessThanOrEqualToConstraint<std::string> IsLessThanOrEqualTo(const char* expected)
+ {
+ return IsLessThanOrEqualToConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer < IsLessThanOrEqualToConstraint< ExpectedType > >
+ {
+ static std::string ToString(const IsLessThanOrEqualToConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "less than or equal to " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/startswithconstraint.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/startswithconstraint.h
new file mode 100644
index 00000000..ffdd1696
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/constraints/startswithconstraint.h
@@ -0,0 +1,52 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_STARTSWITHCONSTRAINT_H
+#define IGLOO_STARTSWITHCONSTRAINT_H
+
+#include "./expressions/expression.h"
+
+namespace snowhouse {
+
+ template <typename ExpectedType>
+ struct StartsWithConstraint : Expression< StartsWithConstraint<ExpectedType> >
+ {
+ StartsWithConstraint(const ExpectedType& expected)
+ : m_expected(expected) {}
+
+ bool operator()(const std::string& actual) const
+ {
+ return actual.find(m_expected) == 0;
+ }
+
+ ExpectedType m_expected;
+ };
+
+ template< typename ExpectedType >
+ inline StartsWithConstraint<ExpectedType> StartsWith(const ExpectedType& expected)
+ {
+ return StartsWithConstraint<ExpectedType>(expected);
+ }
+
+ inline StartsWithConstraint<std::string> StartsWith(const char* expected)
+ {
+ return StartsWithConstraint<std::string>(expected);
+ }
+
+ template< typename ExpectedType >
+ struct Stringizer< StartsWithConstraint< ExpectedType > >
+ {
+ static std::string ToString(const StartsWithConstraint<ExpectedType>& constraint)
+ {
+ std::ostringstream builder;
+ builder << "starts with " << snowhouse::Stringize(constraint.m_expected);
+
+ return builder.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/exceptions.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/exceptions.h
new file mode 100644
index 00000000..22ad11ef
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/exceptions.h
@@ -0,0 +1,120 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EXCEPTIONS_H
+#define IGLOO_EXCEPTIONS_H
+
+#include "assert.h"
+
+namespace snowhouse {
+
+ template <typename ExceptionType>
+ class ExceptionStorage
+ {
+ public:
+ static void last_exception(ExceptionType*** e, bool clear=false)
+ {
+ static ExceptionType* last = NULL;
+ if(clear && last)
+ {
+ delete last;
+ return;
+ }
+
+ *e = &last;
+ silly_warning_about_unused_arg(e);
+ }
+
+ static ExceptionType*** silly_warning_about_unused_arg(ExceptionType*** e)
+ {
+ return e;
+ }
+
+ static void store(const ExceptionType& e)
+ {
+ ExceptionType** last = NULL;
+ last_exception(&last);
+ if(*last)
+ {
+ delete *last;
+ *last = NULL;
+ }
+
+ *last = new ExceptionType(e);
+ }
+
+ void compiler_thinks_i_am_unused() {}
+
+ ~ExceptionStorage()
+ {
+ ExceptionType** e = NULL;
+ last_exception(&e);
+ if(*e)
+ {
+ delete *e;
+ *e = NULL;
+ }
+ }
+ };
+
+ template <typename ExceptionType>
+ inline ExceptionType& LastException()
+ {
+ ExceptionType** e = NULL;
+ ExceptionStorage<ExceptionType>::last_exception(&e);
+ if(*e == NULL)
+ {
+ Assert::Failure("No exception was stored");
+ }
+
+ return **e;
+ }
+}
+
+#define IGLOO_CONCAT2(a, b) a##b
+#define IGLOO_CONCAT(a, b) IGLOO_CONCAT2(a, b)
+
+#define SNOWHOUSE_ASSERT_THROWS(EXCEPTION_TYPE, METHOD, FAILURE_HANDLER_TYPE) \
+::snowhouse::ExceptionStorage<EXCEPTION_TYPE> IGLOO_CONCAT(IGLOO_storage_, __LINE__); IGLOO_CONCAT(IGLOO_storage_, __LINE__).compiler_thinks_i_am_unused(); \
+{ \
+ bool wrong_exception = false; \
+ bool no_exception = false; \
+ try \
+ { \
+ METHOD; \
+ no_exception = true; \
+ } \
+ catch (const EXCEPTION_TYPE& e) \
+ { \
+ ::snowhouse::ExceptionStorage<EXCEPTION_TYPE>::store(e); \
+ } \
+ catch(...) \
+ { \
+ wrong_exception = true; \
+ } \
+ if(no_exception) \
+ { \
+ std::ostringstream stm; \
+ stm << "Expected " << #EXCEPTION_TYPE << ". No exception was thrown."; \
+ ::snowhouse::ConfigurableAssert<FAILURE_HANDLER_TYPE>::Failure(stm.str()); \
+ } \
+ if(wrong_exception) \
+ { \
+ std::ostringstream stm; \
+ stm << "Expected " << #EXCEPTION_TYPE << ". Wrong exception was thrown."; \
+ ::snowhouse::ConfigurableAssert<FAILURE_HANDLER_TYPE>::Failure(stm.str()); \
+ } \
+}
+
+#ifndef SNOWHOUSE_NO_MACROS
+
+#define AssertThrows(EXCEPTION_TYPE, METHOD) SNOWHOUSE_ASSERT_THROWS(EXCEPTION_TYPE, (METHOD), ::snowhouse::DefaultFailureHandler)
+
+#endif // SNOWHOUSE_NO_MACROS
+
+#endif
+
+
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintadapter.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintadapter.h
new file mode 100644
index 00000000..b1719288
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintadapter.h
@@ -0,0 +1,39 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_CONSTRAINTADAPTER_H
+#define IGLOO_CONSTRAINTADAPTER_H
+
+namespace snowhouse {
+
+ template <typename ConstraintType>
+ struct ConstraintAdapter
+ {
+ ConstraintAdapter(const ConstraintType& constraint) : m_constraint(constraint)
+ {
+ }
+
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ result.push(m_constraint(actual));
+ EvaluateConstraintList(list.m_tail, result, operators, actual);
+ }
+
+ ConstraintType m_constraint;
+ };
+
+ template<typename ConstraintType>
+ struct Stringizer< ConstraintAdapter<ConstraintType> >
+ {
+ static std::string ToString(const ConstraintAdapter<ConstraintType>& constraintAdapter)
+ {
+ return snowhouse::Stringize(constraintAdapter.m_constraint);
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintlist.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintlist.h
new file mode 100644
index 00000000..1a62a60e
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/constraintlist.h
@@ -0,0 +1,91 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_CONSTRAINT_H
+#define IGLOO_CONSTRAINT_H
+
+namespace snowhouse {
+
+ struct ConstraintOperator;
+ typedef std::stack<bool> ResultStack;
+ typedef std::stack<ConstraintOperator*> OperatorStack;
+
+ template <typename HT, typename TT>
+ struct ConstraintList
+ {
+ typedef HT HeadType;
+ typedef TT TailType;
+
+ ConstraintList(const HeadType& head, const TailType& tail)
+ : m_head(head), m_tail(tail)
+ {
+ }
+
+ HeadType m_head;
+ TailType m_tail;
+ };
+
+ struct Nil
+ {
+ Nil() {}
+ Nil(const Nil&) {}
+ };
+
+
+ // ---- These structs defines the resulting types of list concatenation operations
+ template <typename L1, typename L2>
+ struct type_concat
+ {
+ typedef ConstraintList<typename L1::HeadType, typename type_concat<typename L1::TailType, L2>::t> t;
+ };
+
+ template <typename L2> struct type_concat<Nil, L2> { typedef L2 t; };
+
+ template <typename L3> inline L3 tr_concat(const Nil&, const Nil&) { return Nil(); }
+
+
+ // ---- These structs define the concatenation operations.
+
+ template <typename LeftList, typename RightList, typename ResultList>
+ struct ListConcat
+ {
+ static ResultList Concatenate(const LeftList& left, const RightList& right)
+ {
+ return ResultList(left.m_head, ListConcat<typename LeftList::TailType, RightList, typename type_concat< typename LeftList::TailType, RightList>::t>::Concatenate(left.m_tail, right));
+ }
+ };
+
+ // Concatenating an empty list with a second list yields the second list
+ template <typename RightList, typename ResultList>
+ struct ListConcat<Nil, RightList, ResultList>
+ {
+ static ResultList Concatenate(const Nil&, const RightList& right)
+ {
+ return right;
+ }
+
+ };
+
+ // Concatenating two empty lists yields an empty list
+ template <typename ResultList>
+ struct ListConcat<Nil, Nil, ResultList>
+ {
+ static ResultList Concatenate(const Nil&, const Nil&)
+ {
+ return Nil();
+ }
+ };
+
+ // ---- The concatenation operation
+
+ template <typename L1, typename L2>
+ inline typename type_concat<L1, L2>::t Concatenate(const L1& list1, const L2& list2)
+ {
+ return ListConcat<L1, L2, typename type_concat<L1, L2>::t>::Concatenate(list1, list2);
+ }
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/expressionbuilder.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/expressionbuilder.h
new file mode 100644
index 00000000..f0889f1d
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/expressionbuilder.h
@@ -0,0 +1,357 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EXPRESSIONBUILDER_H
+#define IGLOO_EXPRESSIONBUILDER_H
+
+#include <cstddef>
+
+namespace snowhouse {
+
+ // ---- Evaluation of list of constraints
+
+ template <typename ConstraintListType, typename ActualType>
+ inline void EvaluateConstraintList(ConstraintListType& constraint_list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ constraint_list.m_head.Evaluate(constraint_list, result, operators, actual);
+ }
+
+ template <typename ActualType>
+ inline void EvaluateConstraintList(Nil&, ResultStack&, OperatorStack&, const ActualType&) {}
+
+
+ template <typename ConstraintListType>
+ struct ExpressionBuilder
+ {
+ ExpressionBuilder(const ConstraintListType& list) : m_constraint_list(list)
+ {
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsConstraint<ExpectedType> >, Nil> >::t>
+ EqualTo(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<EqualsConstraint<ExpectedType> > ConstraintAdapterType;
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType, typename DeltaType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsWithDeltaConstraint<ExpectedType, DeltaType> >, Nil> >::t>
+ EqualToWithDelta(const ExpectedType& expected, const DeltaType& delta)
+ {
+ typedef ConstraintAdapter<EqualsWithDeltaConstraint<ExpectedType, DeltaType> > ConstraintAdapterType;
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+
+ ConstraintAdapterType constraint(EqualsWithDeltaConstraint<ExpectedType, DeltaType>(expected, delta));
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename MatcherType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<FulfillsConstraint<MatcherType> >, Nil> >::t>
+ Fulfilling(const MatcherType& matcher)
+ {
+ typedef ConstraintAdapter<FulfillsConstraint<MatcherType> > ConstraintAdapterType;
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+
+ ConstraintAdapterType constraint(matcher);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsConstraint<bool> >, Nil> >::t>
+ False()
+ {
+ return EqualTo<bool>(false);
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsConstraint<bool> >, Nil> >::t>
+ True()
+ {
+ return EqualTo<bool>(true);
+ }
+
+#if __cplusplus > 199711L
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsConstraint<std::nullptr_t> >, Nil> >::t>
+ Null()
+ {
+ return EqualTo<std::nullptr_t>(nullptr);
+ }
+#endif
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsConstraint<std::string> >, Nil> >::t>
+ EqualTo(const char* expected)
+ {
+ return EqualTo<std::string>(std::string(expected));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<IsGreaterThanConstraint<ExpectedType> >, Nil> >::t>
+ GreaterThan(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<IsGreaterThanConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<IsGreaterThanOrEqualToConstraint<ExpectedType> >, Nil> >::t>
+ GreaterThanOrEqualTo(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<IsGreaterThanOrEqualToConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<IsLessThanConstraint<ExpectedType> >, Nil> >::t>
+ LessThan(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<IsLessThanConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<IsLessThanOrEqualToConstraint<ExpectedType> >, Nil> >::t>
+ LessThanOrEqualTo(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<IsLessThanOrEqualToConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<ContainsConstraint<ExpectedType> >, Nil> >::t>
+ Containing(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<ContainsConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<ContainsConstraint<std::string> >, Nil> >::t>
+ Containing(const char* expected)
+ {
+ return Containing<std::string>(std::string(expected));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EndsWithConstraint<ExpectedType> >, Nil> >::t>
+ EndingWith(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<EndsWithConstraint<ExpectedType> > ConstraintAdapterType;
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EndsWithConstraint<std::string> >, Nil> >::t>
+ EndingWith(const char* expected)
+ {
+ return EndingWith(std::string(expected));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<StartsWithConstraint<ExpectedType> >, Nil> >::t>
+ StartingWith(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<StartsWithConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<StartsWithConstraint<std::string> >, Nil> >::t>
+ StartingWith(const char* expected)
+ {
+ return StartingWith(std::string(expected));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<HasLengthConstraint<ExpectedType> >, Nil> >::t>
+ OfLength(const ExpectedType& expected)
+ {
+ typedef ConstraintAdapter<HasLengthConstraint<ExpectedType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(expected);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<HasLengthConstraint<int> >, Nil> >::t>
+ Empty()
+ {
+ typedef ConstraintAdapter<HasLengthConstraint<int> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(0);
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsContainerConstraint<ExpectedType, bool (*)(const typename ExpectedType::value_type&, const typename ExpectedType::value_type&)> >, Nil> >::t>
+ EqualToContainer(const ExpectedType& expected)
+ {
+ typedef bool (*DefaultBinaryPredivateType)(const typename ExpectedType::value_type&, const typename ExpectedType::value_type&);
+ typedef ConstraintAdapter<EqualsContainerConstraint<ExpectedType, DefaultBinaryPredivateType> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(EqualsContainerConstraint<ExpectedType, DefaultBinaryPredivateType>(expected, constraint_internal::default_comparer<typename ExpectedType::value_type>));
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ExpectedType, typename BinaryPredicate>
+ ExpressionBuilder<typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapter<EqualsContainerConstraint<ExpectedType, BinaryPredicate> >, Nil> >::t>
+ EqualToContainer(const ExpectedType& expected, const BinaryPredicate predicate)
+ {
+ typedef ConstraintAdapter<EqualsContainerConstraint<ExpectedType, BinaryPredicate> > ConstraintAdapterType;
+
+ typedef ExpressionBuilder< typename type_concat<ConstraintListType, ConstraintList<ConstraintAdapterType, Nil> >::t > BuilderType;
+ ConstraintAdapterType constraint(EqualsContainerConstraint<ExpectedType, BinaryPredicate>(expected, predicate));
+ ConstraintList<ConstraintAdapterType, Nil> node(constraint, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ typedef ConstraintList<AndOperator, Nil> AndOperatorNode;
+ typedef ConstraintList<OrOperator, Nil> OrOperatorNode;
+ typedef ConstraintList<NotOperator, Nil> NotOperatorNode;
+ typedef ConstraintList<AllOperator, Nil> AllOperatorNode;
+ typedef ConstraintList<AtLeastOperator, Nil> AtLeastOperatorNode;
+ typedef ConstraintList<ExactlyOperator, Nil> ExactlyOperatorNode;
+ typedef ConstraintList<AtMostOperator, Nil> AtMostOperatorNode;
+ typedef ConstraintList<NoneOperator, Nil> NoneOperatorNode;
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, AllOperatorNode>::t> All()
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, AllOperatorNode>::t> BuilderType;
+ AllOperator op;
+ AllOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, AtLeastOperatorNode>::t> AtLeast(unsigned int expected)
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, AtLeastOperatorNode>::t> BuilderType;
+ AtLeastOperator op(expected);
+ AtLeastOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, ExactlyOperatorNode>::t> Exactly(unsigned int expected)
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, ExactlyOperatorNode>::t> BuilderType;
+ ExactlyOperator op(expected);
+ ExactlyOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, AtMostOperatorNode>::t> AtMost(unsigned int expected)
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, AtMostOperatorNode>::t> BuilderType;
+ AtMostOperator op(expected);
+ AtMostOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, NoneOperatorNode>::t> None()
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, NoneOperatorNode>::t> BuilderType;
+ NoneOperator op;
+ NoneOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, AndOperatorNode>::t> And()
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, AndOperatorNode>::t> BuilderType;
+ AndOperator op;
+ AndOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, OrOperatorNode>::t> Or()
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, OrOperatorNode>::t> BuilderType;
+ OrOperator op;
+ OrOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ ExpressionBuilder<typename type_concat<ConstraintListType, NotOperatorNode>::t> Not()
+ {
+ typedef ExpressionBuilder<typename type_concat<ConstraintListType, NotOperatorNode>::t> BuilderType;
+ NotOperator op;
+ NotOperatorNode node(op, Nil());
+ return BuilderType(Concatenate(m_constraint_list, node));
+ }
+
+ template <typename ActualType>
+ void Evaluate(ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ EvaluateConstraintList(m_constraint_list, result, operators, actual);
+ }
+
+ ConstraintListType m_constraint_list;
+ };
+
+ template <typename T>
+ inline void StringizeConstraintList(const T& list, std::ostringstream& stm)
+ {
+ if (stm.tellp() > 0)
+ stm << " ";
+
+ stm << snowhouse::Stringize(list.m_head);
+ StringizeConstraintList(list.m_tail, stm);
+ }
+
+ inline void StringizeConstraintList(const Nil&, std::ostringstream&)
+ {
+ }
+
+ template<typename ConstraintListType>
+ struct Stringizer< ExpressionBuilder<ConstraintListType> >
+ {
+ static std::string ToString(const ExpressionBuilder<ConstraintListType>& builder)
+ {
+ std::ostringstream stm;
+ StringizeConstraintList(builder.m_constraint_list, stm);
+
+ return stm.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/fluent.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/fluent.h
new file mode 100644
index 00000000..6bbd4b81
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/fluent.h
@@ -0,0 +1,38 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_FLUENT_H
+#define IGLOO_FLUENT_H
+
+#include "constraintlist.h"
+#include "constraintadapter.h"
+#include "operators/constraintoperator.h"
+#include "operators/andoperator.h"
+#include "operators/oroperator.h"
+#include "operators/collections/collectionconstraintevaluator.h"
+#include "operators/collections/alloperator.h"
+#include "operators/collections/noneoperator.h"
+#include "operators/collections/atleastoperator.h"
+#include "operators/collections/exactlyoperator.h"
+#include "operators/collections/atmostoperator.h"
+#include "operators/notoperator.h"
+#include "expressionbuilder.h"
+
+namespace snowhouse {
+
+ inline ExpressionBuilder<Nil> Is()
+ {
+ return ExpressionBuilder<Nil>(Nil());
+ }
+
+ inline ExpressionBuilder<Nil> Has()
+ {
+ return ExpressionBuilder<Nil>(Nil());
+ }
+
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/andoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/andoperator.h
new file mode 100644
index 00000000..39670632
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/andoperator.h
@@ -0,0 +1,54 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ANDOPERATOR_H
+#define IGLOO_ANDOPERATOR_H
+
+namespace snowhouse {
+
+ struct AndOperator : public ConstraintOperator
+ {
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ EvaluateOperatorsWithLessOrEqualPrecedence(*this, operators, result);
+
+ operators.push(this);
+
+ EvaluateConstraintList(list.m_tail, result, operators, actual);
+ }
+
+ void PerformOperation(ResultStack& result)
+ {
+ if(result.size() < 2)
+ {
+ throw InvalidExpressionException("The expression contains an and operator with too few operands");
+ }
+
+ bool right = result.top();
+ result.pop();
+ bool left = result.top();
+ result.pop();
+
+ result.push(left && right);
+ }
+
+ int Precedence() const
+ {
+ return 3;
+ }
+ };
+
+ template<>
+ struct Stringizer<AndOperator>
+ {
+ static std::string ToString(const AndOperator&)
+ {
+ return "and";
+ }
+ };
+}
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/alloperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/alloperator.h
new file mode 100644
index 00000000..4157faf9
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/alloperator.h
@@ -0,0 +1,35 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ALLOPERATOR_H
+#define IGLOO_ALLOPERATOR_H
+
+#include "collectionoperator.h"
+
+namespace snowhouse {
+
+ struct AllOperator : public CollectionOperator
+ {
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ unsigned int passed_elements = CollectionConstraintEvaluator<ConstraintListType, ActualType>::Evaluate(*this, list, result, operators, actual);
+
+ result.push(passed_elements == actual.size());
+ }
+ };
+
+ template<>
+ struct Stringizer<AllOperator>
+ {
+ static std::string ToString(const AllOperator&)
+ {
+ return "all";
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atleastoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atleastoperator.h
new file mode 100644
index 00000000..d46e697f
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atleastoperator.h
@@ -0,0 +1,41 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ATLEASTOPERATOR_H
+#define IGLOO_ATLEASTOPERATOR_H
+
+#include "collectionoperator.h"
+
+namespace snowhouse {
+
+ struct AtLeastOperator : public CollectionOperator
+ {
+ AtLeastOperator(unsigned int expected) : m_expected(expected) {}
+
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ unsigned int passed_elements = CollectionConstraintEvaluator<ConstraintListType, ActualType>::Evaluate(*this, list, result, operators, actual);
+
+ result.push(passed_elements >= m_expected);
+ }
+
+ unsigned int m_expected;
+ };
+
+ template<>
+ struct Stringizer<AtLeastOperator>
+ {
+ static std::string ToString(const AtLeastOperator& op)
+ {
+ std::ostringstream stm;
+ stm << "at least " << op.m_expected;
+ return stm.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atmostoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atmostoperator.h
new file mode 100644
index 00000000..53debbc8
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/atmostoperator.h
@@ -0,0 +1,39 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_ATMOSTOPERATOR_H
+#define IGLOO_ATMOSTOPERATOR_H
+
+namespace snowhouse {
+
+ struct AtMostOperator : public CollectionOperator
+ {
+ AtMostOperator(unsigned int expected) : m_expected(expected) {}
+
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ unsigned int passed_elements = CollectionConstraintEvaluator<ConstraintListType, ActualType>::Evaluate(*this, list, result, operators, actual);
+
+ result.push(passed_elements <= m_expected);
+ }
+
+ unsigned int m_expected;
+ };
+
+ template<>
+ struct Stringizer<AtMostOperator>
+ {
+ static std::string ToString(const AtMostOperator& op)
+ {
+ std::ostringstream stm;
+ stm << "at most " << op.m_expected;
+ return stm.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h
new file mode 100644
index 00000000..3fa30f2c
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionconstraintevaluator.h
@@ -0,0 +1,113 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_COLLECTIONCONSTRAINTEVALUATOR_H
+#define IGLOO_COLLECTIONCONSTRAINTEVALUATOR_H
+
+#include <string>
+#include "../invalidexpressionexception.h"
+
+namespace snowhouse
+{
+
+template<typename ConstraintListType, typename ActualType>
+struct CollectionConstraintEvaluator
+{
+ static unsigned int Evaluate(const ConstraintOperator& op,
+ ConstraintListType& expression, ResultStack& result,
+ OperatorStack& operators, const ActualType& actual)
+ {
+ ConstraintOperator::EvaluateOperatorsWithLessOrEqualPrecedence(op,
+ operators, result);
+
+ unsigned int passed_elements = 0;
+ typename ActualType::const_iterator it;
+ for(it = actual.begin(); it != actual.end(); it++)
+ {
+ if(ConstraintOperator::EvaluateElementAgainstRestOfExpression(expression,
+ *it))
+ {
+ passed_elements++;
+ }
+ }
+
+ return passed_elements;
+ }
+};
+
+struct StringLineParser
+{
+ static void Parse(const std::string& str, std::vector<std::string>& res)
+ {
+ size_t start = 0;
+ size_t newline = FindNewline(str, start);
+
+ while(newline != std::string::npos)
+ {
+ StoreLine(str, start, newline, res);
+ start = MoveToNextLine(str, newline);
+ newline = FindNewline(str, start);
+ }
+
+ if(start < str.size())
+ {
+ StoreLine(str, start, std::string::npos, res);
+ }
+ }
+
+private:
+ static size_t FindNewline(const std::string& str, size_t start)
+ {
+ return str.find_first_of("\r\n", start);
+ }
+
+ static void StoreLine(const std::string& str, size_t start, size_t end,
+ std::vector<std::string>& res)
+ {
+ std::string line = str.substr(start, end - start);
+ res.push_back(line);
+ }
+
+ static size_t MoveToNextLine(const std::string& str, size_t newline)
+ {
+ if(str.find("\r\n", newline) == newline)
+ {
+ return newline + 2;
+ }
+
+ if(str.find("\n", newline) == newline)
+ {
+ return newline + 1;
+ }
+
+ if(str.find("\r", newline) == newline)
+ {
+ return newline + 1;
+ }
+
+ std::ostringstream stm;
+ stm << "This string seems to contain an invalid line ending at position "
+ << newline << ":\n" << str << std::endl;
+ throw InvalidExpressionException(stm.str());
+ }
+};
+
+template<typename ConstraintListType>
+struct CollectionConstraintEvaluator<ConstraintListType, std::string>
+{
+ static unsigned int Evaluate(const ConstraintOperator& op,
+ ConstraintListType& expression, ResultStack& result,
+ OperatorStack& operators, const std::string& actual)
+ {
+ std::vector<std::string> lines;
+ StringLineParser::Parse(actual, lines);
+ return CollectionConstraintEvaluator<ConstraintListType, std::vector<std::string> >::Evaluate(op, expression, result, operators, lines);
+ }
+};
+
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionoperator.h
new file mode 100644
index 00000000..c1bb8bec
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/collectionoperator.h
@@ -0,0 +1,24 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_COLLECTIONOPERATOR_H
+#define IGLOO_COLLECTIONOPERATOR_H
+
+namespace snowhouse {
+ struct CollectionOperator : public ConstraintOperator
+ {
+ void PerformOperation(ResultStack&)
+ {
+ }
+
+ int Precedence() const
+ {
+ return 1;
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/exactlyoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/exactlyoperator.h
new file mode 100644
index 00000000..81c2dcaa
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/exactlyoperator.h
@@ -0,0 +1,39 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_EXACTLYOPERATOR_H
+#define IGLOO_EXACTLYOPERATOR_H
+
+namespace snowhouse {
+
+ struct ExactlyOperator : public CollectionOperator
+ {
+ ExactlyOperator(unsigned int expected) : m_expected(expected) {}
+
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ unsigned int passed_elements = CollectionConstraintEvaluator<ConstraintListType, ActualType>::Evaluate(*this, list, result, operators, actual);
+
+ result.push(passed_elements == m_expected);
+ }
+
+ unsigned int m_expected;
+ };
+
+ template<>
+ struct Stringizer< ExactlyOperator >
+ {
+ static std::string ToString(const ExactlyOperator& op)
+ {
+ std::ostringstream stm;
+ stm << "exactly " << op.m_expected;
+ return stm.str();
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/noneoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/noneoperator.h
new file mode 100644
index 00000000..c4570915
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/collections/noneoperator.h
@@ -0,0 +1,33 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_NONEOPERATOR_H
+#define IGLOO_NONEOPERATOR_H
+
+namespace snowhouse {
+
+ struct NoneOperator : public CollectionOperator
+ {
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ unsigned int passed_elements = CollectionConstraintEvaluator<ConstraintListType, ActualType>::Evaluate(*this, list, result, operators, actual);
+ result.push(passed_elements == 0);
+ }
+ };
+
+ template<>
+ struct Stringizer<NoneOperator>
+ {
+ static std::string ToString(const NoneOperator&)
+ {
+ return "none";
+ }
+ };
+
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/constraintoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/constraintoperator.h
new file mode 100644
index 00000000..eafe6c51
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/constraintoperator.h
@@ -0,0 +1,70 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_CONTRAINTOPERATOR_H
+#define IGLOO_CONTRAINTOPERATOR_H
+
+#include "invalidexpressionexception.h"
+
+namespace snowhouse {
+
+ struct ConstraintOperator
+ {
+#if __cplusplus > 199711L
+#else
+ virtual ~ConstraintOperator() {}
+#endif
+
+ virtual void PerformOperation(ResultStack& result) = 0;
+ virtual int Precedence() const = 0;
+
+ template <typename ConstraintListType, typename ActualType>
+ static bool EvaluateElementAgainstRestOfExpression(ConstraintListType& list, const ActualType& actual)
+ {
+ ResultStack innerResult;
+ OperatorStack innerOperators;
+
+ EvaluateConstraintList(list.m_tail, innerResult, innerOperators, actual);
+ EvaluateAllOperatorsOnStack(innerOperators, innerResult);
+
+ if(innerResult.empty())
+ {
+ throw InvalidExpressionException("The expression after \"" + snowhouse::Stringize(list.m_head) + "\" operator does not yield any result");
+ }
+
+ return innerResult.top();
+ }
+
+ static void EvaluateOperatorsWithLessOrEqualPrecedence(const ConstraintOperator& op, OperatorStack& operators, ResultStack& result)
+ {
+ while(!operators.empty())
+ {
+ ConstraintOperator* op_from_stack = operators.top();
+
+ if(op_from_stack->Precedence() > op.Precedence())
+ {
+ break;
+ }
+
+ op_from_stack->PerformOperation(result);
+ operators.pop();
+ }
+ }
+
+ static void EvaluateAllOperatorsOnStack(OperatorStack& operators, ResultStack& result)
+ {
+ while(!operators.empty())
+ {
+ ConstraintOperator* op = operators.top();
+ op->PerformOperation(result);
+ operators.pop();
+ }
+ }
+ };
+
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/invalidexpressionexception.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/invalidexpressionexception.h
new file mode 100644
index 00000000..404341f1
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/invalidexpressionexception.h
@@ -0,0 +1,28 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_INVALUDEXPRESSIONEXCEPTION_H
+#define IGLOO_INVALUDEXPRESSIONEXCEPTION_H
+
+namespace snowhouse {
+
+ struct InvalidExpressionException
+ {
+ InvalidExpressionException(const std::string& message) : m_message(message)
+ {
+ }
+
+ const std::string& Message() const
+ {
+ return m_message;
+ }
+
+ std::string m_message;
+ };
+
+}
+
+#endif // IGLOO_INVALUDEXPRESSIONEXCEPTION_H
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/notoperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/notoperator.h
new file mode 100644
index 00000000..709c8413
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/notoperator.h
@@ -0,0 +1,53 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_NOTOPERATOR_H
+#define IGLOO_NOTOPERATOR_H
+
+namespace snowhouse {
+
+ struct NotOperator : public ConstraintOperator
+ {
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ EvaluateOperatorsWithLessOrEqualPrecedence(*this, operators, result);
+
+ operators.push(this);
+
+ EvaluateConstraintList(list.m_tail, result, operators, actual);
+ }
+
+ void PerformOperation(ResultStack& result)
+ {
+ if(result.size() < 1)
+ {
+ throw InvalidExpressionException("The expression contains a not operator without any operand");
+ }
+
+ bool right = result.top();
+ result.pop();
+
+ result.push(!right);
+ }
+
+ int Precedence() const
+ {
+ return 2;
+ }
+ };
+
+ template<>
+ struct Stringizer<NotOperator>
+ {
+ static std::string ToString(const NotOperator&)
+ {
+ return "not";
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/oroperator.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/oroperator.h
new file mode 100644
index 00000000..5a307ff6
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/fluent/operators/oroperator.h
@@ -0,0 +1,55 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_OROPERATOR_H
+#define IGLOO_OROPERATOR_H
+
+namespace snowhouse {
+
+ struct OrOperator : public ConstraintOperator
+ {
+ template <typename ConstraintListType, typename ActualType>
+ void Evaluate(ConstraintListType& list, ResultStack& result, OperatorStack& operators, const ActualType& actual)
+ {
+ EvaluateOperatorsWithLessOrEqualPrecedence(*this, operators, result);
+
+ operators.push(this);
+
+ EvaluateConstraintList(list.m_tail, result, operators, actual);
+ }
+
+ void PerformOperation(ResultStack& result)
+ {
+ if(result.size() < 2)
+ {
+ throw InvalidExpressionException("The expression contains an or operator with too few operands");
+ }
+
+ bool right = result.top();
+ result.pop();
+ bool left = result.top();
+ result.pop();
+
+ result.push(left || right);
+ }
+
+ int Precedence() const
+ {
+ return 4;
+ }
+ };
+
+ template<>
+ struct Stringizer<OrOperator>
+ {
+ static std::string ToString(const OrOperator&)
+ {
+ return "or";
+ }
+ };
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/snowhouse.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/snowhouse.h
new file mode 100644
index 00000000..38214aa7
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/snowhouse.h
@@ -0,0 +1,33 @@
+#ifndef _SNOWHOUSE_H_JK_2013_06_28
+#define _SNOWHOUSE_H_JK_2013_06_28
+
+#define SNOWHOUSE_VERSION "2.1.0"
+
+#if __cplusplus > 199711L
+#ifdef _MSC_VER
+// Visual Studio (including 2013) does not support the noexcept keyword
+#define _ALLOW_KEYWORD_MACROS
+#define noexcept
+#endif
+#endif
+
+
+#include <iostream>
+#include <map>
+#include <vector>
+#include <sstream>
+#include <stack>
+#include <list>
+#include <memory>
+#include <algorithm>
+
+#include "stringize.h"
+#include "constraints/constraints.h"
+#include "fluent/fluent.h"
+#include "assertionexception.h"
+#include "assert.h"
+#include "assertmacro.h"
+#include "exceptions.h"
+
+#endif
+
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringize.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringize.h
new file mode 100644
index 00000000..42249f57
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringize.h
@@ -0,0 +1,104 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_STRINGIZE_H
+#define IGLOO_STRINGIZE_H
+
+#include <cstddef>
+
+namespace snowhouse {
+ namespace detail {
+
+ // This type soaks up any implicit conversions and makes the following operator<<
+ // less preferred than any other such operator found via ADL.
+ struct any
+ {
+ // Conversion constructor for any type.
+ template <class T>
+ any(T const&);
+ };
+
+ // A tag type returned by operator<< for the any struct in this namespace
+ // when T does not support <<.
+ struct tag {};
+
+ // Fallback operator<< for types T that don't support <<.
+ tag operator<<(std::ostream&, any const&);
+
+ // Two overloads to distinguish whether T supports a certain operator expression.
+ // The first overload returns a reference to a two-element character array and is chosen if
+ // T does not support the expression, such as <<, whereas the second overload returns a char
+ // directly and is chosen if T supports the expression. So using sizeof(check(<expression>))
+ // returns 2 for the first overload and 1 for the second overload.
+ typedef char yes;
+ typedef char (&no)[2];
+
+ no check(tag);
+
+ template <class T>
+ yes check(T const&);
+
+ template <class T>
+ struct is_output_streamable
+ {
+ static const T& x;
+ static const bool value = sizeof(check(std::cout << x)) == sizeof(yes);
+ };
+
+ template<typename T, bool type_is_streamable>
+ struct DefaultStringizer
+ {
+ static std::string ToString(const T& value)
+ {
+ std::ostringstream buf;
+ buf << value;
+ return buf.str();
+ }
+ };
+
+ template<typename T>
+ struct DefaultStringizer<T, false>
+ {
+ static std::string ToString(const T&)
+ {
+ return "[unsupported type]";
+ }
+ };
+ }
+
+ template<typename T>
+ struct Stringizer;
+
+ template<typename T>
+ std::string Stringize(const T& value)
+ {
+ return Stringizer<T>::ToString(value);
+ }
+
+ // NOTE: Specialize snowhouse::Stringizer to customize assertion messages
+ template<typename T>
+ struct Stringizer
+ {
+ static std::string ToString(const T& value)
+ {
+ return detail::DefaultStringizer< T, detail::is_output_streamable<T>::value >::ToString(value);
+ }
+ };
+
+#if __cplusplus > 199711L
+ // We need this because nullptr_t has ambiguous overloads of operator<< in the standard library.
+ template<>
+ struct Stringizer<std::nullptr_t>
+ {
+ static std::string ToString(std::nullptr_t)
+ {
+ return "nullptr";
+ }
+ };
+#endif
+}
+
+#endif
diff --git a/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringizers.h b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringizers.h
new file mode 100644
index 00000000..79a416de
--- /dev/null
+++ b/vendor/bandit/bandit/assertion_frameworks/snowhouse/snowhouse/stringizers.h
@@ -0,0 +1,60 @@
+
+// Copyright Joakim Karlsson & Kim Gräsman 2010-2012.
+// Distributed under the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE_1_0.txt or copy at
+// http://www.boost.org/LICENSE_1_0.txt)
+
+#ifndef IGLOO_STRINGIZERS_H
+#define IGLOO_STRINGIZERS_H
+
+namespace snowhouse
+{
+
+ namespace detail
+ {
+
+ template<typename Container>
+ struct SequentialContainerStringizer
+ {
+ static std::string
+ ToString(const Container& cont)
+ {
+ std::ostringstream stm;
+ typedef typename Container::const_iterator Iterator;
+
+ stm << "[ ";
+ for (Iterator it = cont.begin(); it != cont.end();)
+ {
+ stm << snowhouse::Stringize(*it);
+
+ if (++it != cont.end())
+ {
+ stm << ", ";
+ }
+ }
+ stm << " ]";
+ return stm.str();
+ }
+ };
+ }
+
+ template<typename T>
+ struct Stringizer<std::vector<T> > : detail::SequentialContainerStringizer<
+ std::vector<T> >
+ {
+ };
+
+ template<typename T>
+ struct Stringizer<std::deque<T> > : detail::SequentialContainerStringizer<
+ std::deque<T> >
+ {
+ };
+
+ template<typename T>
+ struct Stringizer<std::list<T> > : detail::SequentialContainerStringizer<
+ std::list<T> >
+ {
+ };
+}
+
+#endif