Skip to content

Commit

Permalink
change header magics
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin-j97 committed Jun 11, 2024
1 parent c15ca1d commit d0afc98
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/segment/meta.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ use crate::{
use byteorder::{BigEndian, ReadBytesExt, WriteBytesExt};
use std::io::{Read, Write};

pub const METADATA_HEADER_MAGIC: &[u8] = &[b'F', b'J', b'L', b'L', b'S', b'M', b'D', b'1'];
pub const METADATA_HEADER_MAGIC: &[u8] = &[b'V', b'L', b'O', b'G', b'S', b'M', b'D', b'1'];

#[derive(Debug)]
#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
Expand Down
2 changes: 1 addition & 1 deletion src/segment/trailer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use std::{
path::Path,
};

pub const TRAILER_MAGIC: &[u8] = &[b'F', b'J', b'L', b'L', b'T', b'R', b'L', b'1'];
pub const TRAILER_MAGIC: &[u8] = &[b'V', b'L', b'O', b'G', b'T', b'R', b'L', b'1'];
pub const TRAILER_SIZE: usize = 256;

#[derive(Debug)]
Expand Down
6 changes: 3 additions & 3 deletions src/version.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ impl TryFrom<u16> for Version {
}
}

const MAGIC_BYTES: [u8; 3] = [b'F', b'J', b'L'];
const MAGIC_BYTES: [u8; 3] = [b'V', b'L', b'G'];

impl Version {
// NOTE: Used in tests
Expand Down Expand Up @@ -79,14 +79,14 @@ mod tests {
pub fn version_serialize() -> crate::Result<()> {
let mut bytes = vec![];
Version::V1.write_file_header(&mut bytes)?;
assert_eq!(bytes, &[b'F', b'J', b'L', 0, 1]);
assert_eq!(bytes, &[b'V', b'L', b'G', 0, 1]);
Ok(())
}

#[test]
#[allow(clippy::expect_used)]
pub fn version_deserialize_success() {
let version = Version::parse_file_header(&[b'F', b'J', b'L', 0, 1]);
let version = Version::parse_file_header(&[b'V', b'L', b'G', 0, 1]);
assert_eq!(version, Some(Version::V1));
}

Expand Down
Binary file modified test_fixture/v1_vlog/.vlog
Binary file not shown.
Binary file modified test_fixture/v1_vlog/segments/0
Binary file not shown.

0 comments on commit d0afc98

Please sign in to comment.