AusweisApp2/test/qt/card/asn1/test_efCardAccess.cpp

42 lines
835 B
C++
Raw Normal View History

2017-07-03 09:30:10 +02:00
/*!
2018-03-28 15:10:51 +02:00
* \copyright Copyright (c) 2014-2018 Governikus GmbH & Co. KG, Germany
2017-07-03 09:30:10 +02:00
*/
#include "asn1/ChipAuthenticationInfo.h"
2019-01-03 15:06:22 +01:00
#include "asn1/PaceInfo.h"
2017-07-03 09:30:10 +02:00
#include "asn1/SecurityInfos.h"
2017-09-15 10:23:30 +02:00
#include "TestFileHelper.h"
2017-07-03 09:30:10 +02:00
2017-07-03 09:33:28 +02:00
#include <QtTest>
2017-07-03 09:30:10 +02:00
using namespace governikus;
class test_efCardAccess
: public QObject
{
Q_OBJECT
private Q_SLOTS:
void initTestCase()
{
}
void parseEFCardAccess()
{
QByteArray bytes = QByteArray::fromHex(TestFileHelper::readFile(":/card/efCardAccess.hex"));
auto efCardAccess = EFCardAccess::decode(bytes);
QVERIFY(efCardAccess != nullptr);
2017-07-03 09:33:28 +02:00
QCOMPARE(efCardAccess->getChipAuthenticationInfos().size(), 1);
2019-01-03 15:06:22 +01:00
QCOMPARE(efCardAccess->getPaceInfos().size(), 1);
2017-07-03 09:30:10 +02:00
QCOMPARE(efCardAccess->getContentBytes(), bytes);
}
};
QTEST_GUILESS_MAIN(test_efCardAccess)
#include "test_efCardAccess.moc"