]> Creatis software - gdcm.git/blobdiff - Testing/VTKTestWriteSeq.cxx
Fix mistypings
[gdcm.git] / Testing / VTKTestWriteSeq.cxx
index 4d3b41ca98987491b39855ddbb8133c98c1f739e..debaf8c427489005ce1205e79e5c5a1d436b8e1e 100644 (file)
@@ -3,8 +3,8 @@
   Program:   gdcm
   Module:    $RCSfile: VTKTestWriteSeq.cxx,v $
   Language:  C++
-  Date:      $Date: 2005/02/09 15:31:15 $
-  Version:   $Revision: 1.1 $
+  Date:      $Date: 2007/09/18 07:58:39 $
+  Version:   $Revision: 1.7 $
                                                                                 
   Copyright (c) CREATIS (Centre de Recherche et d'Applications en Traitement de
   l'Image). All rights reserved. See Doc/License.txt or
 #include "vtkImageShiftScale.h"
 
 #include <iostream>
+#include <sstream>
 
 //Generated file:
 #include "gdcmDataSeqImages.h"
+#include "gdcmDebug.h"
 
 #ifndef vtkFloatingPointType
 #define vtkFloatingPointType float
@@ -38,14 +40,14 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
                    std::string const &filename, 
                    std::string const &referenceFileName)
 {
-   int retVal = 0;  //by default this is an error
+   int retVal;
 
    // Set the reader   
    vtkGdcmReader *reader = vtkGdcmReader::New();
 
    char *newFileDcm = new char[filename.size()+1];
    int fileCount = 0;
-   for(int i=0;i<9;i++)
+   for(int i=0;i<10;i++)
    {
       fileCount = i;
       sprintf(newFileDcm,filename.c_str(),i);
@@ -66,7 +68,8 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
    // Write the image
    vtkGdcmWriter *writer = vtkGdcmWriter::New();
    writer->SetFilePattern("%s%02d.dcm");
-   writer->SetFilePrefix("TestWrite");
+   char filePrefix[] = "TestWrite";
+   writer->SetFilePrefix(filePrefix);
    writer->SetFileDimensionality(2);
    writer->SetInput(reader->GetOutput());
    writer->Write();
@@ -105,7 +108,7 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
 
    // make test
    int ret = 0;
-   ostrstream str;
+   std::ostringstream str;
    char *newFilePng = new char[referenceFileName.size()+1];
    for(int j=0;j<fileCount;j++)
    {
@@ -187,7 +190,6 @@ int VTKWriteSeqTest(vtkTesting *t, vtkImageViewer *viewer,
       {
          std::cerr << str.str();
       }
-      str.rdbuf()->freeze(1);
 
       if( retVal == vtkTesting::PASSED )
       {
@@ -217,6 +219,8 @@ int VTKTestWriteSeq(int argc, char *argv[])
       }
    }
 
+   GDCM_NAME_SPACE::Debug::DebugOn();
+
    int ret = 0;
    vtkTesting *t = vtkTesting::New();
    vtkImageViewer *viewer;