21#include "gdbsupport/selftest.h"
23#include "gdbsupport/gdb_unique_ptr.h"
31 gdb::unique_xmalloc_ptr<char> a = make_unique_xstrdup (
"abc");
32 gdb::unique_xmalloc_ptr<char> b = make_unique_xstrndup (
"defghi", 3);
34 SELF_CHECK (strcmp (a.get (),
"abc") == 0);
35 SELF_CHECK (strcmp (b.get (),
"def") == 0);
37 std::string str =
"xxx";
41 SELF_CHECK (str ==
"xxxabc");
45 SELF_CHECK (str ==
"xxxabcdef");
55 selftests::register_test (
"unique_xmalloc_ptr_char",
gdbscm_gdb_exception unpack(const gdb_exception &exc)
static void unique_xmalloc_ptr_char()
void _initialize_unique_xmalloc_ptr_char()