annotate ui/tests/certlistparsertest.cpp @ 249:6a7eb102716d

Remove code duplication by unifying the certificatelist. You should now check for isInstallCert to determine wether this certificate should be installed or removed. Leaving the getInstallCertificates and getRemoveCertificates in place for compatibilty would have been easier to keep the tests stable.
author Andre Heinecke <aheinecke@intevation.de>
date Mon, 31 Mar 2014 08:06:17 +0000
parents c05e126b0b9e
children ee59ab0eb7ff
rev   line source
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
1 #include "certlistparsertest.h"
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
2 #include "certificatelist.h"
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
3 #include "certificate.h"
240
c05e126b0b9e Fix downloadertest and factor out generating file input.
Andre Heinecke <aheinecke@intevation.de>
parents: 204
diff changeset
4 #include "common.h"
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
5
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
6 #include <QDebug>
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
7
31
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
8 void CertListTest::testValidList()
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
9 {
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
10 const char *fname = "list-valid-signed.txt";
88
abc76b750ea8 Fix extended list test. Add Benchmarking again
Andre Heinecke <aheinecke@intevation.de>
parents: 87
diff changeset
11
abc76b750ea8 Fix extended list test. Add Benchmarking again
Andre Heinecke <aheinecke@intevation.de>
parents: 87
diff changeset
12 QDir dataDir = QDir(SOURCE_DIR"/data/");
abc76b750ea8 Fix extended list test. Add Benchmarking again
Andre Heinecke <aheinecke@intevation.de>
parents: 87
diff changeset
13 QString fileName = dataDir.absoluteFilePath(fname);
abc76b750ea8 Fix extended list test. Add Benchmarking again
Andre Heinecke <aheinecke@intevation.de>
parents: 87
diff changeset
14 QFile validList(fileName);
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
15 validList.open(QIODevice::ReadOnly);
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
16 QString validData = QString::fromLatin1(validList.readAll());
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
17 QStringList instLines;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
18 QStringList remoLines;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
19
31
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
20 CertificateList *certList = testWithFile(fname);
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
21 QCOMPARE(certList->getStatus(), Valid);
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
22 QVERIFY(certList->isValid());
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
23
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
24 QVERIFY(certList->rawData() == validData.toLatin1());
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
25
249
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
26 const QList<Certificate> cList = certList->getCertificates();
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
27
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
28 foreach (QString act, validData.split("\r\n")) {
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
29 if (act.startsWith("I:")) {
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
30 instLines << act;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
31 continue;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
32 }
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
33 if (act.startsWith("R:")) {
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
34 remoLines << act;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
35 continue;
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
36 }
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
37 }
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
38
249
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
39 int instCnt = 0,
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
40 remoCnt = 0;
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
41 foreach (const Certificate& cert, cList) {
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
42 QVERIFY(cert.isValid());
249
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
43 if (cert.isInstallCert()) {
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
44 QVERIFY(instLines.contains(cert.base64Line()));
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
45 instCnt++;
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
46 } else {
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
47 QVERIFY(remoLines.contains(cert.base64Line()));
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
48 remoCnt++;
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
49 }
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
50 }
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
51
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
52 /* Be variable if test data changes later */
249
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
53 QVERIFY(instCnt >= 1);
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
54 QVERIFY(remoCnt >= 1);
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
55 QVERIFY(instLines.size() == instCnt);
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
56 QVERIFY(remoLines.size() == remoCnt);
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
57
204
825b42da1855 Avoid printing an error when an empty certificate ist constructed
Andre Heinecke <andre.heinecke@intevation.de>
parents: 203
diff changeset
58 /* Check that a default certificate is invalid */
95
b0b1375dfd40 Add check for default ctor of Certificate. Fix return value of empty file
Andre Heinecke <aheinecke@intevation.de>
parents: 88
diff changeset
59 Certificate cert;
b0b1375dfd40 Add check for default ctor of Certificate. Fix return value of empty file
Andre Heinecke <aheinecke@intevation.de>
parents: 88
diff changeset
60 QVERIFY(!cert.isValid());
b0b1375dfd40 Add check for default ctor of Certificate. Fix return value of empty file
Andre Heinecke <aheinecke@intevation.de>
parents: 88
diff changeset
61
203
60c5df8e7980 Reinitialize certificatelist when readFile is called
Andre Heinecke <andre.heinecke@intevation.de>
parents: 202
diff changeset
62 certList->readList(fileName.toLocal8Bit().data());
60c5df8e7980 Reinitialize certificatelist when readFile is called
Andre Heinecke <andre.heinecke@intevation.de>
parents: 202
diff changeset
63
249
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
64 const QList<Certificate> cList2 = certList->getCertificates();
6a7eb102716d Remove code duplication by unifying the certificatelist.
Andre Heinecke <aheinecke@intevation.de>
parents: 240
diff changeset
65 QVERIFY(instLines.size() + remoLines.size() == cList2.size());
87
be13e5e0a98f Expand test to cover more functionality from certificate and certificatelist
Andre Heinecke <aheinecke@intevation.de>
parents: 50
diff changeset
66
31
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
67 delete certList;
37fc66967517 Implement signature verification wiht polarssl
Andre Heinecke <aheinecke@intevation.de>
parents: 26
diff changeset
68 }
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
69
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
70 void CertListTest::testInvalidSig()
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
71 {
42
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
72 const char *fnames[] = {"list-invalid-signed.txt",
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
73 "list-valid-other-signature.txt",
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
74 "list-valid-sha1-signature.txt",
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
75 NULL};
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
76 for (int i=0; fnames[i] != NULL; i++) {
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
77 CertificateList *certList = testWithFile(fnames[i]);
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
78 QCOMPARE (certList->getStatus(), InvalidSignature);
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
79 delete certList;
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
80 }
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
81 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
82
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
83 void verifyInvalidFile(const char *fName) {
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
84 CertificateList *certList = new CertificateList(fName);
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
85 QVERIFY (certList->getStatus() != Valid);
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
86 delete certList;
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
87 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
88
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
89 void CertListTest::testInvalidFileNames()
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
90 {
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
91 verifyInvalidFile("/dev/random");
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
92 verifyInvalidFile("/tmp/");
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
93 verifyInvalidFile(NULL);
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
94 verifyInvalidFile("ä");
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
95 verifyInvalidFile("💩 ");
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
96 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
97
42
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
98 void CertListTest::testEmptyFile()
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
99 {
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
100 const char *fname = "empty_file";
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
101 CertificateList *certList = testWithFile(fname);
95
b0b1375dfd40 Add check for default ctor of Certificate. Fix return value of empty file
Andre Heinecke <aheinecke@intevation.de>
parents: 88
diff changeset
102 QCOMPARE (certList->getStatus(), SeekFailed);
42
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
103 delete certList;
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
104 }
6e7ef7e95031 Some more tests and some more test data
Andre Heinecke <aheinecke@intevation.de>
parents: 31
diff changeset
105
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
106 void CertListTest::testGarbage()
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
107 {
202
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
108 const char *fname = "list-with-null.txt";
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
109 QString fname2 = getRandomDataFile(200);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
110 CertificateList *certList = testWithFile(fname);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
111 QCOMPARE (certList->getStatus(), InvalidFormat);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
112 delete certList;
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
113 certList = testWithFile(fname2.toLocal8Bit().constData());
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
114 QVERIFY(QFile::remove(fname2));
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
115 QCOMPARE (certList->getStatus(), InvalidFormat);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
116 delete certList;
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
117 }
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
118
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
119 void CertListTest::testTooLarge()
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
120 {
202
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
121 QString fname = getRandomDataFile(MAX_LINE_LENGTH * MAX_LINES + 1);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
122 CertificateList *certList = testWithFile(fname.toLocal8Bit().constData());
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
123 QVERIFY(QFile::remove(fname));
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
124 QCOMPARE(certList->getStatus(), TooLarge);
0861069fd6d0 Fix testing for handling garbage input and generate the data ad hoc.
Andre Heinecke <andre.heinecke@intevation.de>
parents: 95
diff changeset
125 QVERIFY(!certList->isValid());
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
126 delete certList;
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
127 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
128
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
129 void CertListTest::benchmarkValid()
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
130 {
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
131 const char *fname = "list-valid-signed.txt";
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
132
88
abc76b750ea8 Fix extended list test. Add Benchmarking again
Andre Heinecke <aheinecke@intevation.de>
parents: 87
diff changeset
133 QBENCHMARK{
7
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
134 CertificateList *certList = testWithFile(fname);
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
135 delete certList;
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
136 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
137 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
138
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
139 CertificateList* CertListTest::testWithFile(const char *filename)
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
140 {
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
141 QDir dataDir = QDir(SOURCE_DIR"/data/");
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
142 QString fileName = dataDir.absoluteFilePath(filename);
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
143 return new CertificateList(fileName.toLocal8Bit().data());
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
144 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
145
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
146 int main( int argc, char **argv )
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
147 {
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
148 CertListTest tc;
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
149 return QTest::qExec( &tc, argc, argv );
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
150 }
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
151
992c0ec57660 Add unit tests make CertificateList work.
Andre Heinecke <aheinecke@intevation.de>
parents:
diff changeset
152

http://wald.intevation.org/projects/trustbridge/