File indexing completed on 2026-04-17 07:47:54
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include <boost/test/unit_test.hpp>
0010
0011 #include "ActsPlugins/Mille/ActsToMille.hpp"
0012
0013 #include <memory>
0014
0015 #include "Mille/MilleFactory.h"
0016
0017 using namespace ActsPlugins::ActsToMille;
0018
0019 BOOST_AUTO_TEST_SUITE(ActsMilleBasicCallTests)
0020
0021 BOOST_AUTO_TEST_CASE(OpenMilleRecord) {
0022 const std::string fname = "MyMilleRecord.root";
0023 std::unique_ptr<Mille::MilleRecord> theRecord =
0024 Mille::spawnMilleRecord(fname);
0025 BOOST_CHECK_NE(theRecord.get(), nullptr);
0026
0027 ActsAlignment::detail::TrackAlignmentState dummyState;
0028 dumpToMille(dummyState, theRecord.get());
0029 theRecord->writeRecord();
0030 theRecord->flushOutputFile();
0031 theRecord.reset(nullptr);
0032
0033
0034 auto theReader = Mille::spawnMilleReader(fname);
0035 BOOST_CHECK(theReader->open(fname));
0036 BOOST_CHECK_NE(theReader.get(), nullptr);
0037 Mille::MilleBuffer buffer;
0038 buffer.resize(100, true);
0039 const auto& [nRead, stat] = theReader->readToBuffer(buffer);
0040 BOOST_CHECK_EQUAL(stat,
0041 4);
0042 BOOST_CHECK_EQUAL(
0043 nRead, 5);
0044 const auto& [nReadSecondCall, statSecondCall] =
0045 theReader->readToBuffer(buffer);
0046 BOOST_CHECK_EQUAL(statSecondCall,
0047 0);
0048 BOOST_CHECK_EQUAL(nReadSecondCall, 0);
0049 }
0050
0051 BOOST_AUTO_TEST_SUITE_END()