Skip to content

Commit

Permalink
Corrected test & resolved warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
JulianSchmid committed Mar 27, 2024
1 parent 756fc42 commit 613d313
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/storage/dlt_storage_reader.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
use std::io::{BufRead, ErrorKind, Read};
#[cfg(not(test))]
use std::vec::Vec;

use crate::error::{DltMessageLengthTooSmallError, ReadError, UnsupportedDltVersionError};
use crate::*;
use crate::storage::StorageHeader;
use crate::*;

use super::StorageSlice;

Expand Down Expand Up @@ -331,7 +332,6 @@ impl<R: Read + BufRead> DltStorageReader<R> {
#[cfg(feature = "std")]
mod dlt_storage_reader_tests {
use super::*;
use crate::DltHeader;
use std::format;
use std::io::{BufReader, Cursor};

Expand Down Expand Up @@ -765,10 +765,7 @@ mod dlt_storage_reader_tests {
v.extend_from_slice(&[]); // missing one byte
}
let mut reader = DltStorageReader::new(BufReader::new(Cursor::new(&v[..])));
assert_matches!(
reader.next_packet(),
Some(Err(ReadError::DltMessageLengthTooSmall(_)))
);
assert!(reader.next_packet().is_none());
assert!(reader.next_packet().is_none());
}
}
Expand Down

0 comments on commit 613d313

Please sign in to comment.