Skip to content

Commit

Permalink
BUG: Avoid reading errors in tests by first closing the written file
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon Rit authored and SimonRit committed Sep 30, 2024
1 parent 2c8effc commit 59c5464
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/rtkcyclicdeformationtest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -132,6 +132,7 @@ main(int, char **)
std::string signalFileName = "signal_CyclicDeformation.txt";
std::ofstream signalFile(signalFileName.c_str());
signalFile << "0.3" << std::endl;
signalFile.close();

// Set the forward and back projection filters to be used
using CyclicDeformationType = rtk::CyclicDeformationImageFilter<DVFSequenceImageType, DVFImageType>;
Expand Down
1 change: 1 addition & 0 deletions test/rtkfourdconjugategradienttest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Ground truth
auto * Volumes = new VolumeType::Pointer[fourDSize[3]];
Expand Down
1 change: 1 addition & 0 deletions test/rtkfourdroostertest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -215,6 +215,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Create a vector field and its (very rough) inverse
using IteratorType = itk::ImageRegionIteratorWithIndex<DVFSequenceImageType>;
Expand Down
3 changes: 1 addition & 2 deletions test/rtkfourdsarttest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}

// pasteFilter->GetOutput()->Print(std::cout);
signalFile.close();

// Ground truth
auto * Volumes = new VolumeType::Pointer[fourDSize[3]];
Expand Down
1 change: 1 addition & 0 deletions test/rtkmotioncompensatedfdktest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Create vector field
using DVFPixelType = itk::Vector<float, 3>;
Expand Down
1 change: 1 addition & 0 deletions test/rtkselectoneprojpercycletest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Select
using SelectionType = rtk::SelectOneProjectionPerCycleImageFilter<OutputImageType>;
Expand Down
1 change: 1 addition & 0 deletions test/rtkwarpfourdtoprojectionstacktest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Create a vector field and its (very rough) inverse
using IteratorType = itk::ImageRegionIteratorWithIndex<DVFSequenceImageType>;
Expand Down
1 change: 1 addition & 0 deletions test/rtkwarpprojectionstacktofourdtest.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ main(int, char **)
// Signal
signalFile << (noProj % 8) / 8. << std::endl;
}
signalFile.close();

// Create a vector field and its (very rough) inverse
using IteratorType = itk::ImageRegionIteratorWithIndex<DVFSequenceImageType>;
Expand Down

0 comments on commit 59c5464

Please sign in to comment.