Add a unit test for mifare_classic_get_uid().

This commit is contained in:
Romain Tartiere 2010-02-22 17:30:50 +00:00
parent e0d2405a30
commit 0f8ec71198

View file

@ -324,3 +324,16 @@ test_mifare_classic_value_block_restore (void)
cut_assert_equal_int (0, res, cut_message ("mifare_classic_read() failed")); cut_assert_equal_int (0, res, cut_message ("mifare_classic_read() failed"));
cut_assert_equal_memory (sample, sizeof (sample), data, sizeof (data), cut_message ("Wrong value block contents")); cut_assert_equal_memory (sample, sizeof (sample), data, sizeof (data), cut_message ("Wrong value block contents"));
} }
void
test_mifare_classic_get_uid (void)
{
char *uid;
uid = mifare_classic_get_uid (tag);
cut_assert_not_null (uid, cut_message ("mifare_classic_get_uid() failed"));
cut_assert_equal_int (8, strlen (uid), cut_message ("Wrong UID length"));
free (uid);
}