[Pkg-gnupg-commit] [gpgme] 95/132: qt: Add test for DN parser

Daniel Kahn Gillmor dkg at fifthhorseman.net
Wed Apr 26 01:01:33 UTC 2017


This is an automated email from the git hooks/post-receive script.

dkg pushed a commit to branch experimental
in repository gpgme.

commit 43aa3eed15dcc4f848915ceabeff35c29c1c57e4
Author: Andre Heinecke <aheinecke at intevation.de>
Date:   Mon Mar 13 11:16:41 2017 +0100

    qt: Add test for DN parser
    
    * qt/tests/t-various.cpp (testDN): New.
    
    --
    A simple test for the DN parser that would have caught
    the new / free mismatch fixed in 9d5048d4.
---
 lang/qt/tests/t-various.cpp | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp
index b4ba9f2..2b51fe6 100644
--- a/lang/qt/tests/t-various.cpp
+++ b/lang/qt/tests/t-various.cpp
@@ -42,6 +42,7 @@
 #include "keylistresult.h"
 #include "context.h"
 #include "engineinfo.h"
+#include "dn.h"
 
 #include "t-support.h"
 
@@ -56,6 +57,15 @@ Q_SIGNALS:
     void asyncDone();
 
 private Q_SLOTS:
+    void testDN()
+    {
+        DN dn(QStringLiteral("CN=Before\\0DAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM"));
+        QVERIFY(dn.dn() == QStringLiteral("CN=Before\rAfter,OU=Test,DC=North America,DC=Fabrikam,DC=COM"));
+        QStringList attrOrder;
+        attrOrder << QStringLiteral("DC") << QStringLiteral("OU") << QStringLiteral("CN");
+        dn.setAttributeOrder(attrOrder);
+        QVERIFY(dn.prettyDN() == QStringLiteral("DC=North America,DC=Fabrikam,DC=COM,OU=Test,CN=Before\rAfter"));
+    }
 
     void testQuickUid()
     {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-gnupg/gpgme.git



More information about the Pkg-gnupg-commit mailing list