Rewrite some tests using switch statements.

Add a note for the reason I do this in the HACKING file.
This commit is contained in:
Romain Tartiere 2010-12-18 02:07:56 +00:00
parent 1d3c3f5dfd
commit 373cb4f0ef
3 changed files with 39 additions and 7 deletions

12
HACKING
View file

@ -70,3 +70,15 @@ infrastructure ready for hacking the new card support:
knows...
- <tag>_tag_free() SHALL free all resources allocated for the tag
(surprising, isn't it?)
Various guidelines
------------------
- If a given card has different cryptographic modes, you SHOULD use
switch/cases to handle specific branches of code, even when applicable to
only one cypher. The idea is that if you don't provide support for all
cryptographic schemes, or if an evolution of the card provides more
cryptographic possibilities, when adding support for a new cypher, the
compiler can warn the developer about unhandled values in switch
statements. Please refer to the Mifare DESFire code for an example.