]> Creatis software - gdcm.git/blobdiff - Testing/TestInline.cxx
BUG: backport from gdcm 1.2. Should not crash when jpeg was not instanciated
[gdcm.git] / Testing / TestInline.cxx
index 33feed842836dcaeed7f14c61e43d1fc16c180ff..b427e37f7fc50ffc30272e94e894f89c5e0f4c22 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestInline.cxx,v $
   Language:  C++
-  Date:      $Date: 2007/09/25 10:07:42 $
-  Version:   $Revision: 1.14 $
+  Date:      $Date: 2008/04/10 12:15:34 $
+  Version:   $Revision: 1.19 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 
 #include "gdcmUtil.h"
 
-#ifdef _MSC_VER
+#include <stdlib.h> // atoi
+#if defined(__BORLANDC__)  || defined (_MSC_VER)
 #include <time.h>
+   #if defined(__BORLANDC__)
+   #include <stdio.h>
+   #endif
 #define GET_TIME(a) a=clock()
 #define HOW_LONG(b,a)                             \
-   std::cout  << (double) (b-a)  << std::endl  
+   std::cout  << (double) (b-a)  << std::endl 
+
 #else
 #include <sys/times.h>
 #define GET_TIME(a)  times(&a)
@@ -182,7 +187,7 @@ double passDirectDouble(double a, double b)
 int TestInline(int argc, char *argv[])
 {
 
-#ifdef _MSC_VER
+#if defined(__BORLANDC__) || defined (_MSC_VER)
    clock_t tms1, tms2;
 #else
    struct tms tms1, tms2;
@@ -201,6 +206,7 @@ int TestInline(int argc, char *argv[])
    std::cout << "Size of long      " << sizeof(long)      << std::endl;
    std::cout << "Size of float     " << sizeof(float)     << std::endl;
    std::cout << "Size of double    " << sizeof(double)    << std::endl;
+   std::cout << "Size of bool      " << sizeof(bool)    << std::endl;   
    std::cout << std::endl;
    std::cout << "Size of char*     " << sizeof(char*)     << std::endl;
    std::cout << "Size of short int*" << sizeof(short int*)<< std::endl;
@@ -572,7 +578,7 @@ int TestInline(int argc, char *argv[])
    GET_TIME(tms2);   
    HOW_LONG(tms2,tms1);
 
-   return 1; // will generate an error, 
+   //return 1; // will generate an error, 
              // just to allow us to see the full log in the dashboard
-   //return 0;
+   return 0;
 }