From 253d49eef87cb8b43c4173ca063f9a056eebfcf9 Mon Sep 17 00:00:00 2001 From: Romain Tartiere Date: Sat, 19 Dec 2009 22:59:38 +0000 Subject: [PATCH] Add forgotten regression test for mifare_classic_trailer_block(). --- test/test_create_trailer_block.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 test/test_create_trailer_block.c diff --git a/test/test_create_trailer_block.c b/test/test_create_trailer_block.c new file mode 100644 index 0000000..d1957bc --- /dev/null +++ b/test/test_create_trailer_block.c @@ -0,0 +1,19 @@ +#include "test.h" + +#include "mifare_classic.h" + +DEFINE_TEST(create_trailer_block) +{ + do { + MifareClassicBlock data; + + MifareClassicKey key_a = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; + MifareClassicKey key_b = { 0xde, 0xad, 0xbe, 0xef, 0xff, 0xff }; + + mifare_classic_trailer_block (&data, key_a, 0, 0, 0, 4, 0x42, key_b); + + assertEqualMem (data, "\xff\xff\xff\xff\xff\xff\xff\x07\x80\x42\xde\xad\xbe\xef\xff\xff", sizeof (data)); + + } while (0); +} +