Mercurial > trustbridge
changeset 371:6b78a89c1e17
Fix NSS test in release build and add verify's to avoid segfault with invalid list.
author | Andre Heinecke <andre.heinecke@intevation.de> |
---|---|
date | Tue, 15 Apr 2014 11:04:34 +0200 |
parents | 8b9ba61add57 |
children | 6cc124e79066 |
files | ui/tests/data/testdata.qrc ui/tests/nsstest.cpp |
diffstat | 2 files changed, 8 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/ui/tests/data/testdata.qrc Tue Apr 15 10:49:41 2014 +0200 +++ b/ui/tests/data/testdata.qrc Tue Apr 15 11:04:34 2014 +0200 @@ -1,6 +1,7 @@ <!DOCTYPE RCC><RCC version="1.0"> <qresource> <file>list-valid-signed.txt</file> + <file>list-valid-signed-release.txt</file> <file>list-invalid-signed.txt</file> <file>list-valid-other-signature.txt</file> <file>nss/cert8.db</file>
--- a/ui/tests/nsstest.cpp Tue Apr 15 10:49:41 2014 +0200 +++ b/ui/tests/nsstest.cpp Tue Apr 15 11:04:34 2014 +0200 @@ -62,7 +62,11 @@ QTextCodec::setCodecForLocale(QTextCodec::codecForName("UTF-8")); /* use system default */ /* Set up a temporary list */ +#ifdef RELEASE_BUILD + QFile res(":/list-valid-signed-release.txt"); +#else QFile res(":/list-valid-signed.txt"); +#endif res.open(QIODevice::ReadOnly); validListFile.open(); validListFile.write(res.readAll()); @@ -73,6 +77,8 @@ validList = CertificateList(validListFile.fileName().toLocal8Bit().data()); + QVERIFY(validList.isValid()); + /* Create the profiles.ini `s set environment variables*/ // fakeHome.setAutoRemove(false); #ifndef WIN32 @@ -134,6 +140,7 @@ cert.base64Line().size() - 2); } QVERIFY((size_t) instList.size() == strv_length(to_install)); + QVERIFY(strv_length(to_install) != 0); QVERIFY(write_stores_nss(to_install, to_remove) == 0);