1 /* -*- mode: c++; c-basic-offset:4 -*- 2 selftest/implementation_p.h 3 4 This file is part of Kleopatra, the KDE keymanager 5 SPDX-FileCopyrightText: 2008 Klarälvdalens Datakonsult AB 6 7 SPDX-License-Identifier: GPL-2.0-or-later 8 */ 9 10 #pragma once 11 12 #include <selftest/selftest.h> 13 14 #include <gpgme++/global.h> 15 16 #include <QString> 17 18 namespace Kleo 19 { 20 namespace _detail 21 { 22 23 class SelfTestImplementation : public SelfTest 24 { 25 public: 26 explicit SelfTestImplementation(const QString &name); 27 ~SelfTestImplementation() override; 28 name()29 QString name() const override 30 { 31 return m_name; 32 } shortError()33 QString shortError() const override 34 { 35 return m_error; 36 } longError()37 QString longError() const override 38 { 39 return m_explanation; 40 } proposedFix()41 QString proposedFix() const override 42 { 43 return m_proposedFix; 44 } 45 skipped()46 bool skipped() const override 47 { 48 return m_skipped; 49 } passed()50 bool passed() const override 51 { 52 return m_passed; 53 } 54 55 protected: 56 bool ensureEngineVersion(GpgME::Engine, int major, int minor, int patch); 57 58 protected: 59 const QString m_name; 60 QString m_error; 61 QString m_explanation; 62 QString m_proposedFix; 63 bool m_skipped : 1; 64 bool m_passed : 1; 65 }; 66 67 } 68 } 69 70