]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/hashtest.c
ncurses 5.7 - patch 20100403
[ncurses.git] / test / hashtest.c
index 64ab11a54a39f5bc7db2738a86bc45123faa4d0a..2e56d73cad38cb46ff3bf657fe6c654b94c0e0be 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
  *
  * Generate timing statistics for vertical-motion optimization.
  *
- * $Id: hashtest.c,v 1.26 2006/05/20 16:02:16 tom Exp $
+ * $Id: hashtest.c,v 1.30 2009/10/10 16:14:53 tom Exp $
  */
 
-#ifdef TRACE
-#define Trace(p) _tracef p
-#define USE_TRACE 1
-#else
-#define Trace(p)               /* nothing */
-#define USE_TRACE 0
-#endif
-
 #include <test.priv.h>
 
 #define LO_CHAR ' '
@@ -148,10 +140,10 @@ run_test(bool optimized GCC_UNUSED)
 #endif
 
     if (reverse_loops)
-       for (ch = hi; ch >= lo; ch--)
+       for (ch = (char) hi; ch >= lo; ch--)
            one_cycle(ch);
     else
-       for (ch = lo; ch <= hi; ch++)
+       for (ch = (char) lo; ch <= hi; ch++)
            one_cycle(ch);
 }
 
@@ -190,7 +182,7 @@ main(int argc, char *argv[])
 
     setlocale(LC_ALL, "");
 
-    while ((c = getopt(argc, argv, "cf:h:l:norsx")) != EOF) {
+    while ((c = getopt(argc, argv, "cf:h:l:norsx")) != -1) {
        switch (c) {
        case 'c':
            continuous = TRUE;
@@ -203,6 +195,7 @@ main(int argc, char *argv[])
            break;
        case 'l':
            test_loops = atoi(optarg);
+           assert(test_loops >= 0);
            break;
        case 'n':
            test_normal = TRUE;