]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/testcurs.c
ncurses 5.9 - patch 20121124
[ncurses.git] / test / testcurs.c
index f9716e971bcbe19c5ffb4a3d06ece0d3296690f2..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.44 2012/06/09 19:10:45 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
@@ -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();