]> Creatis software - gdcm.git/blobdiff - Testing/TestAllEntryVerify.cxx
* gdcmPython/testSuite.py checks on CR-MONO1-10-chest.dcm moved to
[gdcm.git] / Testing / TestAllEntryVerify.cxx
index 889f73bca425d8439e8bb96ca03c2cca321a231c..60c6e9a1dbdb896770ab9e3ae68bafcef84d53e9 100644 (file)
@@ -129,6 +129,8 @@ bool ReferenceFileParser::AddKeyValuePairToMap( string& key, string& value )
    if ( CurrentMapEntryValuesPtr->count(key) != 0 )
       return false;
    (*CurrentMapEntryValuesPtr)[key] = value;
+   
+   return true; //??
 }
 
 void ReferenceFileParser::Print()
@@ -161,7 +163,7 @@ bool ReferenceFileParser::Check()
    {
       string fileName = DataPath + i->first;
       cout << Indent << "FileName: " << fileName << endl;
-      gdcmHeader* tested = new gdcmHeader( fileName.c_str(), false, true );
+      gdcmHeader* tested = new gdcmHeader( fileName.c_str() );
       if( !tested->IsReadable() )
       {
         cerr << Indent << "Image not gdcm compatible:"
@@ -200,9 +202,10 @@ bool ReferenceFileParser::Check()
          }
       }
       delete tested;
-      cout << Indent << endl;
+      cout << Indent << "  OK" << endl;
    }
    cout << Indent << endl;
+   return true;
 }
 
 istream& ReferenceFileParser::eatwhite( istream& is )
@@ -368,9 +371,6 @@ void ReferenceFileParser::FirstPassReferenceFile() throw ( ParserException )
       // Uncommented line outside of block is not clean:
       if ( !inBlock && !beginBlock )
       {
-         cerr << Indent
-              << "Syntax warning: outside of block [] data at line "
-              << lineNumber++ << " not considered." << endl;
          continue;
       }
 
@@ -432,6 +432,7 @@ bool ReferenceFileParser::Open( string& referenceFileName )
    }
 
    from.close();
+   return true; //??
 }
 
 void ReferenceFileParser::CleanUpLine( string& line )
@@ -580,6 +581,7 @@ bool ReferenceFileParser::SecondPassReferenceFile()
 
       ParseRegularLine( line );
    }
+   return true; //??
 }
 
 int TestAllEntryVerify(int argc, char* argv[]) 
@@ -610,30 +612,7 @@ int TestAllEntryVerify(int argc, char* argv[])
    Parser.Open(referenceFilename);
    Parser.SetDataPath(referenceDir);
    // Parser.Print();
-   Parser.Check();
-/*
-   int i = 0;
-   while( gdcmDataImages[i] != 0 )
-   {
-      string filename = GDCM_DATA_ROOT;
-      filename += "/";  //doh!
-      filename += gdcmDataImages[i++];
-   
-      cout << "   Testing: " << filename << endl;
-
-      gdcmHeader* tested = new gdcmHeader( filename.c_str(), false, true );
-      if( !tested->GetHeader()->IsReadable() )
-      {
-        cout << "      Image not gdcm compatible:"
-                  << filename << endl;
-        delete tested;
-        return 1;
-      }
-
-      //////////////// Clean up:
-      delete tested;
-   }
-*/
-
-   return 0;
+   if ( Parser.Check() )
+      return 0;
+   return 1;
 }