File indexing completed on 2024-04-28 03:51:01
0001 /* 0002 SPDX-FileCopyrightText: 2014 Andreas Xavier <andxav at zoho dot com> 0003 SPDX-License-Identifier: GPL-2.0-or-later 0004 */ 0005 0006 /** 0007 @file 0008 This file collects some utility classes that are used in multiple unit tests 0009 **/ 0010 0011 #ifndef PARLEYUNITTESTUTILITIES_H 0012 #define PARLEYUNITTESTUTILITIES_H 0013 0014 #include "parleydocument.h" 0015 0016 #include <QTemporaryFile> 0017 0018 #include <QUrl> 0019 0020 #include <QDebug> 0021 #include <QTest> 0022 0023 namespace UnitTestUtilities 0024 { 0025 /** Class to manage creation/destruction of a kvtml temp doc*/ 0026 class TemporaryVocDoc : public QTemporaryFile 0027 { 0028 public: 0029 /** Create the file, fix the suffix and instantiate it.*/ 0030 TemporaryVocDoc(); 0031 0032 /** Destructor*/ 0033 ~TemporaryVocDoc() override; 0034 }; 0035 0036 /** Creates a minimal doc that will save and load error free.*/ 0037 class MinimalTempVocDoc : public TemporaryVocDoc 0038 { 0039 public: 0040 /** The minimal doc has generator, author, lang and local */ 0041 MinimalTempVocDoc(); 0042 0043 /** Destructor*/ 0044 ~MinimalTempVocDoc() override; 0045 }; 0046 0047 } 0048 #endif // PARLEYUNITTESTUTILITIES_H