- //files should be equal, so if this is the case return success=0
- int fail = (itksys::SystemTools::FilesDiffer(outFile.c_str(), refFile))?1:0;
+
+ //compare source files
+#ifdef _WIN32
+ std::string unixedOutFile= getTmpFileName();
+ //replace \r\n
+ dosToUnixFile(outFile, unixedOutFile);
+ assertFalse((itksys::SystemTools::FilesDiffer(unixedOutFile.c_str(), refFile)), "Generated mhd file != ref File");
+ remove(unixedOutFile.c_str());
+#else
+ assertFalse((itksys::SystemTools::FilesDiffer(outFile.c_str(), refFile)), "Generated mhd file != ref File");
+#endif
+
+ std::string refRawFile = mhdToRawName(strRefFile);
+ std::string rawFile = mhdToRawName(outFile);
+
+ if((itksys::SystemTools::FileExists(refRawFile.c_str(), true))){
+ //compare the raw stuff
+ if((itksys::SystemTools::FileExists(rawFile.c_str(), true))){
+ std::cout<<"Checking raws"<<std::endl;
+ assertFalse(itksys::SystemTools::FilesDiffer(refRawFile.c_str(), rawFile.c_str()), "Raws are different");
+ }
+ //file is not removed if there is a fail
+ remove(rawFile.c_str());
+ }
+ //neither the mhd is