File indexing completed on 2025-01-05 04:55:53

0001 /*
0002     utils/test.cpp
0003 
0004     This file is part of libkleopatra, the KDE keymanagement library
0005     SPDX-FileCopyrightText: 2021 g10 Code GmbH
0006     SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
0007 
0008     SPDX-License-Identifier: GPL-2.0-or-later
0009 */
0010 
0011 #include <config-libkleo.h>
0012 
0013 #include "test.h"
0014 
0015 #include "cryptoconfig_p.h"
0016 
0017 #include <QString>
0018 
0019 using namespace Kleo::Tests;
0020 
0021 FakeCryptoConfigIntValue::FakeCryptoConfigIntValue(const char *componentName, const char *entryName, int fakeValue)
0022     : mComponentName(componentName)
0023     , mEntryName(entryName)
0024 {
0025     Kleo::Private::setFakeCryptoConfigIntValue(mComponentName, mEntryName, fakeValue);
0026 }
0027 
0028 FakeCryptoConfigIntValue::~FakeCryptoConfigIntValue()
0029 {
0030     Kleo::Private::clearFakeCryptoConfigIntValue(mComponentName, mEntryName);
0031 }
0032 
0033 FakeCryptoConfigStringValue::FakeCryptoConfigStringValue(const char *componentName, const char *entryName, const QString &fakeValue)
0034     : mComponentName(componentName)
0035     , mEntryName(entryName)
0036 {
0037     Kleo::Private::setFakeCryptoConfigStringValue(mComponentName, mEntryName, fakeValue);
0038 }
0039 
0040 FakeCryptoConfigStringValue::~FakeCryptoConfigStringValue()
0041 {
0042     Kleo::Private::clearFakeCryptoConfigStringValue(mComponentName, mEntryName);
0043 }