diff options
author | ngie <ngie@FreeBSD.org> | 2014-10-02 23:26:49 +0000 |
---|---|---|
committer | ngie <ngie@FreeBSD.org> | 2014-10-02 23:26:49 +0000 |
commit | 3f09b8d0af642c2aeb96a4d667cefb7fe3bce443 (patch) | |
tree | 544932e2a2c5a5a202b752beefba0b3e327b3858 /contrib/netbsd-tests/lib/libcurses/tests | |
parent | b941fec92da62b0eab650295f4e8a381dbbc04b4 (diff) | |
parent | e1f2d32c0e0678782c353c48364cddedfae58b0a (diff) | |
download | FreeBSD-src-3f09b8d0af642c2aeb96a4d667cefb7fe3bce443.zip FreeBSD-src-3f09b8d0af642c2aeb96a4d667cefb7fe3bce443.tar.gz |
Import the NetBSD test suite from ^/vendor/NetBSD/tests/09.30.2014_20.45 ,
minus the vendor Makefiles
Provide directions for how to bootstrap the vendor sources in
FREEBSD-upgrade
MFC after 2 weeks
Discussed with: rpaulo
Sponsored by: EMC / Isilon Storage Division
Diffstat (limited to 'contrib/netbsd-tests/lib/libcurses/tests')
32 files changed, 553 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addch b/contrib/netbsd-tests/lib/libcurses/tests/addch new file mode 100644 index 0000000..a67e385 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/addch @@ -0,0 +1,4 @@ +include start +call OK addch `\001t` +call OK refresh +compare addch.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addchnstr b/contrib/netbsd-tests/lib/libcurses/tests/addchnstr new file mode 100644 index 0000000..661bf74 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/addchnstr @@ -0,0 +1,5 @@ +include start +# note that there are more characters in the array, check we only get 5 out +call OK addchnstr `\004a\004b\004c\004d\004e\004f\004g` 5 +call OK refresh +compare addchstr.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addchstr b/contrib/netbsd-tests/lib/libcurses/tests/addchstr new file mode 100644 index 0000000..4ccf7b8 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/addchstr @@ -0,0 +1,4 @@ +include start +call OK addchstr `\004a\004b\004c\004d\004e` +call OK refresh +compare addchstr.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addnstr b/contrib/netbsd-tests/lib/libcurses/tests/addnstr new file mode 100644 index 0000000..9c40801 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/addnstr @@ -0,0 +1,5 @@ +include start +call OK addnstr "abcdefg" 5 +call OK refresh +# should be the same as addstr +compare addstr.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/addstr b/contrib/netbsd-tests/lib/libcurses/tests/addstr new file mode 100644 index 0000000..8c1d24f --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/addstr @@ -0,0 +1,4 @@ +include start +call OK addstr "abcde" +call OK refresh +compare addstr.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors b/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors new file mode 100644 index 0000000..b6ccb09 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/assume_default_colors @@ -0,0 +1,19 @@ +include start +call OK start_color +call OK assume_default_colors -1 -1 +call OK refresh +compare color_start.chk +# This should be the same as the default +compare color_default.chk +# default foreground, blue background +call OK assume_default_colors -1 $COLOR_BLUE +call OK refresh +compare color_blue_back.chk +# red foreground, default background +call OK assume_default_colors $COLOR_RED -1 +call OK refresh +compare color_red_fore.chk +# back to default +call OK assume_default_colors -1 -1 +call OK refresh +compare color_default.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/attributes b/contrib/netbsd-tests/lib/libcurses/tests/attributes new file mode 100644 index 0000000..b75d7d1 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/attributes @@ -0,0 +1,23 @@ +include start +# no attributes, no color +call3 OK 0 0 attr_get +# set reverse and bold +call OK attr_set ($BOLD | $REVERSE) 2 +# returned attributes includes color information +call3 OK ($ACS_IS_WACS | $BOLD | $REVERSE) 2 attr_get +# turn off reverse +call OK attr_off $REVERSE +call3 OK ($ACS_IS_WACS | $BOLD) 2 attr_get +# turn on standout +call OK attr_on $STANDOUT +call3 OK ($ACS_IS_WACS | $BOLD | $STANDOUT) 2 attr_get +# turn on blink +call OK attron $BLINK +call3 OK ($ACS_IS_WACS | $BOLD | $STANDOUT | $BLINK) 2 attr_get +# turn off bold +call OK attroff $BOLD +call3 OK ($ACS_IS_WACS | $STANDOUT | $BLINK) 2 attr_get +# print out something to check our attributes are there, standout and blink +call OK printw "%s" "hello" +call OK refresh +compare attributes.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/background b/contrib/netbsd-tests/lib/libcurses/tests/background new file mode 100644 index 0000000..2c4a575 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/background @@ -0,0 +1,23 @@ +include start +call OK bkgd `\002A` +call OK refresh +# looks like a bug - bottom right char not filled +compare background1.chk +call OK printw "%s" "a test string" +call OK refresh +compare background2.chk +call win1 newwin 6 6 2 5 +check win1 NON_NULL +call OK wprintw $win1 "%s" "window 1" +# call OK refresh +call OK wrefresh $win1 +compare background3.chk +call OK wbkgd $win1 `\004B` +call OK refresh +call OK wrefresh $win1 +compare background4.chk +call OK wprintw $win1 "%s" "hello world" +call OK refresh +call OK wrefresh $win1 +compare background5.chk + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/beep b/contrib/netbsd-tests/lib/libcurses/tests/beep new file mode 100644 index 0000000..832e87f --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/beep @@ -0,0 +1,5 @@ +include start +# SUSv2 says this should return OK but we return 1 +call 1 beep +call OK refresh +compare bell.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/box b/contrib/netbsd-tests/lib/libcurses/tests/box new file mode 100644 index 0000000..bfd2e12 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/box @@ -0,0 +1,8 @@ +include window +call OK box $win1 `\000` `\000` +call OK wrefresh $win1 +# default settings of box will output same as wborder +compare wborder.chk +call OK box $win1 `\001\000` `\004\000` +call OK wrefresh $win1 +compare box_standout.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/can_change_color b/contrib/netbsd-tests/lib/libcurses/tests/can_change_color new file mode 100644 index 0000000..aed622a --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/can_change_color @@ -0,0 +1,3 @@ +include start +# our test terminal can change colors so expect true. +call 1 can_change_color diff --git a/contrib/netbsd-tests/lib/libcurses/tests/cbreak b/contrib/netbsd-tests/lib/libcurses/tests/cbreak new file mode 100644 index 0000000..b8bf60e --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/cbreak @@ -0,0 +1,18 @@ +include start +# setting noecho stops getch setting cbreak itself so we should need +# a newline before getch returns, check this works first. +call OK noecho +input "abcd\n" +call 0x61 getch +noinput +call 0x62 getch +noinput +call 0x63 getch +noinput +call 0x64 getch +noinput +call 0x0a getch +# set cbreak, getch should return without needing a newline +input "ef" +call OK cbreak +call 0x65 getch diff --git a/contrib/netbsd-tests/lib/libcurses/tests/chgat b/contrib/netbsd-tests/lib/libcurses/tests/chgat new file mode 100644 index 0000000..863ab11 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/chgat @@ -0,0 +1,15 @@ +include start_color +call OK init_pair 3 $COLOR_YELLOW $COLOR_CYAN +call OK addch `\000d` +call OK chgat 5 $REVERSE 3 0 +call OK refresh +compare chgat1.chk +call OK addch `\000e` +call OK refresh +compare chgat2.chk +call OK move 0 0 +# The following should apply the attribute and colour to the whole line +call OK chgat -1 $UNDERSCORE 3 0 +call OK refresh +compare chgat3.chk + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/clear b/contrib/netbsd-tests/lib/libcurses/tests/clear new file mode 100644 index 0000000..5aad934 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/clear @@ -0,0 +1,57 @@ +include addstr +call OK clear +call OK refresh +compare clear1.chk +call OK move 5 5 +call OK addstr "abcde" +call OK move 20 5 +call OK addstr "fghij" +call OK move 10 5 +call OK refresh +compare clear2.chk +call OK clrtobot +call OK refresh +compare clear3.chk +call OK erase +call OK refresh +compare clear4.chk +include fill_screen +compare fill.chk +call OK erase +call OK refresh +compare clear5.chk +# create a window to play with, defines win1 var +include window_create +call OK waddstr $win1 "abc" +call OK mvwaddstr $win1 4 1 "efg" +call OK wmove $win1 1 0 +call OK wrefresh $win1 +compare clear6.chk +call OK wclrtobot $win1 +call OK wrefresh $win1 +compare clear7.chk +include fill_screen +comparend home.chk +compare fill.chk +call OK wrefresh $win1 +call OK wclear $win1 +call OK wrefresh $win1 +compare clear8.chk +call OK clear +call OK refresh +compare clear1.chk +include fill_screen +compare fill.chk +call OK werase $win1 +call OK wrefresh $win1 +compare clear9.chk +call OK waddstr $win1 "abc" +call OK mvwaddstr $win1 4 1 "efg" +call OK wmove $win1 1 0 +call OK wrefresh $win1 +compare clear6.chk +call OK wmove $win1 4 0 +call OK wclrtoeol $win1 +call OK wrefresh $win1 +compare clear10.chk + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/color_content b/contrib/netbsd-tests/lib/libcurses/tests/color_content new file mode 100644 index 0000000..0db66e5 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/color_content @@ -0,0 +1,12 @@ +include start +call OK start_color +call4 OK 0 0 0 color_content $COLOR_BLACK +call4 OK 1000 0 0 color_content $COLOR_RED +call4 OK 0 1000 0 color_content $COLOR_GREEN +call4 OK 1000 1000 0 color_content $COLOR_YELLOW +call4 OK 0 0 1000 color_content $COLOR_BLUE +call4 OK 1000 0 1000 color_content $COLOR_MAGENTA +call4 OK 0 1000 1000 color_content $COLOR_CYAN +call4 OK 1000 1000 1000 color_content $COLOR_WHITE + + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/color_set b/contrib/netbsd-tests/lib/libcurses/tests/color_set new file mode 100644 index 0000000..07cd1c5 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/color_set @@ -0,0 +1,11 @@ +include start +call OK start_color +call OK refresh +comparend color_start.chk +compare color_blank_draw.chk +call OK init_pair 4 $COLOR_RED $COLOR_GREEN +call OK color_set 4 0 +call OK printw "%s" "testing" +call OK refresh +compare color_set.chk + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/copywin b/contrib/netbsd-tests/lib/libcurses/tests/copywin new file mode 100644 index 0000000..2dbec40 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/copywin @@ -0,0 +1,81 @@ +include start +include window_create +call win2 newwin 7 9 10 14 +check win2 NON_NULL +call OK wrefresh $win2 +compare copywin1.chk +call OK mvwprintw $win1 0 0 "%s" "testin" +call OK mvwprintw $win1 1 0 "%s" "gtesti" +call OK mvwprintw $win1 2 0 "%s" "ngtest" +call OK mvwprintw $win1 3 0 "%s" "ingtes" +call OK mvwprintw $win1 4 0 "%s" "tingte" +call OK mvwprintw $win1 5 0 "%s" "stingt" +call OK wrefresh $win1 +compare copywin2.chk +call OK copywin $win1 $win2 0 0 1 1 7 7 0 +call OK wrefresh $win2 +compare copywin3.chk +call OK wclear $win1 +call OK wclear $win2 +call OK wrefresh $win1 +call OK wrefresh $win2 +compare copywin4.chk +call OK mvwprintw $win2 0 0 "%s" "testingte" +call OK mvwprintw $win2 1 0 "%s" "stingtest" +call OK mvwprintw $win2 2 0 "%s" "ingtestin" +call OK mvwprintw $win2 3 0 "%s" "gtestingt" +call OK mvwprintw $win2 4 0 "%s" "estingtes" +call OK mvwprintw $win2 5 0 "%s" "tingtesti" +call OK wrefresh $win2 +compare copywin5.chk +call OK copywin $win2 $win1 0 0 0 0 7 9 0 +call OK wrefresh $win1 +compare copywin6.chk +call OK wclear $win1 +call OK wclear $win2 +call OK wrefresh $win1 +call OK wrefresh $win2 +compare copywin7.chk +call OK mvwprintw $win1 0 0 "%s" "t s i " +call OK mvwprintw $win1 1 0 "%s" "g e t " +call OK mvwprintw $win1 2 0 "%s" "n t s " +call OK mvwprintw $win1 3 0 "%s" " n t s" +call OK mvwprintw $win1 4 0 "%s" "t n t " +call OK mvwprintw $win1 5 0 "%s" " t n t" +call OK wrefresh $win1 +compare copywin8.chk +call OK mvwprintw $win2 0 0 "%s" " e t n" +call OK mvwprintw $win2 1 0 "%s" " t s i" +call OK mvwprintw $win2 2 0 "%s" " g e t" +call OK mvwprintw $win2 3 0 "%s" "i g e " +call OK mvwprintw $win2 4 0 "%s" " i g e" +call OK mvwprintw $win2 5 0 "%s" "s i g " +call OK wrefresh $win2 +compare copywin9.chk +call OK copywin $win1 $win2 0 0 0 0 6 6 0 +call OK wrefresh $win2 +compare copywin10.chk +call OK wclear $win1 +call OK wclear $win2 +call OK wrefresh $win1 +call OK wrefresh $win2 +compare copywin11.chk +call OK mvwprintw $win1 0 0 "%s" "t s i " +call OK mvwprintw $win1 1 0 "%s" "g e t " +call OK mvwprintw $win1 2 0 "%s" "n t s " +call OK mvwprintw $win1 3 0 "%s" " n t s" +call OK mvwprintw $win1 4 0 "%s" "t n t " +call OK mvwprintw $win1 5 0 "%s" " t n t" +call OK wrefresh $win1 +compare copywin12.chk +call OK mvwprintw $win2 0 0 "%s" " e t n" +call OK mvwprintw $win2 1 0 "%s" " t s i" +call OK mvwprintw $win2 2 0 "%s" " g e t" +call OK mvwprintw $win2 3 0 "%s" "i g e " +call OK mvwprintw $win2 4 0 "%s" " i g e" +call OK mvwprintw $win2 5 0 "%s" "s i g " +call OK wrefresh $win2 +compare copywin13.chk +call OK copywin $win1 $win2 0 0 0 0 6 6 1 +call OK wrefresh $win2 +compare copywin14.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/curs_set b/contrib/netbsd-tests/lib/libcurses/tests/curs_set new file mode 100644 index 0000000..5d7cb54 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/curs_set @@ -0,0 +1,7 @@ +include start +call 2 curs_set 0 +compare curs_set1.chk +call 0 curs_set 1 +compare curs_set2.chk +call 1 curs_set 2 +compare curs_set3.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/fill_screen b/contrib/netbsd-tests/lib/libcurses/tests/fill_screen new file mode 100644 index 0000000..b9e2942 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/fill_screen @@ -0,0 +1,29 @@ +# +# Fill the screen with characters. We don't do a compare in here because +# this is meant to be included from other tests which could result in random +# cursor motions before the fill is done. +# +call OK mvaddstr 0 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 1 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 2 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 3 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 4 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 5 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 6 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 7 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 8 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 9 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 10 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 11 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 12 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 13 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 14 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 15 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 16 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 17 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 18 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 19 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 20 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 21 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK mvaddstr 22 0 "EEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEEE" +call OK refresh diff --git a/contrib/netbsd-tests/lib/libcurses/tests/getch b/contrib/netbsd-tests/lib/libcurses/tests/getch new file mode 100644 index 0000000..9f437f5 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/getch @@ -0,0 +1,3 @@ +include start +input "i" +call 105 getch diff --git a/contrib/netbsd-tests/lib/libcurses/tests/getstr b/contrib/netbsd-tests/lib/libcurses/tests/getstr new file mode 100644 index 0000000..320325f --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/getstr @@ -0,0 +1,6 @@ +include window +input "input\n" +call2 OK "input" wgetstr $win1 +compare wgetstr.chk +call OK wrefresh $win1 +compare wgetstr_refresh.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/mvwin b/contrib/netbsd-tests/lib/libcurses/tests/mvwin new file mode 100644 index 0000000..86d9bd6 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/mvwin @@ -0,0 +1,12 @@ +include window +call OK wmove $win1 1 1 +call OK wprintw $win1 "%s" "xxxx" +call OK wrefresh $win1 +compare /dev/zero +call OK refresh +compare /dev/zero +call OK mvwin $win1 4 7 +call OK wrefresh $win1 +compare /dev/zero +call OK refresh +compare /dev/zero diff --git a/contrib/netbsd-tests/lib/libcurses/tests/start b/contrib/netbsd-tests/lib/libcurses/tests/start new file mode 100644 index 0000000..963f2f4 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/start @@ -0,0 +1,3 @@ +include std_defines +call OK refresh +compare curses_start.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/start_color b/contrib/netbsd-tests/lib/libcurses/tests/start_color new file mode 100644 index 0000000..6d3f133 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/start_color @@ -0,0 +1,5 @@ +include start +call OK start_color +call OK refresh +comparend color_start.chk +compare color_blank_draw.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/std_defines b/contrib/netbsd-tests/lib/libcurses/tests/std_defines new file mode 100644 index 0000000..9c986df --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/std_defines @@ -0,0 +1,138 @@ +# +# Define some standard symbols for curses so tests can reference things +# symbolically instead of using magic numbers. +# +# +# boolean +# +assign TRUE 0x01 +assign FALSE 0x00 +# +# colours +# +assign COLOR_BLACK 0x00 +assign COLOR_RED 0x01 +assign COLOR_GREEN 0x02 +assign COLOR_YELLOW 0x03 +assign COLOR_BLUE 0x04 +assign COLOR_MAGENTA 0x05 +assign COLOR_CYAN 0x06 +assign COLOR_WHITE 0x07 +# +# Attributes +# +assign NORMAL 0x00000000 +assign STANDOUT 0x00000100 +assign UNDERSCORE 0x00000200 +assign REVERSE 0x00000400 +assign BLINK 0x00000800 +assign DIM 0x00001000 +assign BOLD 0x00002000 +assign BLANK 0x00004000 +assign PROTECT 0x00008000 +assign ALTCHARSET 0x00010000 +assign ACS_IS_WACS 0x00040000 +# +# Keys +# +assign KEY_BREAK 0x101 +assign KEY_DOWN 0x102 +assign KEY_UP 0x103 +assign KEY_LEFT 0x104 +assign KEY_RIGHT 0x105 +assign KEY_HOME 0x106 +assign KEY_BACKSPACE 0x107 +assign KEY_F0 0x108 +assign KEY_F1 0x109 +assign KEY_F2 0x10a +assign KEY_F3 0x10b +assign KEY_F4 0x10c +assign KEY_F5 0x10d +assign KEY_F6 0x10e +assign KEY_F7 0x10f +assign KEY_F8 0x110 +assign KEY_F9 0x111 +assign KEY_DL 0x148 +assign KEY_IL 0x149 +assign KEY_DC 0x14A +assign KEY_IC 0x14B +assign KEY_EIC 0x14C +assign KEY_CLEAR 0x14D +assign KEY_EOS 0x14E +assign KEY_EOL 0x14F +assign KEY_SF 0x150 +assign KEY_SR 0x151 +assign KEY_NPAGE 0x152 +assign KEY_PPAGE 0x153 +assign KEY_STAB 0x154 +assign KEY_CTAB 0x155 +assign KEY_CATAB 0x156 +assign KEY_ENTER 0x157 +assign KEY_SRESET 0x158 +assign KEY_RESET 0x159 +assign KEY_PRINT 0x15A +assign KEY_LL 0x15B +assign KEY_A1 0x15C +assign KEY_A3 0x15D +assign KEY_B2 0x15E +assign KEY_C1 0x15F +assign KEY_C3 0x160 +assign KEY_BTAB 0x161 +assign KEY_BEG 0x162 +assign KEY_CANCEL 0x163 +assign KEY_CLOSE 0x164 +assign KEY_COMMAND 0x165 +assign KEY_COPY 0x166 +assign KEY_CREATE 0x167 +assign KEY_END 0x168 +assign KEY_EXIT 0x169 +assign KEY_FIND 0x16A +assign KEY_HELP 0x16B +assign KEY_MARK 0x16C +assign KEY_MESSAGE 0x16D +assign KEY_MOVE 0x16E +assign KEY_NEXT 0x16F +assign KEY_OPEN 0x170 +assign KEY_OPTIONS 0x171 +assign KEY_PREVIOUS 0x172 +assign KEY_REDO 0x173 +assign KEY_REFERENCE 0x174 +assign KEY_REFRESH 0x175 +assign KEY_REPLACE 0x176 +assign KEY_RESTART 0x177 +assign KEY_RESUME 0x178 +assign KEY_SAVE 0x179 +assign KEY_SBEG 0x17A +assign KEY_SCANCEL 0x17B +assign KEY_SCOMMAND 0x17C +assign KEY_SCOPY 0x17D +assign KEY_SCREATE 0x17E +assign KEY_SDC 0x17F +assign KEY_SDL 0x180 +assign KEY_SELECT 0x181 +assign KEY_SEND 0x182 +assign KEY_SEOL 0x183 +assign KEY_SEXIT 0x184 +assign KEY_SFIND 0x185 +assign KEY_SHELP 0x186 +assign KEY_SHOME 0x187 +assign KEY_SIC 0x188 +assign KEY_SLEFT 0x189 +assign KEY_SMESSAGE 0x18A +assign KEY_SMOVE 0x18B +assign KEY_SNEXT 0x18C +assign KEY_SOPTIONS 0x18D +assign KEY_SPREVIOUS 0x18E +assign KEY_SPRINT 0x18F +assign KEY_SREDO 0x190 +assign KEY_SREPLACE 0x191 +assign KEY_SRIGHT 0x192 +assign KEY_SRSUME 0x193 +assign KEY_SSAVE 0x194 +assign KEY_SSUSPEND 0x195 +assign KEY_SUNDO 0x196 +assign KEY_SUSPEND 0x197 +assign KEY_UNDO 0x198 +assign KEY_MOUSE 0x199 +assign KEY_RESIZE 0x200 + diff --git a/contrib/netbsd-tests/lib/libcurses/tests/termattrs b/contrib/netbsd-tests/lib/libcurses/tests/termattrs new file mode 100644 index 0000000..1025301 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/termattrs @@ -0,0 +1,3 @@ +include start +# the atf terminal can do all attributes except PROTECT +call 0x17f00 termattrs diff --git a/contrib/netbsd-tests/lib/libcurses/tests/timeout b/contrib/netbsd-tests/lib/libcurses/tests/timeout new file mode 100644 index 0000000..1adf057 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/timeout @@ -0,0 +1,21 @@ +# +# Validate the timeout works. +# +include start +delay 2000 +input "a" +call 97 getch +call OK timeout 100 +input "b" +# since delay is in effect and we set timeout the following getch should +# return ERR not the character b. +call -1 getch +# drain input.... +call OK drain +call OK timeout -1 +call OK keypad STDSCR 1 +delay 0 +input "\eOA" +call $KEY_UP getch +call OK refresh +compare timeout.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wborder b/contrib/netbsd-tests/lib/libcurses/tests/wborder new file mode 100644 index 0000000..7a8e78f --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/wborder @@ -0,0 +1,6 @@ +include window +call OK wborder $win1 0 0 0 0 0 0 0 0 +call OK wrefresh $win1 +compare wborder.chk +call OK refresh +compare wborder_refresh.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/window b/contrib/netbsd-tests/lib/libcurses/tests/window new file mode 100644 index 0000000..52b2d0a --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/window @@ -0,0 +1,2 @@ +include start +include window_create diff --git a/contrib/netbsd-tests/lib/libcurses/tests/window_create b/contrib/netbsd-tests/lib/libcurses/tests/window_create new file mode 100644 index 0000000..8c96134 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/window_create @@ -0,0 +1,4 @@ +call win1 newwin 6 6 2 5 +check win1 NON_NULL +call OK wrefresh $win1 +compare window.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wprintw b/contrib/netbsd-tests/lib/libcurses/tests/wprintw new file mode 100644 index 0000000..a30fcc0 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/wprintw @@ -0,0 +1,6 @@ +include start +call win1 newwin 2 5 2 5 +check win1 NON_NULL +call OK wprintw $win1 "%s" "hello" +call OK wrefresh $win1 +compare wprintw_refresh.chk diff --git a/contrib/netbsd-tests/lib/libcurses/tests/wscrl b/contrib/netbsd-tests/lib/libcurses/tests/wscrl new file mode 100644 index 0000000..51be531 --- /dev/null +++ b/contrib/netbsd-tests/lib/libcurses/tests/wscrl @@ -0,0 +1,11 @@ +include window +call OK wmove $win1 1 1 +call OK wprintw $win1 "%s" "xxxx" +call OK wrefresh $win1 +call OK refresh +compare wscrl1.chk +call OK scrollok $win1 1 +call OK wscrl $win1 -2 +call OK wrefresh $win1 +call OK refresh +compare wscrl2.chk |