Merge branch 'vendor/GCC44'
[dragonfly.git] / contrib / ncurses-5.4 / test / firstlast.c
blob6a79a33fbfb134af0e4dbc5db2e65c105533e1f2
1 /*
2 * This test was written by Alexander V. Lukyanov to demonstrate difference
3 * between ncurses 4.1 and SVR4 curses
5 * $Id: firstlast.c,v 1.3 2001/09/15 21:46:34 tom Exp $
6 */
8 #include <test.priv.h>
10 static void
11 fill(WINDOW *w, const char *str)
13 const char *s;
14 for (;;) {
15 for (s = str; *s; s++) {
16 if (waddch(w, *s) == ERR) {
17 wmove(w, 0, 0);
18 return;
24 int
25 main(
26 int argc GCC_UNUSED,
27 char *argv[]GCC_UNUSED)
29 WINDOW *large, *small;
30 initscr();
31 noecho();
33 large = newwin(20, 60, 2, 10);
34 small = newwin(10, 30, 7, 25);
36 /* test 1 - addch */
37 fill(large, "LargeWindow");
39 refresh();
40 wrefresh(large);
41 wrefresh(small);
43 mvwaddstr(small, 5, 5, " Test <place to change> String ");
44 wrefresh(small);
45 getch();
47 touchwin(large);
48 wrefresh(large);
50 mvwaddstr(small, 5, 5, " Test <***************> String ");
51 wrefresh(small);
53 /* DIFFERENCE! */
54 getch();
56 /* test 2: erase */
57 erase();
58 refresh();
59 getch();
61 /* test 3: clrtoeol */
62 werase(small);
63 wrefresh(small);
64 touchwin(large);
65 wrefresh(large);
66 wmove(small, 5, 0);
67 waddstr(small, " clrtoeol>");
68 wclrtoeol(small);
69 wrefresh(small);
71 /* DIFFERENCE! */ ;
72 getch();
74 /* test 4: clrtobot */
75 werase(small);
76 wrefresh(small);
77 touchwin(large);
78 wrefresh(large);
79 wmove(small, 5, 3);
80 waddstr(small, " clrtobot>");
81 wclrtobot(small);
82 wrefresh(small);
84 /* DIFFERENCE! */
85 getch();
87 endwin();
89 ExitProgram(EXIT_SUCCESS);