Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tests for flash storage #36

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Conversation

katyo
Copy link

@katyo katyo commented May 9, 2023

No description provided.

@katyo katyo marked this pull request as draft May 9, 2023 04:33

/// Simple RAM-backed flash storage implementation for tests
#[derive(Clone, Copy, Debug)]
pub struct MockFlash<
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you move this inside the mod tests module?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The idea is export this struct to use for testing dependent crates.

katyo added 2 commits May 26, 2023 11:14
Despite it looks little bit low-level but it works well with unaligned access.
I/O operations optimized by splitting it to stages:

- Not aligned start
- Aligned middle
- Not Aligned end

Each stage may or may not be needed depending from memory offset and data
length.

Also the data checked to determine that erase and/or write needed or not.
@katyo katyo marked this pull request as ready for review May 26, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants