Skip to content

Commit

Permalink
Align with libnfc API change: test nfc_init() result
Browse files Browse the repository at this point in the history
  • Loading branch information
doegox committed Mar 30, 2013
1 parent 86c194e commit 061b41e
Show file tree
Hide file tree
Showing 17 changed files with 33 additions and 3 deletions.
2 changes: 2 additions & 0 deletions examples/mifare-classic-format.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-classic-read-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count= nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-classic-write-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-access.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-create-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-ev1-configure-ats.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-ev1-configure-default-key.c
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-ev1-configure-random-uid.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-format.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-read-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-desfire-write-ndef.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,8 @@ main(int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
2 changes: 2 additions & 0 deletions examples/mifare-ultralight-info.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ main (int argc, char *argv[])

nfc_context *context;
nfc_init (&context);
if (context == NULL)
errx(EXIT_FAILURE, "Unable to init libnfc (malloc)");

device_count = nfc_list_devices (context, devices, sizeof (devices) / sizeof (*devices));
if (device_count <= 0)
Expand Down
3 changes: 2 additions & 1 deletion test/mifare_classic_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ cut_setup (void)
nfc_connstring devices[8];
size_t device_count;

nfc_init(&context);
nfc_init (&context);
cut_assert_not_null (context, cut_message ("Unable to init libnfc (malloc)"));

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
1 change: 1 addition & 0 deletions test/mifare_desfire_ev1_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ cut_setup (void)
size_t device_count;

nfc_init (&context);
cut_assert_not_null (context, cut_message ("Unable to init libnfc (malloc)"));

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
3 changes: 2 additions & 1 deletion test/mifare_desfire_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ cut_setup (void)
nfc_connstring devices[8];
size_t device_count;

nfc_init(&context);
nfc_init (&context);
cut_assert_not_null (context, cut_message ("Unable to init libnfc (malloc)"));

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down
3 changes: 2 additions & 1 deletion test/mifare_ultralight_fixture.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ cut_setup (void)
nfc_connstring devices[8];
size_t device_count;

nfc_init(&context);
nfc_init (&context);
cut_assert_not_null (context, cut_message ("Unable to init libnfc (malloc)"));

device_count = nfc_list_devices (context, devices, 8);
if (device_count <= 0)
Expand Down

0 comments on commit 061b41e

Please sign in to comment.