]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/testcurs.c
ncurses 5.9 - patch 20121215
[ncurses.git] / test / testcurs.c
index 5cc62f2df3014115609a1d34fb7ed0cf3ebce0f2..8310f3f855915b4ef73d3d3d74801fc5f7ffb3c5 100644 (file)
@@ -6,7 +6,7 @@
  *  wrs(5/28/93) -- modified to be consistent (perform identically) with either
  *                  PDCurses or under Unix System V, R4
  *
- * $Id: testcurs.c,v 1.43 2010/11/13 21:02:28 tom Exp $
+ * $Id: testcurs.c,v 1.46 2012/11/24 19:38:20 tom Exp $
  */
 
 #include <test.priv.h>
@@ -45,18 +45,6 @@ static const COMMAND command[] =
 };
 #define MAX_OPTIONS (int) SIZEOF(command)
 
-#if !HAVE_STRDUP
-#define strdup my_strdup
-static char *
-strdup(char *s)
-{
-    char *p = typeMalloc(char, strlen(s) + 1);
-    if (p)
-       strcpy(p, s);
-    return (p);
-}
-#endif /* not HAVE_STRDUP */
-
 static int width, height;
 
 int
@@ -85,7 +73,7 @@ main(
 #ifdef A_COLOR
        if (has_colors()) {
            init_pair(1, COLOR_WHITE, COLOR_BLUE);
-           wbkgd(win, COLOR_PAIR(1));
+           wbkgd(win, (chtype) COLOR_PAIR(1));
        } else
            wbkgd(win, A_REVERSE);
 #else
@@ -491,7 +479,7 @@ outputTest(WINDOW *win)
 #ifdef A_COLOR
        if (has_colors()) {
            init_pair(3, COLOR_BLUE, COLOR_WHITE);
-           wbkgd(win1, COLOR_PAIR(3));
+           wbkgd(win1, (chtype) COLOR_PAIR(3));
        } else
            wbkgd(win1, A_NORMAL);
 #else
@@ -693,9 +681,11 @@ padTest(WINDOW *dummy GCC_UNUSED)
        raw();
        wgetch(pad);
 
-       spad = subpad(pad, 12, 25, 6, 52);
-       MvWAddStr(spad, 2, 2, "This is a new subpad");
-       box(spad, 0, 0);
+       if ((spad = subpad(pad, 12, 25, 6, 52)) != 0) {
+           MvWAddStr(spad, 2, 2, "This is a new subpad");
+           box(spad, 0, 0);
+           delwin(spad);
+       }
        prefresh(pad, 0, 0, 0, 0, 15, 75);
        keypad(pad, TRUE);
        raw();