Skip to content

Commit 95bfd74

Browse files
committed
Pin the manager's record header test to the current format
persisted_header_matches_the_descriptor_layout has failed on main since #264 moved record headers to version 3: the manager now encodes version 3, and the test still compared the encoding with the version 1 fixture. Add a version 3 fixture and compare the encoding with it. Keep the version 1 fixture to check that a header written before #264 still decodes to the same header, and keep its invalid-field checks. On cn4 (Linux, x86_64) the manager's record tests pass; before, this test failed with a version byte of 3 against 1. Design-Signed-Off-By: yatesdr; design-review=1af4
1 parent 6f2bd11 commit 95bfd74

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

‎selene-manager/src/record.rs‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -136,12 +136,13 @@ mod tests {
136136
#[test]
137137
fn persisted_header_matches_the_descriptor_layout() {
138138
let fixture = include_bytes!("../tests/fixtures/flare-header-v1.bin");
139-
let decoded = Header::decode(fixture).unwrap();
139+
let current = include_bytes!("../tests/fixtures/flare-header-v3.bin");
140140
let mut planned = new_header(&descriptor(), key(130), Some(key(65)), [4; 16], 1).unwrap();
141141
planned.created = 1_700_000_000;
142142
planned.row_checksum = 0x0123456789abcdef;
143-
assert_eq!(decoded, planned);
144-
assert_eq!(&planned.encode().unwrap(), fixture);
143+
assert_eq!(Header::decode(fixture).unwrap(), planned);
144+
assert_eq!(Header::decode(current).unwrap(), planned);
145+
assert_eq!(&planned.encode().unwrap(), current);
145146
for (offset, value) in [(129, 0u64), (173, 0), (181, u64::MAX)] {
146147
let mut invalid = *fixture;
147148
invalid[offset..offset + 8].copy_from_slice(&value.to_le_bytes());
4 KB
Binary file not shown.

0 commit comments

Comments
 (0)