DF cutter tests: detect if DF is too small for tests

This commit is contained in:
Philippe Teuwen 2013-01-29 22:47:50 +01:00
parent bfa8bc69fc
commit 42e731b492
2 changed files with 13 additions and 0 deletions

View file

@ -61,6 +61,10 @@ cut_setup (void)
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 EV1 tests require at least a 4K card");
}
if ((version_info.hardware.version_major >= 1) &&
(version_info.software.version_major >= 1)) {
return;

View file

@ -56,6 +56,15 @@ cut_setup (void)
tag = tags[i];
res = mifare_desfire_connect (tag);
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;
}
}