Change type of debug_aix_thread to bool
[deliverable/binutils-gdb.git] / gdb / unittests / tui-selftests.c
CommitLineData
517d261d
TT
1/* Self tests for the TUI
2
3 Copyright (C) 2019 Free Software Foundation, Inc.
4
5 This file is part of GDB.
6
7 This program is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3 of the License, or
10 (at your option) any later version.
11
12 This program is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with this program. If not, see <http://www.gnu.org/licenses/>. */
19
20#include "defs.h"
21#include "gdbsupport/selftest.h"
22#include "tui/tui-winsource.h"
23
24namespace selftests {
25namespace tui {
26
27static void
28run_tests ()
29{
30 const char *text = "hello";
31 std::string result = tui_copy_source_line (&text, 0, 0, 50, 0);
32 SELF_CHECK (result == "hello");
33 SELF_CHECK (*text == '\0');
34
35 text = "hello\n";
36 result = tui_copy_source_line (&text, 0, 0, 3, 0);
37 SELF_CHECK (result == "hel");
38 SELF_CHECK (*text == '\0');
39}
40
41} /* namespace tui*/
42} /* namespace selftests */
43
44void
45_initialize_tui_selftest ()
46{
47 selftests::register_test ("tui", selftests::tui::run_tests);
48}
This page took 0.028805 seconds and 4 git commands to generate.