9 #include <io/RawCorsikaFile.h>
10 #include <io/CorsikaBlock.h>
11 #include <io/CorsikaIOException.h>
13 #include <cppunit/extensions/HelperMacros.h>
17 #include <tst/Verify.h>
61 CPPUNIT_ASSERT(
sizeof(RawFile::ThinnedDiskBlock) ==
74 RawFile f1(
"NoSuchCorsikaFile.part");
87 f->
Open(
"NoSuchCorsikaFile.part");
116 CPPUNIT_ASSERT(b.IsRunHeader());
119 CPPUNIT_ASSERT(b.IsEventHeader());
126 bool trailerFound =
false;
127 while (!trailerFound) {
129 trailerFound = b.IsRunTrailer();
137 RawFile::PositionType posTrailer;
139 bool trailerFound =
false;
141 while (!trailerFound) {
143 trailerFound = b.IsRunTrailer();
149 CPPUNIT_ASSERT(b.IsEventHeader());
153 CPPUNIT_ASSERT(b.IsRunTrailer());
157 CPPUNIT_ASSERT(b.IsEventTrailer());
161 CPPUNIT_ASSERT(b.IsRunHeader());
CPPUNIT_TEST_EXCEPTION(testConstructorThrow, io::CorsikaIOException)
void testOpenThrowNonExistent()
static const int kBlockSize
void Close()
Close file (no-op for closed file).
CPPUNIT_TEST_SUITE(testRawFile)
void testOpenThrowReOpen()
bool GetNextBlock(Block &block)
Read one block and advance.
CPPUNIT_TEST_SUITE_REGISTRATION(testAiresShowerFile)
bool IsOpen() const
Check if the file is open.
Base for exceptions in the CORSIKA reader.
void Expected()
Print `Expected' for expected failures.
BasicBlock< ParticleData, CherenkovData, kParticlesInBlock, 39 > Block
void SeekTo(const PositionType position, const bool reset=false)
Seek to a given block, the next block will be thePosition.
PositionType GetNextPosition() const
Number of the block read by the next call to GetNextBlock.
void testConstructorThrow()
bool Open(const std::string &name, const bool noException=false)
This class represents a corsika block. It deals with all the different sub-types of blocks...