]> Creatis software - gdcm.git/commitdiff
Propagate GDCM_DATA_ROOT into other tests
authormalaterre <malaterre>
Sun, 25 Apr 2004 23:00:46 +0000 (23:00 +0000)
committermalaterre <malaterre>
Sun, 25 Apr 2004 23:00:46 +0000 (23:00 +0000)
Testing/TestBug.cxx
Testing/TestDicomDir.cxx

index c63e0091ec0cb425fe1a8698967ac0a44a2f279c..7126585c3b024fdd77285cc4a8c6369664c280fb 100644 (file)
@@ -1,5 +1,6 @@
 // The following crashes on Win32
 #include "gdcm.h"
+#include "gdcmConfigure.h"
 
 int bug1(int argc, char* argv[])
 {  
@@ -8,7 +9,11 @@ int bug1(int argc, char* argv[])
        if (argc > 1)
                e1 = new gdcmHeader(argv[1]);
        else
-               e1 = new gdcmHeader("test.acr");
+    {
+    std::string filename = GDCM_DATA_ROOT;
+    filename += "/test.acr";
+               e1 = new gdcmHeader( filename.c_str() );
+    }
        e1->PrintPubDict();
 
   return 0;
index 9b6855b701d89420ce598f5ac0fee3bf50ac3d29..4de300aa36b426b777dd8d4ff08d144f1fc13393 100644 (file)
@@ -2,6 +2,7 @@
 #include "gdcm.h"
 #include "gdcmHeaderEntry.h"
 #include "gdcmDicomDir.h"
+#include "gdcmConfigure.h"
 
 #include <fstream>
 #ifdef GDCM_NO_ANSI_STRING_STREAM
@@ -31,9 +32,11 @@ int testDicomDir(int argc, char* argv[])
    std::string file; 
    if (argc > 1) 
       file = argv[1];    
-   else        
-      file = "../gdcmData/DICOMDIR";
-      
+   else {
+      file += GDCM_DATA_ROOT;
+      file += "/DICOMDIR";
+    }
+
    e1 = new gdcmDicomDir(file.c_str());
        if (argc > 2) {
           int level = atoi(argv[2]);