File indexing completed on 2024-11-10 09:32:04
0001 /* 0002 File : AsciiFilterTest.h 0003 Project : LabPlot 0004 Description : Tests for the ascii filter 0005 -------------------------------------------------------------------- 0006 SPDX-FileCopyrightText: 2017-2023 Alexander Semke <alexander.semke@web.de> 0007 SPDX-FileCopyrightText: 2022 Stefan Gerlach <stefan.gerlach@uni.kn> 0008 0009 SPDX-License-Identifier: GPL-2.0-or-later 0010 */ 0011 #ifndef ASCIIFILTERTEST_H 0012 #define ASCIIFILTERTEST_H 0013 0014 #include "../../CommonTest.h" 0015 #include <QtTest> 0016 0017 class AsciiFilterTest : public CommonTest { 0018 Q_OBJECT 0019 0020 private Q_SLOTS: 0021 void initTestCase(); 0022 0023 // empty and sparse files 0024 void testEmptyFileAppend(); 0025 void testEmptyFilePrepend(); 0026 void testEmptyFileReplace(); 0027 0028 void testEmptyLines01(); 0029 0030 void testSparseFile01(); 0031 void testSparseFile02(); 0032 void testSparseFile03(); 0033 0034 // header handling 0035 void testHeader01(); 0036 void testHeader02(); 0037 void testHeader03(); 0038 void testHeader04(); 0039 void testHeader05(); 0040 void testHeader06(); 0041 void testHeader07(); 0042 void testHeader07a(); 0043 void testHeader08(); 0044 void testHeader09(); 0045 void testHeader10(); 0046 void testHeader11(); 0047 void testHeader11a(); 0048 0049 // read ranges 0050 void testColumnRange00(); 0051 void testColumnRange01(); 0052 void testColumnRange02(); 0053 void testColumnRange03(); 0054 void testColumnRange04(); 0055 void testColumnRange05(); 0056 void testColumnRange06(); 0057 0058 void testRowRange00(); 0059 void testRowRange01(); 0060 void testRowRange02(); 0061 0062 void testRowColumnRange00(); 0063 0064 // different separators 0065 0066 // qouted strings 0067 void testQuotedStrings00(); 0068 void testQuotedStrings01(); 0069 void testQuotedStrings02(); 0070 void testQuotedStrings03(); 0071 void testQuotedStrings04(); 0072 void testQuotedStrings05(); 0073 0074 // different locales 0075 void testUtf8Cyrillic(); 0076 0077 // handling of NANs 0078 0079 // automatically skip comments 0080 void testComments00(); 0081 void testComments01(); 0082 void testComments02(); 0083 0084 // datetime data 0085 void testDateTime00(); 0086 void testDateTime01(); 0087 void testDateTimeHex(); 0088 0089 // matrix import 0090 void testMatrixHeader(); 0091 0092 // check updates in the dependent objects after the data was modified by the import 0093 void spreadsheetFormulaUpdateAfterImport(); 0094 void spreadsheetFormulaUpdateAfterImportWithColumnRestore(); 0095 void plotUpdateAfterImport(); 0096 void plotUpdateAfterImportWithColumnRestore(); 0097 void plotUpdateAfterImportWithColumnRenaming(); 0098 void plotUpdateAfterImportWithColumnRemove(); 0099 0100 // benchmarks 0101 void benchDoubleImport_data(); 0102 // this is called multiple times (warm-up of BENCHMARK) 0103 // see https://stackoverflow.com/questions/36916962/qtest-executes-test-case-twic 0104 void benchDoubleImport(); 0105 void benchDoubleImport_cleanup(); // delete data 0106 0107 private: 0108 QString benchDataFileName; 0109 const size_t lines = 1e5; 0110 static const int paths = 5; 0111 }; 0112 #endif