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

0001 /* This file is part of the KDE project
0002    Copyright 2007 Ariya Hidayat <ariya@kde.org>
0003    Copyright 2007 Sascha Pfau <MrPeacock@gmail.com>
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_MATH_FUNCTIONS
0022 #define CALLIGRA_SHEETS_TEST_MATH_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 TestMathFunctions: public QObject
0035 {
0036     Q_OBJECT
0037 
0038 private Q_SLOTS:
0039 
0040     void initTestCase();
0041     void cleanupTestCase();
0042 
0043     void testABS();
0044     void testACOS();
0045     void testACOSH();
0046     void testACOT();
0047     void testACOTH();
0048     void testASIN();
0049     void testASINH();
0050     void testATAN();
0051     void testATAN2();
0052     void testATANH();
0053     void testBESSELI();
0054     void testBESSELJ();
0055     void testBESSELK();
0056     void testBESSELY();
0057     void testCOMBIN();
0058     void testCOMBINA(); // to be implemented
0059     void testCONVERT();
0060     void testCEIL();
0061     void testCEILING();
0062     void testCOT();
0063     void testCOTH();
0064     void testDEGREES();
0065     void testDELTA();
0066 //   void testERF();  -> TestEngineering
0067 //   void testERFC(); -> TestEngineering
0068     void testEVEN();
0069     void testEXP();
0070     void testFACT();
0071     void testFACTDOUBLE();
0072     void testFIB();
0073     void testFLOOR();
0074     void testGAMMA();
0075     void testGAMMALN();
0076     void testGCD();
0077     void testGESTEP();
0078     void testINT();
0079     void testLCM();
0080     void testLN();
0081     void testLOG();
0082     void testLOG10();
0083     void testMDETERM();
0084     void testMINVERSE();
0085     void testMMULT();
0086     void testMOD();
0087     void testMROUND();
0088     void testMULTINOMIAL();
0089     void testMUNIT();
0090     void testODD();
0091 //   void testPI(); -> TestEngineering
0092     void testPOWER();
0093     void testPRODUCT();
0094     void testQUOTIENT();
0095     void testRADIANS();
0096     void testRAND();
0097     void testRANDBETWEEN();
0098     void testROUND();
0099     void testROUNDDOWN();
0100     void testROUNDUP();
0101     void testSERIESSUM();
0102     void testSIGN();
0103     void testSQRT();
0104     void testSQRTPI();
0105     void testSUBTOTAL();
0106     void testSUMA();
0107     void testSUMIF();
0108     void testSUMIF_STRING();
0109     void testSUMIF_WILDCARDS();
0110     void testSUMIF_REGULAREXPRESSIONS();
0111     void testSUMSQ();
0112     void testTRUNC();
0113 
0114 private:
0115     Value TestDouble(const QString& formula, const Value& v2, int accuracy);
0116     Value evaluate(const QString&);
0117 
0118     Map* m_map;
0119 };
0120 
0121 } // namespace Sheets
0122 } // namespace Calligra
0123 
0124 #endif // CALLIGRA_SHEETS_TEST_MATH_FUNCTIONS