Commit d31ed681 authored by Purves, Murray's avatar Purves, Murray
Browse files

Closing all streams at the end of read/write

parent b0b373f0
Pipeline #16171 failed with stages
in 7 minutes and 43 seconds
......@@ -304,6 +304,8 @@ bool SpectrumPCFStream<data_type>::read_from(const std::string &file)
radix_line("PCF file read complete and successful. "
<< mData->spectrumDataCount() << " spectra read");
stream.close();
result = true;
return result;
}
......@@ -542,6 +544,8 @@ bool SpectrumPCFStream<data_type>::write_to(const std::string &file) const
radix_line(" Spectrum write complete");
}
stream.close();
result = true;
return result;
}
......
......@@ -78,7 +78,7 @@ TEST(RadixIO, SpectrumToSPE)
ASSERT_TRUE(testStream2.read_from(testWriteSPEFile));
// Test the contents of the two spectra
EXPECT_EQ(30, testSpectrum2->spectrumDataCount());
EXPECT_EQ(1, testSpectrum2->spectrumDataCount());
EXPECT_EQ(testSpectrum1->spectrumDataCount(),
testSpectrum2->spectrumDataCount());
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment