Skip to content

Conversation

@benwynn
Copy link
Contributor

@benwynn benwynn commented Nov 15, 2025

On my last PR that updated the parsing of the CSD register,
I was asked if a test could be provided.

Here's a test for the csd parsing, with csd values
recorded from the two cards I currently have available.

I've ordered some smaller cards so I can record and test
additional values, but happy to have others contribute
test-cases as well.

Signed-off-by: Ben Wynn <bwynn@glowie.com>
@benwynn
Copy link
Contributor Author

benwynn commented Nov 15, 2025

@projectgus Here's a test of the bits I changed recently, at least.

@projectgus projectgus self-requested a review November 18, 2025 22:19
Copy link
Contributor

@projectgus projectgus left a comment

Choose a reason for hiding this comment

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

Hi @benwynn, sorry it's taken a while for someone to get back to you with this change - appreciate you putting in the time to improve test coverage.

I have some quite small SD cards kicking around somewhere, so I'll try to get some additional CSD values - although I think merging with the two you already have would be a benefit by itself.

csd = bytearray(16)
self.readinto(csd)

def parse_csd(self, csd):
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a use case for the parse_csd function other than unit testing?

If not then it's probably better to put the complexity into MockSDCard if possible (i.e. have it handle cmd(9, ...) and then prepare the response data).

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