diff --git a/test/scoped_trace_tests.cpp b/test/scoped_trace_tests.cpp index 29f6ea3d31..2a7dd364ab 100644 --- a/test/scoped_trace_tests.cpp +++ b/test/scoped_trace_tests.cpp @@ -6,7 +6,7 @@ * * @author t.shirayanagi * @par copyright - * Copyright (C) 2013-2016, Takazumi Shirayanagi\n + * Copyright (C) 2013-2019, Takazumi Shirayanagi\n * This software is released under the new BSD License, * see LICENSE */ @@ -68,6 +68,33 @@ IUTEST(ScopedTraceTest, Test) #endif } +#if IUTEST_HAS_EXCEPTIONS + +class ScopedTraceExceptionTest : public ::iutest::Test +{ +public: +#if !defined(IUTEST_USE_GTEST) + TestLogger logger; + + void SetUp() + { + ::iutest::detail::iuConsole::SetLogger(&logger); + } + void TearDown() + { + ::iutest::detail::iuConsole::SetLogger(NULL); + } +#endif +} + +IUTEST_F(ScopedTraceExceptionTest, Exception) +{ + IUTEST_SCOPED_TRACE("Test Scope Exception"); + throw "error"; +} + +#endif + #ifdef UNICODE int wmain(int argc, wchar_t* argv[]) #else