From 375fd7283ef0853cc5d023747efc9f3821ba97ca Mon Sep 17 00:00:00 2001 From: Martin Quinson Date: Sat, 16 Jun 2018 15:29:20 +0200 Subject: [PATCH] snake_case xbt/exception.hpp --- include/xbt/exception.hpp | 15 +++++++++++++-- src/xbt/cunit.cpp | 3 ++- src/xbt/exception.cpp | 6 ++---- 3 files changed, 17 insertions(+), 7 deletions(-) diff --git a/include/xbt/exception.hpp b/include/xbt/exception.hpp index 8fa032d966..544f6ae247 100644 --- a/include/xbt/exception.hpp +++ b/include/xbt/exception.hpp @@ -83,8 +83,19 @@ public: return backtrace_; } int pid() const { return pid_; } - std::string const& processName() const { return procname_; } - ThrowPoint& throwPoint() { return throwpoint_; } + std::string const& process_name() const { return procname_; } + ThrowPoint& throw_point() { return throwpoint_; } + + // deprecated + XBT_ATTRIB_DEPRECATED_v323("Please use WithContextException::process_name()") std::string const& processName() const + { + return process_name(); + } + XBT_ATTRIB_DEPRECATED_v323("Please use WithContextException::throw_point()") ThrowPoint& throwPoint() + { + return throw_point(); + } + private: Backtrace backtrace_; std::string procname_; /**< Name of the process who thrown this */ diff --git a/src/xbt/cunit.cpp b/src/xbt/cunit.cpp index f6d6ee0ba6..95b4d95613 100644 --- a/src/xbt/cunit.cpp +++ b/src/xbt/cunit.cpp @@ -581,7 +581,8 @@ void _xbt_test_fail(const char *file, int line, const char *fmt, ...) void xbt_test_exception(xbt_ex_t e) { - _xbt_test_fail(e.throwPoint().file, e.throwPoint().line, "Exception %s raised: %s", xbt_ex_catname(e.category), e.what()); + _xbt_test_fail(e.throw_point().file, e.throw_point().line, "Exception %s raised: %s", xbt_ex_catname(e.category), + e.what()); } void xbt_test_expect_failure() diff --git a/src/xbt/exception.cpp b/src/xbt/exception.cpp index ba9bbcf07e..9d5ad43293 100644 --- a/src/xbt/exception.cpp +++ b/src/xbt/exception.cpp @@ -35,10 +35,8 @@ void log_exception(e_xbt_log_priority_t prio, const char* context, std::exceptio auto* with_context = dynamic_cast(&exception); if (with_context != nullptr) - XBT_LOG(prio, "%s %s by %s/%d: %s", - context, name.get(), - with_context->processName().c_str(), with_context->pid(), - exception.what()); + XBT_LOG(prio, "%s %s by %s/%d: %s", context, name.get(), with_context->process_name().c_str(), + with_context->pid(), exception.what()); else XBT_LOG(prio, "%s %s: %s", context, name.get(), exception.what()); -- 2.20.1