From 46c9c13ea7d5b2a2fec304f12b3db77c8028caea Mon Sep 17 00:00:00 2001 From: malaterre Date: Sun, 25 Apr 2004 19:43:13 +0000 Subject: [PATCH] Fix warnings, add a GDCM_DATA_ROOT to CMake --- CMakeLists.txt | 8 ++++++++ Testing/CMakeLists.txt | 19 ++++++++++++------- Testing/TestChangeHeader.cxx | 5 +++-- Testing/TestHash.cxx | 2 +- src/gdcmHeaderHelper.cxx | 2 +- 5 files changed, 25 insertions(+), 11 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4cb746f9..0ada9b14 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,6 +58,14 @@ SUBDIRS( Test ) +#----------------------------------------------------------------------------- +# Adding GDCM_DATA_ROOT +FIND_PATH(GDCM_DATA_ROOT gdcm-ACR-LibIDO.acr + ${GDCM_SOURCE_DIR}/../gdcmData + $ENV{GDCM_DATA} + $ENV{PUB_DICT_PATH}/../../gdcmData +) + #----------------------------------------------------------------------------- # Add the testing directories OPTION(GDCM_BUILD_TESTING "Test the project" ON) diff --git a/Testing/CMakeLists.txt b/Testing/CMakeLists.txt index 0b27899a..9ff25734 100644 --- a/Testing/CMakeLists.txt +++ b/Testing/CMakeLists.txt @@ -15,17 +15,22 @@ ENDIF(NOT CMAKE_HAVE_STDINT_H) SET(TEST_SOURCES - PrintHeader.cxx - testWrite.cxx - testChangeEntete.cxx + PrintHeader.cxx #require test.acr + bug1.cxx #require test.acr + dcm2acr.cxx #require test.acr hashtest.cxx - bug1.cxx - pourFindTaggs.cxx - dcm2acr.cxx - PrintDicomDir.cxx makeDicomDir.cxx testDicomDir.cxx + testWrite.cxx ) +IF (GDCM_DATA_ROOT) + # add tests that require data + SET(TEST_SOURCES ${TEST_SOURCES} + PrintDicomDir.cxx + pourFindTaggs.cxx + testChangeEntete.cxx + ) +ENDIF (GDCM_DATA_ROOT) # include stuff INCLUDE_DIRECTORIES( diff --git a/Testing/TestChangeHeader.cxx b/Testing/TestChangeHeader.cxx index d33fc1f2..9dbbf7a3 100644 --- a/Testing/TestChangeHeader.cxx +++ b/Testing/TestChangeHeader.cxx @@ -19,8 +19,9 @@ int testChangeEntete(int argc, char* argv[]) { int dataSize; if (argc < 3) { - printf ("usage :\n testChangeEntete nomFichierPourEntete nomFichierPourDonnées \n"); - exit(0); + std::cerr << "usage :" << std::endl << + argv[0] << " nomFichierPourEntete nomFichierPourDonnées" << std::endl; + return 0; } premier = argv[1]; diff --git a/Testing/TestHash.cxx b/Testing/TestHash.cxx index f0af57bb..230550ee 100644 --- a/Testing/TestHash.cxx +++ b/Testing/TestHash.cxx @@ -32,7 +32,7 @@ int hashtest( int, char * [] ) { // Voir : //http://www.developer.com/net/cplus/article.php/10919_2119781_3 // - // domage que ca ne marche pas ... + // dommage que ca ne marche pas ... return 0; } diff --git a/src/gdcmHeaderHelper.cxx b/src/gdcmHeaderHelper.cxx index 29304688..c8647471 100644 --- a/src/gdcmHeaderHelper.cxx +++ b/src/gdcmHeaderHelper.cxx @@ -151,7 +151,7 @@ float gdcmHeaderHelper::GetXSpacing() { * @return Y dimension of a pixel */ float gdcmHeaderHelper::GetYSpacing() { - float xspacing, yspacing; + float yspacing; std::string StrSpacing = GetEntryByNumber(0x0028,0x0030); if (StrSpacing == GDCM_UNFOUND) { -- 2.45.0