From 0f8ec71198ea13a637609057a885f7a280d1c667 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Mon, 22 Feb 2010 17:30:50 +0000 Subject: [PATCH] Add a unit test for mifare_classic_get_uid(). --- test/test_mifare_classic.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/test/test_mifare_classic.c b/test/test_mifare_classic.c index 8e67db9..534ac25 100644 --- a/test/test_mifare_classic.c +++ b/test/test_mifare_classic.c @@ -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_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); +}