Code documentation: Debugging.
This library provides general-purpose debugging tools. Currently, it contains the following:
- my_scoped_trace.h: The macro MY_SCOPED_TRACE, which can be used as a thread-safe alternative to SCOPED_TRACE in unittests.
- object_lifetime_tracker.h: Classes that inherit from
Object_lifetime_tracker will have all invocations of constructors, assignments, and destructors logged to stdout. This is useful when analysing memory bugs.
- oom_test.h: This is a test utility to test out-of-memory handling.
- unittest_assertions.h: The following test assertions:
- macro ASSERT_VOID(x): assert at compile-time that the result type from expression
x is void, and execute x.
- macro ASSERT_OK(x): assert that x == mysql::utils::Return_status::ok
- macro ASSERT_ERROR(x): assert that x == mysql::utils::Return_status::error
- test_eq(x, y): assert that x==y, y==x, !(x!=y), !(y!=x)
- test_cmp(x, y, OP): assert that (x OP y)==(n OP 0), where OP is one of ==, !=, <, <=, >, >=, or <=>.