Skip to content

Commit

Permalink
Added tiny additions to unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
alex-w committed Jan 31, 2024
1 parent d596a2a commit 2eb5443
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/tests/testComparisons.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,10 @@ void TestComparisons::testAppName()
{
QVERIFY2(StelUtils::getApplicationName().contains("Stellarium", Qt::CaseInsensitive), "Oops... No application name exist!");
}

void TestComparisons::testAppVersions()
{
QVERIFY2(!StelUtils::getApplicationVersion().isEmpty(), "Oops... version number cannot be empty!");
QVERIFY2(!StelUtils::getApplicationPublicVersion().isEmpty(), "Oops... public version number cannot be empty!");
QVERIFY2(!StelUtils::getApplicationSeries().isEmpty(), "Oops... series number cannot be empty!");
}
1 change: 1 addition & 0 deletions src/tests/testComparisons.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ private slots:
void testOSReports();
void testUAReports();
void testAppName();
void testAppVersions();
};

#endif // _TESTCOMPARISONS_HPP
Expand Down
6 changes: 6 additions & 0 deletions src/tests/testConversions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,9 @@ void TestConversions::testDMSStrToRad()
data << "-270d0'0\"" << -3*M_PI_2;
data << "-0d30'0\"" << -M_PI/360;
data << "-0d45'0\"" << -M_PI/240;
// wrong format!
data << "+0d0`0\"" << 0.;
data << "+1d10`10\"" << 0.;

while (data.count() >= 2)
{
Expand Down Expand Up @@ -491,12 +494,15 @@ void TestConversions::testDDToDMS()
data << 10. << 10 << 0 << 0.;
data << -13.5 << -13 << 30 << 0.;
data << 30.263888889 << 30 << 15 << 50.;
data << 30.26666 << 30 << 16 << 0.;
data << -90.1 << -90 << 6 << 0.;
data << 128.9999 << 128 << 59 << 59.64;
data << 360.6 << 360 << 36 << 0.;
data << -180.786 << -180 << 47 << 9.6;
data << -0.01 << -0 << 0 << 36.;
data << -0.039 << -0 << 2 << 20.4;
// 30.999989 = 30 degrees 59 arcminutes 59.96 arcseconds, but we use rounding for arcseconds, so, = 31 degrees 0 arcminutes 0 arcseconds
data << 30.999989 << 31 << 0. << 0.;

while (data.count()>=4)
{
Expand Down

0 comments on commit 2eb5443

Please sign in to comment.