Add regression test suite.
This commit is contained in:
parent
1f40cc97c7
commit
b97012ac05
12 changed files with 1952 additions and 0 deletions
29
test/test_authenticate.c
Normal file
29
test/test_authenticate.c
Normal file
|
|
@ -0,0 +1,29 @@
|
|||
#include "test.h"
|
||||
|
||||
#include <err.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <nfc/nfc.h>
|
||||
|
||||
#include "mifare_classic.h"
|
||||
|
||||
DEFINE_TEST(authenticate)
|
||||
{
|
||||
int res;
|
||||
MifareClassicTag tag;
|
||||
|
||||
do {
|
||||
res = mifare_classic_test_setup (&tag);
|
||||
assertEqualInt (res, 0);
|
||||
|
||||
MifareClassicKey k = { 0xA0, 0xA1, 0xA2, 0xA3, 0xA4, 0xA5 };
|
||||
res = mifare_classic_authenticate (tag, 0x00, k, MFC_KEY_A);
|
||||
assertEqualInt (res, 0);
|
||||
|
||||
} while (0);
|
||||
|
||||
mifare_classic_test_teardown (tag);
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue