DF cutter tests: detect if DF is too small for tests
This commit is contained in:
parent
bfa8bc69fc
commit
42e731b492
2 changed files with 13 additions and 0 deletions
|
@ -61,6 +61,10 @@ cut_setup (void)
|
||||||
res = mifare_desfire_get_version (tag, &version_info);
|
res = mifare_desfire_get_version (tag, &version_info);
|
||||||
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_get_version"));
|
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_get_version"));
|
||||||
|
|
||||||
|
if (version_info.hardware.storage_size < 0x18) {
|
||||||
|
cut_omit ("DESFire EV1 tests require at least a 4K card");
|
||||||
|
}
|
||||||
|
|
||||||
if ((version_info.hardware.version_major >= 1) &&
|
if ((version_info.hardware.version_major >= 1) &&
|
||||||
(version_info.software.version_major >= 1)) {
|
(version_info.software.version_major >= 1)) {
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -56,6 +56,15 @@ cut_setup (void)
|
||||||
tag = tags[i];
|
tag = tags[i];
|
||||||
res = mifare_desfire_connect (tag);
|
res = mifare_desfire_connect (tag);
|
||||||
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_connect() failed"));
|
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_connect() failed"));
|
||||||
|
|
||||||
|
struct mifare_desfire_version_info version_info;
|
||||||
|
res = mifare_desfire_get_version (tag, &version_info);
|
||||||
|
cut_assert_equal_int (0, res, cut_message ("mifare_desfire_get_version"));
|
||||||
|
|
||||||
|
if (version_info.hardware.storage_size < 0x18) {
|
||||||
|
cut_omit ("DESFire tests require at least a 4K card");
|
||||||
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue