File indexing completed on 2024-03-24 15:18:43

0001 /*
0002     SPDX-FileCopyrightText: 2016 Akarsh Simha <akarsh.simha@kdemail.net>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef TEST_SKYPOINT_H
0008 #define TEST_SKYPOINT_H
0009 
0010 #include <QTest>
0011 #include <QDebug>
0012 
0013 #define UNIT_TEST
0014 
0015 #include "skyobjects/skypoint.h"
0016 #include <libnova/ln_types.h>
0017 
0018 /**
0019  * @class TestSkyPoint
0020  * @short Tests for some SkyPoint operations
0021  * @author Akarsh Simha <akarsh.simha@kdemail.net>
0022  */
0023 
0024 class TestSkyPoint : public QObject
0025 {
0026         Q_OBJECT
0027 
0028     public:
0029         TestSkyPoint();
0030         ~TestSkyPoint() override;
0031 
0032     private:
0033         void compare(QString msg, double ra1, double dec1, double ra2, double dec2, double err = 0.0001);
0034         void compare(QString msg, SkyPoint * sp);
0035         void compare(QString msg, SkyPoint * sp, SkyPoint * sp1);
0036         void compare(QString msg, SkyPoint * sp, ln_equ_posn * lnp);
0037         void ln_get_equ_nut(ln_equ_posn * posn, double jd, bool reverse = false);
0038 
0039     private slots:
0040         void testPrecession();
0041 
0042         void compareNovas();
0043 
0044         void testPrecess_data();
0045         void testPrecess();
0046 
0047         void testPrecessFromAnyEpoch_data();
0048         void testPrecessFromAnyEpoch();
0049 
0050         void testNutate_data();
0051         void testNutate();
0052 
0053         void testAberrate_data();
0054         void testAberrate();
0055 
0056         void testApparentCatalogue_data();
0057         void testApparentCatalogue();
0058         void testApparentCatalogueInversion_data();
0059         void testApparentCatalogueInversion();
0060 
0061         void compareSkyPointLibNova_data();
0062         void compareSkyPointLibNova();
0063 
0064         void testUpdateCoords();
0065 
0066         void testDeltaAngle();
0067 
0068     private:
0069         bool useRelativistic {false};
0070 };
0071 
0072 
0073 #endif