diff options
Diffstat (limited to 'vendor/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h')
-rw-r--r-- | vendor/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/vendor/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h b/vendor/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h new file mode 100644 index 00000000..6ff3fdeb --- /dev/null +++ b/vendor/bandit/bandit/failure_formatters/visual_studio_failure_formatter.h @@ -0,0 +1,36 @@ +#ifndef BANDIT_VISUAL_STUDIO_FAILURE_FORMATTER_H +#define BANDIT_VISUAL_STUDIO_FAILURE_FORMATTER_H + +namespace bandit { namespace detail { + + struct visual_studio_failure_formatter : public failure_formatter + { + std::string format(const assertion_exception& err) const + { + std::stringstream ss; + if(err.file_name().size()) + { + ss << err.file_name(); + + if(err.line_number()) + { + ss << "(" << err.line_number() << ")"; + } + + ss << ": "; + } + else + { + ss << "bandit: "; + } + + ss << err.what(); + + return ss.str(); + + } + }; + +}} + +#endif |