diff options
author | Egor Tensin <Egor.Tensin@gmail.com> | 2020-09-14 04:51:52 +0300 |
---|---|---|
committer | Egor Tensin <Egor.Tensin@gmail.com> | 2020-09-14 16:02:26 +0300 |
commit | ed597441678604f6bf44513532ad282e4d5593be (patch) | |
tree | 2839da580b2faf96a6c634b275ae01b84eee4442 /test/test_lib.cpp | |
parent | disable Boost autolinking feature (diff) | |
download | winapi-debug-ed597441678604f6bf44513532ad282e4d5593be.tar.gz winapi-debug-ed597441678604f6bf44513532ad282e4d5593be.zip |
unit_tests: more call stack tests
Diffstat (limited to 'test/test_lib.cpp')
-rw-r--r-- | test/test_lib.cpp | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/test/test_lib.cpp b/test/test_lib.cpp index 63e51ad..711d4fd 100644 --- a/test/test_lib.cpp +++ b/test/test_lib.cpp @@ -18,22 +18,26 @@ void do_print_call_stack() { call_stack.dump(boost::nowide::cout, dbghelp); } +void do_throw_call_stack() { + throw pdb::CallStack::capture(); +} + } // namespace volatile int var = 42; void baz(F f) { - boost::nowide::cout << "baz\n"; + boost::nowide::cout << "baz " << pdb::format_address(&baz) << '\n'; f(); } void bar(F f) { - boost::nowide::cout << "bar\n"; + boost::nowide::cout << "bar " << pdb::format_address(&bar) << '\n'; baz(f); } void foo(F f) { - boost::nowide::cout << "foo\n"; + boost::nowide::cout << "foo " << pdb::format_address(&foo) << '\n'; bar(f); } @@ -41,4 +45,8 @@ void print_call_stack() { foo(&do_print_call_stack); } +void throw_call_stack() { + foo(&do_throw_call_stack); +} + } // namespace test_ns |