mirror of
https://github.com/nfc-tools/libnfc.git
synced 2026-03-01 05:06:38 +00:00
nfc_list_devices() function returns now the number of devices found.
This commit is contained in:
@@ -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");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user