fix bad cast done in last revision.

This commit is contained in:
Audrey Diacre 2012-01-05 17:03:38 +00:00
parent 642f9a38f7
commit 601105ef79
6 changed files with 26 additions and 16 deletions

View file

@ -88,9 +88,9 @@ target_thread (void *arg)
cut_assert_operator_int (res, >, 0, cut_message ("Can't initialize NFC device as target: %s", nfc_strerror (device)));
if (res < 0) { thread_res = -1; return (void*) thread_res; }
szRx = (size_t) nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (szRx, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
res = nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (res, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
szRx = (size_t) res;
const uint8_t abtAttRx[] = "Hello DEP target!";
cut_assert_equal_memory (abtAttRx, sizeof (abtAttRx), abtRx, szRx, cut_message ("Invalid received data"));
if (res <= 0) { thread_res = -1; return (void*) thread_res; }

View file

@ -87,9 +87,10 @@ target_thread (void *arg)
if (res < 0) { thread_res = -1; return (void*) thread_res; }
// First pass
szRx = (size_t) nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int ((int) szRx, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
res = nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (res, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
szRx = (size_t) res;
const uint8_t abtAttRx[] = "Hello DEP target!";
cut_assert_equal_memory (abtAttRx, sizeof (abtAttRx), abtRx, szRx, cut_message ("Invalid received data"));
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
@ -100,8 +101,9 @@ target_thread (void *arg)
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
// Second pass
szRx = (size_t) nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int ((int) szRx, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
res = nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (res, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
szRx = (size_t) res;
cut_assert_equal_memory (abtAttRx, sizeof (abtAttRx), abtRx, szRx, cut_message ("Invalid received data"));
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
@ -111,8 +113,9 @@ target_thread (void *arg)
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
// Third pass
szRx = (size_t) nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int ((int) szRx, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
res = nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (res, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
szRx = (size_t) res;
cut_assert_equal_memory (abtAttRx, sizeof (abtAttRx), abtRx, szRx, cut_message ("Invalid received data"));
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
@ -122,8 +125,9 @@ target_thread (void *arg)
if (res <= 0) { thread_res = -1; return (void*) thread_res; }
// Fourth pass
szRx = (size_t) nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int ((int)szRx, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
res = nfc_target_receive_bytes (device, abtRx, 500);
cut_assert_operator_int (res, >, 0, cut_message ("Can't receive bytes from initiator: %s", nfc_strerror (device)));
szRx = (size_t) res;
cut_assert_equal_memory (abtAttRx, sizeof (abtAttRx), abtRx, szRx, cut_message ("Invalid received data"));
if (res <= 0) { thread_res = -1; return (void*) thread_res; }