nfc_list_devices() function returns now the number of devices found.
This commit is contained in:
parent
00818e048c
commit
1ec504e163
12 changed files with 23 additions and 34 deletions
|
|
@ -15,17 +15,16 @@ test_access_storm (void)
|
|||
{
|
||||
int n = NTESTS;
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
size_t device_count, ref_device_count;
|
||||
int res = 0;
|
||||
|
||||
nfc_list_devices (connstrings, MAX_DEVICE_COUNT, &ref_device_count);
|
||||
size_t ref_device_count = nfc_list_devices (connstrings, MAX_DEVICE_COUNT);
|
||||
if (!ref_device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
|
||||
while (n) {
|
||||
size_t i;
|
||||
|
||||
nfc_list_devices (connstrings, MAX_DEVICE_COUNT, &device_count);
|
||||
size_t device_count = nfc_list_devices (connstrings, MAX_DEVICE_COUNT);
|
||||
cut_assert_equal_int (ref_device_count, device_count, cut_message ("device count"));
|
||||
|
||||
for (i = 0; i < device_count; i++) {
|
||||
|
|
|
|||
|
|
@ -27,9 +27,7 @@ abort_test_by_keypress (int sig)
|
|||
void
|
||||
cut_setup (void)
|
||||
{
|
||||
size_t n;
|
||||
|
||||
nfc_list_devices (connstrings, 2, &n);
|
||||
size_t n = nfc_list_devices (connstrings, 2);
|
||||
if (n < 2) {
|
||||
cut_omit ("At least two NFC devices must be plugged-in to run this test");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,9 +26,7 @@ abort_test_by_keypress (int sig)
|
|||
void
|
||||
cut_setup (void)
|
||||
{
|
||||
size_t n;
|
||||
|
||||
nfc_list_devices (connstrings, 2, &n);
|
||||
size_t n = nfc_list_devices (connstrings, 2);
|
||||
if (n < 2) {
|
||||
cut_omit ("At least two NFC devices must be plugged-in to run this test");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,9 @@ void
|
|||
test_register_endianness (void)
|
||||
{
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
size_t device_count;
|
||||
int res = 0;
|
||||
|
||||
nfc_list_devices (connstrings, MAX_DEVICE_COUNT, &device_count);
|
||||
size_t device_count = nfc_list_devices (connstrings, MAX_DEVICE_COUNT);
|
||||
if (!device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
|
||||
|
|
|
|||
|
|
@ -11,10 +11,9 @@ void
|
|||
test_register_endianness (void)
|
||||
{
|
||||
nfc_connstring connstrings[MAX_DEVICE_COUNT];
|
||||
size_t device_count;
|
||||
int res = 0;
|
||||
|
||||
nfc_list_devices (connstrings, MAX_DEVICE_COUNT, &device_count);
|
||||
size_t device_count = nfc_list_devices (connstrings, MAX_DEVICE_COUNT);
|
||||
if (!device_count)
|
||||
cut_omit ("No NFC device found");
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue