]> mj.ucw.cz Git - libucw.git/blobdiff - images/image-test.c
Merge with git+ssh://git.ucw.cz/projects/sherlock/GIT/sherlock.git
[libucw.git] / images / image-test.c
index c751e8a0225ccd3c0bc0f3ed7407784c3d056976..b046672f9e1959aec7a3eb3df05a07d6ac0b54fd 100644 (file)
@@ -1,3 +1,12 @@
+/*
+ *     Image Library -- Simple automatic tests
+ *
+ *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
+ *
+ *     This software may be freely distributed and used according to the terms
+ *     of the GNU Lesser General Public License.
+ */
+
 #undef LOCAL_DEBUG
 
 #include "lib/lib.h"
 #undef LOCAL_DEBUG
 
 #include "lib/lib.h"
@@ -129,7 +138,7 @@ test_threads_thread(void *param UNUSED)
          uns format = 0;
          while (!format)
            {
          uns format = 0;
          while (!format)
            {
-             switch (random_max(2))
+             switch (random_max(3))
                {
                  case 0:
 #if defined(CONFIG_IMAGES_LIBJPEG) || defined(CONFIG_IMAGES_LIBMAGICK)
                {
                  case 0:
 #if defined(CONFIG_IMAGES_LIBJPEG) || defined(CONFIG_IMAGES_LIBMAGICK)
@@ -139,6 +148,11 @@ test_threads_thread(void *param UNUSED)
                  case 1:
 #if defined(CONFIG_IMAGES_LIBPNG) || defined(CONFIG_IMAGES_LIBMAGICK)
                    format = IMAGE_FORMAT_PNG;
                  case 1:
 #if defined(CONFIG_IMAGES_LIBPNG) || defined(CONFIG_IMAGES_LIBMAGICK)
                    format = IMAGE_FORMAT_PNG;
+#endif
+                   break;
+                 case 2:
+#if defined(CONFIG_IMAGES_LIBMAGICK)
+                   format = IMAGE_FORMAT_GIF;
 #endif
                    break;
                  default:
 #endif
                    break;
                  default:
@@ -203,12 +217,12 @@ main(int argc, char **argv)
       die("Invalid parameter");
 
   srandom(time(NULL) ^ getpid());
       die("Invalid parameter");
 
   srandom(time(NULL) ^ getpid());
-  
+
   if (want_image_iface)
     test_image_iface();
   if (want_threads)
     test_threads();
   if (want_image_iface)
     test_image_iface();
   if (want_threads)
     test_threads();
-  
+
   return 0;
 }
 
   return 0;
 }