]> Creatis software - gdcm.git/commitdiff
Re-activate TestInLine
authorjpr <jpr>
Thu, 20 Sep 2007 12:48:20 +0000 (12:48 +0000)
committerjpr <jpr>
Thu, 20 Sep 2007 12:48:20 +0000 (12:48 +0000)
Testing/CMakeLists.txt
Testing/TestInline.cxx

index a6c7b961c0b387be3fb824e4d49adc702facfd97..8a279fecb4a95bb03ef55a87a9ff3b39da08eb21 100644 (file)
@@ -27,7 +27,7 @@ SET(TEST_SOURCES
 )
 IF(UNIX)
   SET(TEST_SOURCES ${TEST_SOURCES}
-    #TestInline.cxx
+    TestInline.cxx
   )
 ENDIF(UNIX)
 
@@ -59,9 +59,11 @@ IF (GDCM_DATA_ROOT)
   )
   # add test that require VTK:
   IF(GDCM_VTK)
+  
     IF("${VTK_MAJOR_VERSION}" LESS 4)
       MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !")
     ELSE("${VTK_MAJOR_VERSION}" LESS 4)
+    
       IF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 2)
         MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !"
                              "Although gdcm should compile fine. You just need to turn BUILD_TESTING:=OFF")
@@ -70,6 +72,7 @@ IF (GDCM_DATA_ROOT)
         MESSAGE(FATAL_ERROR "This VTK version is not supported, you are on your own !"
                              "Although gdcm should compile fine. You just need to turn BUILD_TESTING:=OFF")
       ENDIF("${VTK_MAJOR_VERSION}" EQUAL 4 AND "${VTK_MINOR_VERSION}" EQUAL 4 AND "${VTK_BUILD_VERSION}" LESS 3)
+      
       # Include the VTK library since we know this is going to work
       INCLUDE(${VTK_USE_FILE})
 
index 774830a3ec445199d45b3421e6e35867a8e2c372..5b3bcf9ef6d645073cc0f6e819cae6f593b47366 100755 (executable)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: TestInline.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/11/30 11:40:26 $
-  Version:   $Revision: 1.11 $
+  Date:      $Date: 2007/09/20 12:48:21 $
+  Version:   $Revision: 1.12 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
@@ -166,7 +166,9 @@ double passDirectDouble(double a, double b)
 
 int TestInline(int argc, char *argv[])
 {
-
+   std::cout << std::endl << std::endl
+             << "Just to be sure : sizes of native types" 
+             << std::endl << std::endl;
    // just to know, on every proc
    std::cout << "Size of short int " << sizeof(short int) << std::endl;
    std::cout << "Size of int  "      << sizeof(int)       << std::endl;
@@ -181,13 +183,15 @@ int TestInline(int argc, char *argv[])
    if (argc > 1)
       nbLoop = atoi(argv[1]);
    else
-      nbLoop = 10000000;
+      nbLoop = 100000000;
 
    //clock_t r1, r2;
    struct tms tms1, tms2;
    
    double a = 1, b = 2;
    
+   std::cout << "Exchange 2 scalars " << nbLoop << " times"
+             << std::endl << std::endl;
    uint8_t  x8 =1, y8 =2;    
    uint16_t x16=1, y16=2;    
    uint32_t x32=1, y32=2;    
@@ -374,7 +378,10 @@ int TestInline(int argc, char *argv[])
 
 
  // ----------------------------------------
+   std::cout << std::endl << std::endl
+             << "Check different ways of passing scalars to a function, " 
+             << nbLoop << " times" << std::endl << std::endl; 
+    
    std::cout << "Pass uint_8 param directly"
              << std::endl;
    //r1 = times(&tms1);
@@ -422,7 +429,7 @@ int TestInline(int argc, char *argv[])
         << std::endl; 
 
  // ----------------------------------------
+   std::cout << std::endl;
    std::cout << "Pass uint_16 param directly"
              << std::endl;
    //r1 = times(&tms1);
@@ -472,7 +479,7 @@ int TestInline(int argc, char *argv[])
 
 
  // ----------------------------------------
-
+   std::cout << std::endl;
    std::cout << "Pass uint_32 param directly"
              << std::endl;
    //r1 = times(&tms1);
@@ -520,7 +527,7 @@ int TestInline(int argc, char *argv[])
         << std::endl; 
 
  // ----------------------------------------
+   std::cout << std::endl; 
    std::cout << "Pass float param directly"
              << std::endl;
    //r1 = times(&tms1);
@@ -571,7 +578,7 @@ int TestInline(int argc, char *argv[])
         << std::endl; 
 
  // ----------------------------------------
+   std::cout << std::endl; 
    std::cout << "Pass double param directly"
              << std::endl;
    //r1 = times(&tms1);