]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/test_opaque.c
ncurses 5.7 - patch 20081206
[ncurses.git] / test / test_opaque.c
index bb7a6b0afc05c9f9d7e264682c44dfe756da920f..f1ab78cf1fa62107bf0905e9b414971c7ab8c547 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_opaque.c,v 1.5 2008/01/19 21:01:36 tom Exp $
+ * $Id: test_opaque.c,v 1.7 2008/07/05 23:18:40 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -51,7 +51,7 @@
 #define BASE_Y 6
 #define MAX_COLS 1024
 
-#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20070818) && NCURSES_EXT_FUNCS
+#if defined(NCURSES_VERSION_PATCH) && (NCURSES_VERSION_PATCH >= 20080119) && NCURSES_EXT_FUNCS
 
 static bool
 Quit(int ch)
@@ -394,6 +394,43 @@ test_opaque(int level, char **argv, WINDOW *stswin)
     return TRUE;
 }
 
+static void
+test_set_escdelay(void)
+{
+    set_escdelay((100 + ESCDELAY) / 2);
+}
+
+static void
+test_set_tabsize(void)
+{
+    int y0, x0;
+    int y, x;
+    int save_tabsize = TABSIZE;
+
+    (void) cbreak();           /* take input chars one at a time, no wait for \n */
+    (void) noecho();           /* don't echo input */
+
+    for (y = 0; y < LINES; ++y) {
+       set_tabsize(y + 1);
+       if (move(y, 0) == ERR)
+           break;
+       for (x = 0; x < COLS;) {
+           addch('\t');
+           if (addch('*') == ERR) {
+               break;
+           }
+           getyx(stdscr, y0, x0);
+           if (y0 != y || x0 == x) {
+               break;
+           }
+       }
+    }
+    getch();
+    erase();
+
+    set_tabsize(save_tabsize);
+}
+
 int
 main(int argc, char *argv[])
 {
@@ -409,6 +446,9 @@ main(int argc, char *argv[])
 
     initscr();
 
+    test_set_escdelay();
+    test_set_tabsize();
+
     stsbox = derwin(stdscr, BASE_Y, COLS, 0, 0);
     box(stsbox, 0, 0);
     wnoutrefresh(stsbox);