diff options
author | Andre Heinecke <[email protected]> | 2018-05-29 07:16:22 +0000 |
---|---|---|
committer | Andre Heinecke <[email protected]> | 2018-05-29 07:19:50 +0000 |
commit | 618aa7f08db41911f25632d9fba23bca80908ebe (patch) | |
tree | db72649583416f11422685462be70b0f2639b69d /lang/qt/tests/t-various.cpp | |
parent | json: Fix compiler warning. (diff) | |
download | gpgme-618aa7f08db41911f25632d9fba23bca80908ebe.tar.gz gpgme-618aa7f08db41911f25632d9fba23bca80908ebe.zip |
cpp: Add gpgme_data_rewind to cpp API
* lang/cpp/src/data.h, lang/cpp/src/data.cpp (Data::rewind): New.
* lang/qt/tests/t-various.cpp (testDataRewind): Test it.
--
The advantage of this convieniance function in GPGME is that
it avoids the messiness that are declarations with off_t.
GnuPG-Bug-Id: T3996
Diffstat (limited to '')
-rw-r--r-- | lang/qt/tests/t-various.cpp | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/lang/qt/tests/t-various.cpp b/lang/qt/tests/t-various.cpp index 75456281..76e68063 100644 --- a/lang/qt/tests/t-various.cpp +++ b/lang/qt/tests/t-various.cpp @@ -98,6 +98,25 @@ private Q_SLOTS: QVERIFY(key.primaryFingerprint() == QStringLiteral("7A0904B6950DA998020A1AD4BE41C0C3A5FF1F3C")); } + void testDataRewind() + { + if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.14") { + return; + } + QGpgME::QByteArrayDataProvider dp(aKey); + Data data(&dp); + char buf[20]; + data.read(buf, 20); + + auto keys = data.toKeys(); + QVERIFY(keys.size() == 0); + + data.rewind(); + + keys = data.toKeys(); + QVERIFY(keys.size() == 1); + } + void testQuickUid() { if (GpgME::engineInfo(GpgME::GpgEngine).engineVersion() < "2.1.13") { |