File indexing completed on 2024-05-12 16:35:59

0001 /* This file is part of the KDE project
0002    Copyright 2007 Stefan Nikolaus <stefan.nikolaus@kdemail.net>
0003    Copyright 2006 Ariya Hidayat <ariya@kde.org>
0004 
0005    This library is free software; you can redistribute it and/or
0006    modify it under the terms of the GNU Library General Public
0007    License as published by the Free Software Foundation; only
0008    version 2 of the License.
0009 
0010    This library is distributed in the hope that it will be useful,
0011    but WITHOUT ANY WARRANTY; without even the implied warranty of
0012    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
0013    Library General Public License for more details.
0014 
0015    You should have received a copy of the GNU Library General Public License
0016    along with this library; see the file COPYING.LIB.  If not, write to
0017    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
0018    Boston, MA 02110-1301, USA.
0019 */
0020 
0021 #ifndef CALLIGRA_SHEETS_TEST_STATISTICAL_FUNCTIONS
0022 #define CALLIGRA_SHEETS_TEST_STATISTICAL_FUNCTIONS
0023 
0024 #include <QObject>
0025 
0026 #include <Value.h>
0027 
0028 namespace Calligra
0029 {
0030 namespace Sheets
0031 {
0032 class Map;
0033 
0034 class TestStatisticalFunctions : public QObject
0035 {
0036     Q_OBJECT
0037 
0038 private Q_SLOTS:
0039     void initTestCase();
0040 
0041 //     void testARRANG(); // alias PERMUT
0042     void testAVEDEV();
0043     void testAVERAGE();
0044     void testAVERAGEA();
0045     void testBETADIST();
0046     void testBETAINV();
0047 //     void testBINO(); // Calligra Sheets version of BINOMDIST with 3 Parameters
0048     void testBINOMDIST();
0049     void testCHIDIST();
0050 //     void testCOMBIN();  // in -> TestMathFunctions
0051 //     void testCOMBINA(); // in -> TestMathFunctions
0052     void testCONFIDENCE();
0053     void testCORREL();
0054     void testCOVAR();
0055     void testDEVSQ();
0056 //     void testDEVSQA(); // no ODF-test available
0057     void testEXPONDIST();
0058     void testFDIST();
0059     void testFINV();
0060     void testFISHER();
0061     void testFISHERINV();
0062     void testFREQUENCY();
0063     void testFTEST();
0064     void testGAMMADIST();
0065     void testGAMMAINV();
0066 //     void testGAMMALN(); in -> TestMathFunctions
0067     void testGAUSS();
0068     void testGROWTH(); // to be implemented
0069     void testGEOMEAN();
0070     void testHARMEAN();
0071     void testHYPGEOMDIST();
0072     void testINTERCEPT();
0073 //     void testINVBINO();
0074     void testKURT();
0075 //     void testKURTP(); // ???
0076     void testLARGE();
0077 
0078 
0079     void testLEGACYCHIDIST();
0080     void testLEGACYCHIINV();
0081     void testLEGACYFDIST();
0082     void testLEGACYFINV();
0083 //     void testLEGACYNORMSDIST(); // same as NORMDIST required for OpenFormula compliance
0084 
0085 
0086 //     void testLINEST(); // ???
0087 //     void testLOGEST(); // ???
0088     void testLOGINV();
0089     void testLOGNORMDIST();
0090     void testMAX();
0091     void testMAXA();
0092     void testMEDIAN();
0093     void testMIN();
0094     void testMINA();
0095     void testMODE();
0096     void testNEGBINOMDIST();
0097     void testNORMDIST();
0098     void testNORMINV();
0099 //     void testNORMSDIST();
0100 //     void testNORMSINV();
0101 
0102     void testPEARSON();
0103     void testPERCENTILE();
0104     void testPERMUT();
0105     void testPERMUTATIONA();
0106     void testPHI();
0107     void testPOISSON();
0108 //     void testPROB();     // ???
0109     void testQUARTILE();
0110     void testRANK();
0111     void testRSQ();
0112     void testSKEW();
0113     void testSKEWP();
0114     void testSLOPE();
0115     void testSMALL();
0116     void testSTANDARDIZE();
0117     void testSTDEV();
0118     void testSTDEVA();
0119     void testSTDEVP();
0120     void testSTDEVPA();
0121     void testSTEYX();
0122 //     void testSUMXMY2(); // deprecated
0123     void testSUMPRODUCT();
0124 //     void testSUMX2PY2();
0125 //     void testSUMX2MY2();
0126     void testTDIST();
0127     void testTINV();
0128     void testTREND();
0129     void testTRIMMEAN();
0130     void testTTEST();
0131     void testVAR();
0132     void testVARA();
0133     void testVARIANCE();
0134     void testVARP();
0135     void testVARPA();
0136     void testWEIBULL();
0137     void testZTEST();
0138 
0139     void cleanupTestCase();
0140 
0141 private:
0142     bool  TestArray(const QString& formula, const QString& Array, int accuracy, bool checkSize);
0143     Value evaluate(const QString&);
0144     Value TestDouble(const QString& formula, const Value& v2, int accuracy);
0145 
0146     Map* m_map;
0147 };
0148 
0149 } // namespace Sheets
0150 } // namespace Calligra
0151 
0152 #endif // CALLIGRA_SHEETS_TEST_STATISTICAL_FUNCTIONS