diff options
author | Manoj Srivastava <srivasta@debian.org> | 2016-01-27 12:43:59 -0800 |
---|---|---|
committer | Manoj Srivastava <srivasta@debian.org> | 2016-01-27 12:50:09 -0800 |
commit | 76fce162659078323fcd5e54b3195dae371faca2 (patch) | |
tree | c1d93d415b96238aae3c54eb83cb0815af2e4bca /vendor/bandit/bandit/adapters | |
parent | b4456969cd02d75c599a5b86b225c0774697e85d (diff) | |
parent | 4aa1a39402c3908e9e8b6eb3fd4e2183d5e5c52e (diff) |
Merge branch 'development' into upstream
Signed-off-by: Manoj Srivastava <srivasta@debian.org>
# Conflicts:
# src/.gitignore
# src/maid-x11.c
# src/quest.pkg
Diffstat (limited to 'vendor/bandit/bandit/adapters')
-rw-r--r-- | vendor/bandit/bandit/adapters/adapter.h | 12 | ||||
-rw-r--r-- | vendor/bandit/bandit/adapters/adapters.h | 16 | ||||
-rw-r--r-- | vendor/bandit/bandit/adapters/snowhouse.h | 22 |
3 files changed, 50 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/adapters/adapter.h b/vendor/bandit/bandit/adapters/adapter.h new file mode 100644 index 00000000..809212a1 --- /dev/null +++ b/vendor/bandit/bandit/adapters/adapter.h @@ -0,0 +1,12 @@ +#ifndef BANDIT_ADAPTER_H +#define BANDIT_ADAPTER_H + +namespace bandit { namespace adapters { + + struct assertion_adapter + { + virtual void adapt_exceptions(detail::voidfunc_t) = 0; + }; +}} + +#endif diff --git a/vendor/bandit/bandit/adapters/adapters.h b/vendor/bandit/bandit/adapters/adapters.h new file mode 100644 index 00000000..fbfddaea --- /dev/null +++ b/vendor/bandit/bandit/adapters/adapters.h @@ -0,0 +1,16 @@ +#ifndef BANDIT_ADAPTERS_H +#define BANDIT_ADAPTERS_H + +#include <bandit/adapters/adapter.h> +#include <bandit/adapters/snowhouse.h> + +namespace bandit { namespace detail { + + inline bandit::adapters::assertion_adapter& registered_adapter() + { + static bandit::adapters::snowhouse_adapter adapter; + return adapter; + } +}} + +#endif diff --git a/vendor/bandit/bandit/adapters/snowhouse.h b/vendor/bandit/bandit/adapters/snowhouse.h new file mode 100644 index 00000000..f0776662 --- /dev/null +++ b/vendor/bandit/bandit/adapters/snowhouse.h @@ -0,0 +1,22 @@ +#ifndef BANDIT_ADAPTERS_SNOWHOUSE_H +#define BANDIT_ADAPTERS_SNOWHOUSE_H + +namespace bandit { namespace adapters { + + struct snowhouse_adapter : public assertion_adapter + { + void adapt_exceptions(detail::voidfunc_t func) + { + try + { + func(); + } + catch(const snowhouse::AssertionException& ex) + { + throw bandit::detail::assertion_exception(ex.GetMessage(), ex.GetFilename(), ex.GetLineNumber()); + } + } + }; + +}} +#endif |