From 6abbab311de416edaae1ccaa385da1f7abb86cf6 Mon Sep 17 00:00:00 2001 From: jpr Date: Thu, 20 Sep 2007 12:48:20 +0000 Subject: [PATCH] Re-activate TestInLine --- Testing/CMakeLists.txt | 5 ++++- Testing/TestInline.cxx | 25 ++++++++++++++++--------- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index a6c7b961..8a279fec 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -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}) diff --git a/Testing/TestInline.cxx b/Testing/TestInline.cxx index 774830a3..5b3bcf9e 100755 --- a/Testing/TestInline.cxx +++ b/Testing/TestInline.cxx @@ -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); -- 2.45.1