@@ -39,22 +39,23 @@ class wal_history {
3939 explicit wal_history (boost::filesystem::path dir_path);
4040
4141 void append (epoch_id_type epoch);
42- std::vector<record> list () const ;
42+ [[nodiscard]] std::vector<record> list () const ;
4343 void check_and_recover ();
4444
4545
4646
4747protected:
48- // for Unit Testing
49- void set_file_operations (std::unique_ptr<file_operations> file_ops) { file_ops_ = std::move (file_ops); }
50- void reset_file_operations () { file_ops_ = std::make_unique<real_file_operations>(); }
48+ // Note: These members are protected (not private) to allow access from test subclasses.
5149 static constexpr std::size_t record_size = sizeof (epoch_id_type) + 16 + sizeof (std::int64_t );
52- void write_record (std::ofstream& ofs, epoch_id_type epoch, const boost::uuids::uuid& uuid, std::int64_t timestamp);
53- static record parse_record (const std::array<std::byte, record_size>& buf);
54- std::vector<record> read_all_records (const boost::filesystem::path& file_path) const ;
5550 static constexpr const char * file_name_ = " wal_history" ;
5651 static constexpr const char * tmp_file_name_ = " wal_history.tmp" ;
5752
53+ void set_file_operations (std::unique_ptr<file_operations> file_ops) { file_ops_ = std::move (file_ops); }
54+ void reset_file_operations () { file_ops_ = std::make_unique<real_file_operations>(); }
55+ void write_record (std::ofstream& ofs, epoch_id_type epoch, const boost::uuids::uuid& uuid, std::int64_t timestamp);
56+ [[nodiscard]] static record parse_record (const std::array<std::byte, record_size>& buf);
57+ [[nodiscard]] std::vector<record> read_all_records (const boost::filesystem::path& file_path) const ;
58+
5859private:
5960 boost::filesystem::path dir_path_;
6061 std::unique_ptr<file_operations> file_ops_ = std::make_unique<real_file_operations>();
0 commit comments