This is an example demonstrating how to enable and update extra diagnostic code at runtime.
#include <test_util.h>
static const char *home;
int
main(int argc, char *argv[])
{
home = example_setup(argc, argv);
#ifdef HAVE_DIAGNOSTIC
testutil_assert(
wiredtiger_open(home, NULL,
"create,extra_diagnostics=[key_out_of_order]", &conn) == EINVAL);
#else
error_check(
wiredtiger_open(home, NULL,
"create,extra_diagnostics=[key_out_of_order]", &conn));
error_check(conn->
reconfigure(conn,
"extra_diagnostics=[txn_visibility]"));
#endif
return (EXIT_SUCCESS);
}