]> Creatis software - gdcm.git/blobdiff - Testing/TestReadWriteReadCompare.cxx
* src/gdcmDocEntryArchive.[h|cxx] : bug fix and add a method to temporary
[gdcm.git] / Testing / TestReadWriteReadCompare.cxx
index 6d53cda116f23901ea1096871ae9f139e9d41e03..5597861e49ebbafc061dd8a8e1536ddf82f64444 100644 (file)
@@ -1,3 +1,20 @@
+/*=========================================================================
+                                                                                
+  Program:   gdcm
+  Module:    $RCSfile: TestReadWriteReadCompare.cxx,v $
+  Language:  C++
+  Date:      $Date: 2004/11/24 10:23:46 $
+  Version:   $Revision: 1.14 $
+                                                                                
+  Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
+  l'Image). All rights reserved. See Doc/License.txt or
+  http://www.creatis.insa-lyon.fr/Public/Gdcm/License.html for details.
+                                                                                
+     This software is distributed WITHOUT ANY WARRANTY; without even
+     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
+     PURPOSE.  See the above copyright notices for more information.
+                                                                                
+=========================================================================*/
 #include "gdcmHeader.h"
 #include "gdcmFile.h"
 
@@ -18,7 +35,7 @@ int CompareInternal(std::string const & filename, std::string const & output)
       delete header;
       return 1;
    }
-   std::cout << "           step 1 ...";
+   std::cout << "           step 1...";
 
    //////////////// Step 2:
 
@@ -47,6 +64,7 @@ int CompareInternal(std::string const & filename, std::string const & output)
    
    file->SetImageData(imageData, dataSize);
    
+   file->SetWriteModeToRGB();
    file->WriteDcmExplVR( output );
    std::cout << "2...";
  
@@ -55,7 +73,8 @@ int CompareInternal(std::string const & filename, std::string const & output)
    gdcm::File* reread = new gdcm::File( output );
    if( !reread->GetHeader()->IsReadable() )
    {
-     std::cerr << "Test::TestReadWriteReadCompare: Could not reread image "
+     std::cerr << "Failed" << std::endl
+               << "Test::TestReadWriteReadCompare: Could not reread image "
                << "written:" << filename << std::endl;
      delete header;
      delete file;
@@ -71,7 +90,7 @@ int CompareInternal(std::string const & filename, std::string const & output)
 
    if (dataSize != dataSizeWritten)
    {
-      std::cout << std::endl
+      std::cout << "Failed" << std::endl
          << "        Pixel areas lengths differ: "
          << dataSize << " # " << dataSizeWritten << std::endl;
       delete header;
@@ -83,7 +102,7 @@ int CompareInternal(std::string const & filename, std::string const & output)
    if (int res = memcmp(imageData, imageDataWritten, dataSize) !=0)
    {
       (void)res;
-      std::cout << std::endl
+      std::cout << "Failed" << std::endl
          << "        Pixel differ (as expanded in memory)." << std::endl;
       delete header;
       delete file;