mirror of
				https://github.com/subsurface/subsurface.git
				synced 2025-02-19 22:16:15 +00:00 
			
		
		
		
	Whitespace cleanup tests
Again, entirely script based. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
		
							parent
							
								
									128fc5f4b8
								
							
						
					
					
						commit
						afe7e847d6
					
				
					 27 changed files with 321 additions and 313 deletions
				
			
		| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestDiveSiteDuplication : public QObject
 | 
					class TestDiveSiteDuplication : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void testReadV2();
 | 
						void testReadV2();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestGitStorage : public QObject
 | 
					class TestGitStorage : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -8,113 +8,113 @@ extern bool parseGpsText(const QString &gps_text, double *latitude, double *long
 | 
				
			||||||
void TestGpsCoords::testISO6709DParse()
 | 
					void TestGpsCoords::testISO6709DParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("52°49'02.388\"N 1°36'17.388\"E",
 | 
						testParseOK("52°49'02.388\"N 1°36'17.388\"E",
 | 
				
			||||||
		coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
							    coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testNegativeISO6709DParse()
 | 
					void TestGpsCoords::testNegativeISO6709DParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("52°49'02.388\"S 1°36'17.388\"W",
 | 
						testParseOK("52°49'02.388\"S 1°36'17.388\"W",
 | 
				
			||||||
		coord2double(-52, -49, -2.388), coord2double(-1, -36, -17.388));
 | 
							    coord2double(-52, -49, -2.388), coord2double(-1, -36, -17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testSpaceISO6709DParse()
 | 
					void TestGpsCoords::testSpaceISO6709DParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("52 ° 49 ' 02.388 \" N  1 ° 36 ' 17.388 \" E",
 | 
						testParseOK("52 ° 49 ' 02.388 \" N  1 ° 36 ' 17.388 \" E",
 | 
				
			||||||
		coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
							    coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testSecondsParse()
 | 
					void TestGpsCoords::testSecondsParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("N52°49'02.388\" E1°36'17.388\"",
 | 
						testParseOK("N52°49'02.388\" E1°36'17.388\"",
 | 
				
			||||||
		coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
							    coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testSpaceSecondsParse()
 | 
					void TestGpsCoords::testSpaceSecondsParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK(" N 52 ° 49 ' 02.388 \"  E 1 ° 36 ' 17.388 \"",
 | 
						testParseOK(" N 52 ° 49 ' 02.388 \"  E 1 ° 36 ' 17.388 \"",
 | 
				
			||||||
		coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
							    coord2double(52, 49, 2.388), coord2double(1, 36, 17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testNegativeSecondsParse()
 | 
					void TestGpsCoords::testNegativeSecondsParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("-52°49'02.388\" -1°36'17.388\"",
 | 
						testParseOK("-52°49'02.388\" -1°36'17.388\"",
 | 
				
			||||||
		coord2double(-52, -49, -2.388), coord2double(-1, -36, -17.388));
 | 
							    coord2double(-52, -49, -2.388), coord2double(-1, -36, -17.388));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testMinutesParse()
 | 
					void TestGpsCoords::testMinutesParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("N52°49.03' E1d36.23'",
 | 
						testParseOK("N52°49.03' E1d36.23'",
 | 
				
			||||||
		coord2double(52, 49.03), coord2double(1, 36.23));
 | 
							    coord2double(52, 49.03), coord2double(1, 36.23));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testSpaceMinutesParse()
 | 
					void TestGpsCoords::testSpaceMinutesParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK(" N 52 ° 49.03 '  E 1 ° 36.23 ' ",
 | 
						testParseOK(" N 52 ° 49.03 '  E 1 ° 36.23 ' ",
 | 
				
			||||||
		coord2double(52, 49.03), coord2double(1, 36.23));
 | 
							    coord2double(52, 49.03), coord2double(1, 36.23));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testMinutesInversedParse()
 | 
					void TestGpsCoords::testMinutesInversedParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("2° 53.836' N 73° 32.839' E",
 | 
						testParseOK("2° 53.836' N 73° 32.839' E",
 | 
				
			||||||
		coord2double(2, 53.836), coord2double(73, 32.839));
 | 
							    coord2double(2, 53.836), coord2double(73, 32.839));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testDecimalParse()
 | 
					void TestGpsCoords::testDecimalParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("N52.83° E1.61",
 | 
						testParseOK("N52.83° E1.61",
 | 
				
			||||||
		coord2double(52.83), coord2double(1.61));
 | 
							    coord2double(52.83), coord2double(1.61));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testDecimalInversedParse()
 | 
					void TestGpsCoords::testDecimalInversedParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("52.83N 1.61E",
 | 
						testParseOK("52.83N 1.61E",
 | 
				
			||||||
		coord2double(52.83), coord2double(1.61));
 | 
							    coord2double(52.83), coord2double(1.61));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testSpaceDecimalParse()
 | 
					void TestGpsCoords::testSpaceDecimalParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK(" N 52.83  E 1.61 ",
 | 
						testParseOK(" N 52.83  E 1.61 ",
 | 
				
			||||||
		coord2double(52.83), coord2double(1.61));
 | 
							    coord2double(52.83), coord2double(1.61));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testXmlFormatParse()
 | 
					void TestGpsCoords::testXmlFormatParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("46.473881 6.784696",
 | 
						testParseOK("46.473881 6.784696",
 | 
				
			||||||
		coord2double(46.473881), coord2double(6.784696));
 | 
							    coord2double(46.473881), coord2double(6.784696));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testNegativeXmlFormatParse()
 | 
					void TestGpsCoords::testNegativeXmlFormatParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("46.473881 -6.784696",
 | 
						testParseOK("46.473881 -6.784696",
 | 
				
			||||||
		coord2double(46.473881), -coord2double(6.784696));
 | 
							    coord2double(46.473881), -coord2double(6.784696));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testNoUnitParse()
 | 
					void TestGpsCoords::testNoUnitParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("48 51.491n 2 17.677e",
 | 
						testParseOK("48 51.491n 2 17.677e",
 | 
				
			||||||
		coord2double(48, 51.491), coord2double(2, 17.677));
 | 
							    coord2double(48, 51.491), coord2double(2, 17.677));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testPrefixNoUnitParse()
 | 
					void TestGpsCoords::testPrefixNoUnitParse()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("n48 51.491 w2 17.677",
 | 
						testParseOK("n48 51.491 w2 17.677",
 | 
				
			||||||
		coord2double(48, 51.491), -coord2double(2, 17.677));
 | 
							    coord2double(48, 51.491), -coord2double(2, 17.677));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testOurWeb()
 | 
					void TestGpsCoords::testOurWeb()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("12° 8' 0.24\" , -68° 16' 58.44\"",
 | 
						testParseOK("12° 8' 0.24\" , -68° 16' 58.44\"",
 | 
				
			||||||
		    coord2double(12, 8, 0.24 ), -coord2double(68, 16, 58.44));
 | 
							    coord2double(12, 8, 0.24), -coord2double(68, 16, 58.44));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testGoogle()
 | 
					void TestGpsCoords::testGoogle()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	testParseOK("12.133400, -68.282900",
 | 
						testParseOK("12.133400, -68.282900",
 | 
				
			||||||
		    coord2double(12, 8, 0.24 ), -coord2double(68, 16, 58.44));
 | 
							    coord2double(12, 8, 0.24), -coord2double(68, 16, 58.44));
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestGpsCoords::testParseOK(const QString &txt, double expectedLat,
 | 
					void TestGpsCoords::testParseOK(const QString &txt, double expectedLat,
 | 
				
			||||||
	double expectedLon)
 | 
									double expectedLon)
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	double actualLat, actualLon;
 | 
						double actualLat, actualLon;
 | 
				
			||||||
	QVERIFY(parseGpsText(txt, &actualLat, &actualLon));
 | 
						QVERIFY(parseGpsText(txt, &actualLat, &actualLon));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestGpsCoords : public QObject {
 | 
					class TestGpsCoords : public QObject {
 | 
				
			||||||
Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void testISO6709DParse();
 | 
						void testISO6709DParse();
 | 
				
			||||||
	void testNegativeISO6709DParse();
 | 
						void testNegativeISO6709DParse();
 | 
				
			||||||
| 
						 | 
					@ -28,7 +28,7 @@ private slots:
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private:
 | 
					private:
 | 
				
			||||||
	static void testParseOK(const QString &txt, double expectedLat,
 | 
						static void testParseOK(const QString &txt, double expectedLat,
 | 
				
			||||||
		double expectedLon);
 | 
									double expectedLon);
 | 
				
			||||||
	static double coord2double(double deg, double min = 0.0, double sec = 0.0);
 | 
						static double coord2double(double deg, double min = 0.0, double sec = 0.0);
 | 
				
			||||||
};
 | 
					};
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testmerge.h"
 | 
					#include "testmerge.h"
 | 
				
			||||||
#include "core/dive.h"
 | 
					#include "core/dive.h"
 | 
				
			||||||
#include "core/file.h"
 | 
					 | 
				
			||||||
#include "core/divelist.h"
 | 
					#include "core/divelist.h"
 | 
				
			||||||
 | 
					#include "core/file.h"
 | 
				
			||||||
#include <QTextStream>
 | 
					#include <QTextStream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestMerge::initTestCase()
 | 
					void TestMerge::initTestCase()
 | 
				
			||||||
| 
						 | 
					@ -34,7 +34,7 @@ void TestMerge::testMergeEmpty()
 | 
				
			||||||
	QTextStream outS(&out);
 | 
						QTextStream outS(&out);
 | 
				
			||||||
	QStringList readin = orgS.readAll().split("\n");
 | 
						QStringList readin = orgS.readAll().split("\n");
 | 
				
			||||||
	QStringList written = outS.readAll().split("\n");
 | 
						QStringList written = outS.readAll().split("\n");
 | 
				
			||||||
	while(readin.size() && written.size()){
 | 
						while (readin.size() && written.size()) {
 | 
				
			||||||
		QCOMPARE(written.takeFirst().trimmed(), readin.takeFirst().trimmed());
 | 
							QCOMPARE(written.takeFirst().trimmed(), readin.takeFirst().trimmed());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -57,7 +57,7 @@ void TestMerge::testMergeBackwards()
 | 
				
			||||||
	QTextStream outS(&out);
 | 
						QTextStream outS(&out);
 | 
				
			||||||
	QStringList readin = orgS.readAll().split("\n");
 | 
						QStringList readin = orgS.readAll().split("\n");
 | 
				
			||||||
	QStringList written = outS.readAll().split("\n");
 | 
						QStringList written = outS.readAll().split("\n");
 | 
				
			||||||
	while(readin.size() && written.size()){
 | 
						while (readin.size() && written.size()) {
 | 
				
			||||||
		QCOMPARE(written.takeFirst().trimmed(), readin.takeFirst().trimmed());
 | 
							QCOMPARE(written.takeFirst().trimmed(), readin.takeFirst().trimmed());
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestMerge : public QObject{
 | 
					class TestMerge : public QObject {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,30 +1,30 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testparse.h"
 | 
					#include "testparse.h"
 | 
				
			||||||
#include "core/dive.h"
 | 
					#include "core/dive.h"
 | 
				
			||||||
#include "core/subsurface-string.h"
 | 
					 | 
				
			||||||
#include "core/parse.h"
 | 
					 | 
				
			||||||
#include "core/file.h"
 | 
					 | 
				
			||||||
#include "core/divelist.h"
 | 
					#include "core/divelist.h"
 | 
				
			||||||
#include <QTextStream>
 | 
					#include "core/file.h"
 | 
				
			||||||
 | 
					#include "core/parse.h"
 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/subsurface-string.h"
 | 
				
			||||||
 | 
					#include <QTextStream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
/* We have to use a macro since QCOMPARE
 | 
					/* We have to use a macro since QCOMPARE
 | 
				
			||||||
 * can only be called from a test method
 | 
					 * can only be called from a test method
 | 
				
			||||||
 * invoked by the QTest framework
 | 
					 * invoked by the QTest framework
 | 
				
			||||||
 */
 | 
					 */
 | 
				
			||||||
#define FILE_COMPARE(actual, expected)				\
 | 
					#define FILE_COMPARE(actual, expected)                    \
 | 
				
			||||||
	QFile org(expected);					\
 | 
						QFile org(expected);                              \
 | 
				
			||||||
	org.open(QFile::ReadOnly);				\
 | 
						org.open(QFile::ReadOnly);                        \
 | 
				
			||||||
	QFile out(actual);					\
 | 
						QFile out(actual);                                \
 | 
				
			||||||
	out.open(QFile::ReadOnly);				\
 | 
						out.open(QFile::ReadOnly);                        \
 | 
				
			||||||
	QTextStream orgS(&org);					\
 | 
						QTextStream orgS(&org);                           \
 | 
				
			||||||
	QTextStream outS(&out);					\
 | 
						QTextStream outS(&out);                           \
 | 
				
			||||||
	QStringList readin = orgS.readAll().split("\n");	\
 | 
						QStringList readin = orgS.readAll().split("\n");  \
 | 
				
			||||||
	QStringList written = outS.readAll().split("\n");	\
 | 
						QStringList written = outS.readAll().split("\n"); \
 | 
				
			||||||
	while(readin.size() && written.size()){			\
 | 
						while (readin.size() && written.size()) {         \
 | 
				
			||||||
		QCOMPARE(written.takeFirst().trimmed(),		\
 | 
							QCOMPARE(written.takeFirst().trimmed(),   \
 | 
				
			||||||
			readin.takeFirst().trimmed());		\
 | 
								 readin.takeFirst().trimmed());   \
 | 
				
			||||||
	}							\
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::initTestCase()
 | 
					void TestParse::initTestCase()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -116,7 +116,7 @@ int TestParse::parseDivingLog()
 | 
				
			||||||
	ds->name = copy_string("Suomi -  - Hälvälä");
 | 
						ds->name = copy_string("Suomi -  - Hälvälä");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int ret = sqlite3_open(SUBSURFACE_TEST_DATA "/dives/TestDivingLog4.1.1.sql", &_sqlite3_handle);
 | 
						int ret = sqlite3_open(SUBSURFACE_TEST_DATA "/dives/TestDivingLog4.1.1.sql", &_sqlite3_handle);
 | 
				
			||||||
	if ( ret == 0 )
 | 
						if (ret == 0)
 | 
				
			||||||
		ret = parse_divinglog_buffer(_sqlite3_handle, 0, 0, 0, &dive_table);
 | 
							ret = parse_divinglog_buffer(_sqlite3_handle, 0, 0, 0, &dive_table);
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
		fprintf(stderr, "Can't open sqlite3 db: " SUBSURFACE_TEST_DATA "/dives/TestDivingLog4.1.1.sql");
 | 
							fprintf(stderr, "Can't open sqlite3 db: " SUBSURFACE_TEST_DATA "/dives/TestDivingLog4.1.1.sql");
 | 
				
			||||||
| 
						 | 
					@ -152,7 +152,7 @@ void TestParse::testParse()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(save_dives("./testout.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testout.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testout.ssrf",
 | 
						FILE_COMPARE("./testout.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/test40-42.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/test40-42.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseDM4()
 | 
					void TestParse::testParseDM4()
 | 
				
			||||||
| 
						 | 
					@ -162,7 +162,7 @@ void TestParse::testParseDM4()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(save_dives("./testdm4out.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testdm4out.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testdm4out.ssrf",
 | 
						FILE_COMPARE("./testdm4out.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/TestDiveDM4.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/TestDiveDM4.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseDM5()
 | 
					void TestParse::testParseDM5()
 | 
				
			||||||
| 
						 | 
					@ -172,7 +172,7 @@ void TestParse::testParseDM5()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(save_dives("./testdm5out.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testdm5out.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testdm5out.ssrf",
 | 
						FILE_COMPARE("./testdm5out.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/TestDiveDM5.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/TestDiveDM5.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseHUDC()
 | 
					void TestParse::testParseHUDC()
 | 
				
			||||||
| 
						 | 
					@ -215,7 +215,8 @@ void TestParse::testParseHUDC()
 | 
				
			||||||
	params[pnr++] = NULL;
 | 
						params[pnr++] = NULL;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(parse_csv_file(SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearHUDC.csv",
 | 
						QCOMPARE(parse_csv_file(SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearHUDC.csv",
 | 
				
			||||||
				params, pnr - 1, "csv"), 0);
 | 
									params, pnr - 1, "csv"),
 | 
				
			||||||
 | 
							 0);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(dive_table.nr, 1);
 | 
						QCOMPARE(dive_table.nr, 1);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -231,7 +232,7 @@ void TestParse::testParseHUDC()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(save_dives("./testhudcout.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testhudcout.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testhudcout.ssrf",
 | 
						FILE_COMPARE("./testhudcout.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearHUDC.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearHUDC.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseNewFormat()
 | 
					void TestParse::testParseNewFormat()
 | 
				
			||||||
| 
						 | 
					@ -256,7 +257,11 @@ void TestParse::testParseNewFormat()
 | 
				
			||||||
	for (int i = 0; i < files.size(); ++i) {
 | 
						for (int i = 0; i < files.size(); ++i) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
		QCOMPARE(parse_seabear_log(QString::fromLatin1(SUBSURFACE_TEST_DATA
 | 
							QCOMPARE(parse_seabear_log(QString::fromLatin1(SUBSURFACE_TEST_DATA
 | 
				
			||||||
			"/dives/").append(files.at(i)).toLatin1().data()), 0);
 | 
												       "/dives/")
 | 
				
			||||||
 | 
											   .append(files.at(i))
 | 
				
			||||||
 | 
											   .toLatin1()
 | 
				
			||||||
 | 
											   .data()),
 | 
				
			||||||
 | 
								 0);
 | 
				
			||||||
		QCOMPARE(dive_table.nr, i + 1);
 | 
							QCOMPARE(dive_table.nr, i + 1);
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -265,7 +270,7 @@ void TestParse::testParseNewFormat()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Currently the CSV parse fails
 | 
						// Currently the CSV parse fails
 | 
				
			||||||
	FILE_COMPARE("./testsbnewout.ssrf",
 | 
						FILE_COMPARE("./testsbnewout.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearNewFormat.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/TestDiveSeabearNewFormat.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseDLD()
 | 
					void TestParse::testParseDLD()
 | 
				
			||||||
| 
						 | 
					@ -286,7 +291,7 @@ void TestParse::testParseDLD()
 | 
				
			||||||
	 */
 | 
						 */
 | 
				
			||||||
	QCOMPARE(save_dives("./testdldout.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testdldout.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testdldout.ssrf",
 | 
						FILE_COMPARE("./testdldout.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/TestDiveDivelogsDE.xml")
 | 
							     SUBSURFACE_TEST_DATA "/dives/TestDiveDivelogsDE.xml")
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestParse::testParseMerge()
 | 
					void TestParse::testParseMerge()
 | 
				
			||||||
| 
						 | 
					@ -298,7 +303,7 @@ void TestParse::testParseMerge()
 | 
				
			||||||
	QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/vyper.xml"), 0);
 | 
						QCOMPARE(parse_file(SUBSURFACE_TEST_DATA "/dives/vyper.xml"), 0);
 | 
				
			||||||
	QCOMPARE(save_dives("./testmerge.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testmerge.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testmerge.ssrf",
 | 
						FILE_COMPARE("./testmerge.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/mergedVyperOstc.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/mergedVyperOstc.xml");
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
int TestParse::parseCSVmanual(int units, std::string file)
 | 
					int TestParse::parseCSVmanual(int units, std::string file)
 | 
				
			||||||
| 
						 | 
					@ -377,7 +382,7 @@ void TestParse::exportCSVDiveDetails()
 | 
				
			||||||
	export_dives_xslt("testcsvexportmanual2.csv", 0, 0, "xml2manualcsv.xslt");
 | 
						export_dives_xslt("testcsvexportmanual2.csv", 0, 0, "xml2manualcsv.xslt");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FILE_COMPARE("testcsvexportmanual2.csv",
 | 
						FILE_COMPARE("testcsvexportmanual2.csv",
 | 
				
			||||||
		"testcsvexportmanual.csv");
 | 
							     "testcsvexportmanual.csv");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clear_dive_file_data();
 | 
						clear_dive_file_data();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -426,7 +431,7 @@ void TestParse::exportCSVDiveProfile()
 | 
				
			||||||
	export_dives_xslt("testcsvexportprofile2.csv", 0, 0, "xml2csv.xslt");
 | 
						export_dives_xslt("testcsvexportprofile2.csv", 0, 0, "xml2csv.xslt");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FILE_COMPARE("testcsvexportprofile2.csv",
 | 
						FILE_COMPARE("testcsvexportprofile2.csv",
 | 
				
			||||||
		"testcsvexportprofile.csv");
 | 
							     "testcsvexportprofile.csv");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clear_dive_file_data();
 | 
						clear_dive_file_data();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -443,7 +448,7 @@ void TestParse::exportUDDF()
 | 
				
			||||||
	export_dives_xslt("testuddfexport2.uddf", 0, 1, "uddf-export.xslt");
 | 
						export_dives_xslt("testuddfexport2.uddf", 0, 1, "uddf-export.xslt");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	FILE_COMPARE("testuddfexport.uddf",
 | 
						FILE_COMPARE("testuddfexport.uddf",
 | 
				
			||||||
		"testuddfexport2.uddf");
 | 
							     "testuddfexport2.uddf");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clear_dive_file_data();
 | 
						clear_dive_file_data();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -504,12 +509,13 @@ void TestParse::parseDL7()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	clear_dive_file_data();
 | 
						clear_dive_file_data();
 | 
				
			||||||
	QCOMPARE(parse_csv_file(SUBSURFACE_TEST_DATA "/dives/DL7.zxu",
 | 
						QCOMPARE(parse_csv_file(SUBSURFACE_TEST_DATA "/dives/DL7.zxu",
 | 
				
			||||||
				params, pnr - 1 , "DL7"), 0);
 | 
									params, pnr - 1, "DL7"),
 | 
				
			||||||
 | 
							 0);
 | 
				
			||||||
	QCOMPARE(dive_table.nr, 3);
 | 
						QCOMPARE(dive_table.nr, 3);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(save_dives("./testdl7out.ssrf"), 0);
 | 
						QCOMPARE(save_dives("./testdl7out.ssrf"), 0);
 | 
				
			||||||
	FILE_COMPARE("./testdl7out.ssrf",
 | 
						FILE_COMPARE("./testdl7out.ssrf",
 | 
				
			||||||
		SUBSURFACE_TEST_DATA "/dives/DL7.xml");
 | 
							     SUBSURFACE_TEST_DATA "/dives/DL7.xml");
 | 
				
			||||||
	clear_dive_file_data();
 | 
						clear_dive_file_data();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
#include <sqlite3.h>
 | 
					#include <sqlite3.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestParse : public QObject{
 | 
					class TestParse : public QObject {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testpicture.h"
 | 
					#include "testpicture.h"
 | 
				
			||||||
#include "core/dive.h"
 | 
					#include "core/dive.h"
 | 
				
			||||||
#include "core/file.h"
 | 
					 | 
				
			||||||
#include "core/divelist.h"
 | 
					#include "core/divelist.h"
 | 
				
			||||||
 | 
					#include "core/file.h"
 | 
				
			||||||
#include <QString>
 | 
					#include <QString>
 | 
				
			||||||
#include <core/qthelper.h>
 | 
					#include <core/qthelper.h>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestPicture : public QObject{
 | 
					class TestPicture : public QObject {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,13 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "core/dive.h"
 | 
					 | 
				
			||||||
#include "testplan.h"
 | 
					#include "testplan.h"
 | 
				
			||||||
 | 
					#include "core/dive.h"
 | 
				
			||||||
#include "core/planner.h"
 | 
					#include "core/planner.h"
 | 
				
			||||||
#include "core/units.h"
 | 
					 | 
				
			||||||
#include "core/subsurfacestartup.h"
 | 
					 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/subsurfacestartup.h"
 | 
				
			||||||
 | 
					#include "core/units.h"
 | 
				
			||||||
#include <QDebug>
 | 
					#include <QDebug>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define DEBUG  1
 | 
					#define DEBUG 1
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// testing the dive plan algorithm
 | 
					// testing the dive plan algorithm
 | 
				
			||||||
struct decostop stoptable[60];
 | 
					struct decostop stoptable[60];
 | 
				
			||||||
| 
						 | 
					@ -45,10 +45,10 @@ void setupPlan(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {150}, {450} };
 | 
						struct gasmix bottomgas = {{150}, {450}};
 | 
				
			||||||
	struct gasmix ean36 = { {360}, {0} };
 | 
						struct gasmix ean36 = {{360}, {0}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -58,10 +58,10 @@ void setupPlan(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(79, 260) * 60 / M_OR_FT(23, 75);
 | 
						int droptime = M_OR_FT(79, 260) * 60 / M_OR_FT(23, 75);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean36, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean36, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(79, 260), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(79, 260), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 30*60 - droptime, M_OR_FT(79, 260), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(79, 260), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb45m30mTx(struct diveplan *dp)
 | 
					void setupPlanVpmb45m30mTx(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -73,10 +73,10 @@ void setupPlanVpmb45m30mTx(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {210}, {350} };
 | 
						struct gasmix bottomgas = {{210}, {350}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 24000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 24000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -86,10 +86,10 @@ void setupPlanVpmb45m30mTx(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(45, 150) * 60 / M_OR_FT(23, 75);
 | 
						int droptime = M_OR_FT(45, 150) * 60 / M_OR_FT(23, 75);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(45, 150), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(45, 150), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 30*60 - droptime, M_OR_FT(45, 150), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(45, 150), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb60m10mTx(struct diveplan *dp)
 | 
					void setupPlanVpmb60m10mTx(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -101,10 +101,10 @@ void setupPlanVpmb60m10mTx(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {180}, {450} };
 | 
						struct gasmix bottomgas = {{180}, {450}};
 | 
				
			||||||
	struct gasmix tx50_15 = { {500}, {150} };
 | 
						struct gasmix tx50_15 = {{500}, {150}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 24000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 24000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -114,10 +114,10 @@ void setupPlanVpmb60m10mTx(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(23, 75);
 | 
						int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(23, 75);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&tx50_15, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&tx50_15, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 10*60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 10 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb60m30minAir(struct diveplan *dp)
 | 
					void setupPlanVpmb60m30minAir(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -127,7 +127,7 @@ void setupPlanVpmb60m30minAir(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {210}, {0} };
 | 
						struct gasmix bottomgas = {{210}, {0}};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 100000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 100000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -137,7 +137,7 @@ void setupPlanVpmb60m30minAir(struct diveplan *dp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 30*60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb60m30minEan50(struct diveplan *dp)
 | 
					void setupPlanVpmb60m30minEan50(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -147,9 +147,9 @@ void setupPlanVpmb60m30minEan50(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {210}, {0} };
 | 
						struct gasmix bottomgas = {{210}, {0}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -159,9 +159,9 @@ void setupPlanVpmb60m30minEan50(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 30*60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb60m30minTx(struct diveplan *dp)
 | 
					void setupPlanVpmb60m30minTx(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -171,9 +171,9 @@ void setupPlanVpmb60m30minTx(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {180}, {450} };
 | 
						struct gasmix bottomgas = {{180}, {450}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -183,9 +183,9 @@ void setupPlanVpmb60m30minTx(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(60, 200) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 30*60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 30 * 60 - droptime, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmbMultiLevelAir(struct diveplan *dp)
 | 
					void setupPlanVpmbMultiLevelAir(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -195,7 +195,7 @@ void setupPlanVpmbMultiLevelAir(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {210}, {0} };
 | 
						struct gasmix bottomgas = {{210}, {0}};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 200000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 200000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -205,9 +205,9 @@ void setupPlanVpmbMultiLevelAir(struct diveplan *dp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(20, 66) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(20, 66) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(20, 66), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(20, 66), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 10*60 - droptime, M_OR_FT(20, 66), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 10 * 60 - droptime, M_OR_FT(20, 66), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 1*60, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 1 * 60, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 29*60, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 29 * 60, M_OR_FT(60, 200), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb100m60min(struct diveplan *dp)
 | 
					void setupPlanVpmb100m60min(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -217,10 +217,10 @@ void setupPlanVpmb100m60min(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {180}, {450} };
 | 
						struct gasmix bottomgas = {{180}, {450}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 200000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 200000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -231,10 +231,10 @@ void setupPlanVpmb100m60min(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 60*60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 60 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb100m10min(struct diveplan *dp)
 | 
					void setupPlanVpmb100m10min(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -244,10 +244,10 @@ void setupPlanVpmb100m10min(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {180}, {450} };
 | 
						struct gasmix bottomgas = {{180}, {450}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 60000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 60000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -258,10 +258,10 @@ void setupPlanVpmb100m10min(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330);
 | 
						int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(99, 330);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 10*60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 10 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb30m20min(struct diveplan *dp)
 | 
					void setupPlanVpmb30m20min(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -271,7 +271,7 @@ void setupPlanVpmb30m20min(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {210}, {0} };
 | 
						struct gasmix bottomgas = {{210}, {0}};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -281,7 +281,7 @@ void setupPlanVpmb30m20min(struct diveplan *dp)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(30, 100) * 60 / M_OR_FT(18, 60);
 | 
						int droptime = M_OR_FT(30, 100) * 60 / M_OR_FT(18, 60);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(30, 100), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(30, 100), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 20*60 - droptime, M_OR_FT(30, 100), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 20 * 60 - droptime, M_OR_FT(30, 100), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void setupPlanVpmb100mTo70m30min(struct diveplan *dp)
 | 
					void setupPlanVpmb100mTo70m30min(struct diveplan *dp)
 | 
				
			||||||
| 
						 | 
					@ -291,11 +291,11 @@ void setupPlanVpmb100mTo70m30min(struct diveplan *dp)
 | 
				
			||||||
	dp->bottomsac = prefs.bottomsac;
 | 
						dp->bottomsac = prefs.bottomsac;
 | 
				
			||||||
	dp->decosac = prefs.decosac;
 | 
						dp->decosac = prefs.decosac;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	struct gasmix bottomgas = { {120}, {650} };
 | 
						struct gasmix bottomgas = {{120}, {650}};
 | 
				
			||||||
	struct gasmix tx21_35 = { {210}, {350} };
 | 
						struct gasmix tx21_35 = {{210}, {350}};
 | 
				
			||||||
	struct gasmix ean50 = { {500}, {0} };
 | 
						struct gasmix ean50 = {{500}, {0}};
 | 
				
			||||||
	struct gasmix oxygen = { {1000}, {0} };
 | 
						struct gasmix oxygen = {{1000}, {0}};
 | 
				
			||||||
	pressure_t po2 = { 1600 };
 | 
						pressure_t po2 = {1600};
 | 
				
			||||||
	displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
						displayed_dive.cylinder[0].gasmix = bottomgas;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
						displayed_dive.cylinder[0].type.size.mliter = 36000;
 | 
				
			||||||
	displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
						displayed_dive.cylinder[0].type.workingpressure.mbar = 232000;
 | 
				
			||||||
| 
						 | 
					@ -307,12 +307,12 @@ void setupPlanVpmb100mTo70m30min(struct diveplan *dp)
 | 
				
			||||||
	free_dps(dp);
 | 
						free_dps(dp);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(18, 60);
 | 
						int droptime = M_OR_FT(100, 330) * 60 / M_OR_FT(18, 60);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&tx21_35, po2, &displayed_dive, M_OR_FT(3,10)).mm, 1, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&tx21_35, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 1, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3,10)).mm, 2, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&ean50, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 2, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3,10)).mm, 3, 0, 1, OC);
 | 
						plan_add_segment(dp, 0, gas_mod(&oxygen, po2, &displayed_dive, M_OR_FT(3, 10)).mm, 3, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 20*60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 20 * 60 - droptime, M_OR_FT(100, 330), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, 3*60, M_OR_FT(70, 230), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, 3 * 60, M_OR_FT(70, 230), 0, 0, 1, OC);
 | 
				
			||||||
	plan_add_segment(dp, (30 - 20 - 3) * 60, M_OR_FT(70, 230), 0, 0, 1, OC);
 | 
						plan_add_segment(dp, (30 - 20 - 3) * 60, M_OR_FT(70, 230), 0, 0, 1, OC);
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -373,7 +373,8 @@ void TestPlan::testMetric()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 148l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 148l);
 | 
				
			||||||
	// check first gas change to EAN36 at 33m
 | 
						// check first gas change to EAN36 at 33m
 | 
				
			||||||
	struct event *ev = displayed_dive.dc.events;
 | 
						struct event *ev = displayed_dive.dc.events;
 | 
				
			||||||
| 
						 | 
					@ -413,7 +414,8 @@ void TestPlan::testImperial()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 154l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 154l);
 | 
				
			||||||
	// check first gas change to EAN36 at 33m
 | 
						// check first gas change to EAN36 at 33m
 | 
				
			||||||
	struct event *ev = displayed_dive.dc.events;
 | 
						struct event *ev = displayed_dive.dc.events;
 | 
				
			||||||
| 
						 | 
					@ -453,7 +455,8 @@ void TestPlan::testVpmbMetric45m30minTx()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 108l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 108l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -483,7 +486,8 @@ void TestPlan::testVpmbMetric60m10minTx()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 162l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 162l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -513,7 +517,8 @@ void TestPlan::testVpmbMetric60m30minAir()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 180l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 180l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -543,7 +548,8 @@ void TestPlan::testVpmbMetric60m30minEan50()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 155l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 155l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -579,7 +585,8 @@ void TestPlan::testVpmbMetric60m30minTx()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 159l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 159l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -615,7 +622,8 @@ void TestPlan::testVpmbMetric100m60min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 157l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 157l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -657,7 +665,8 @@ void TestPlan::testVpmbMetricMultiLevelAir()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 101l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 101l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -687,7 +696,8 @@ void TestPlan::testVpmbMetric100m10min()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 175l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 175l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -733,7 +743,8 @@ void TestPlan::testVpmbMetricRepeat()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	struct divedatapoint *dp = testPlan.dp;
 | 
						struct divedatapoint *dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 61l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 61l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -753,7 +764,8 @@ void TestPlan::testVpmbMetricRepeat()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	dp = testPlan.dp;
 | 
						dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 80l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 80l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					@ -789,7 +801,8 @@ void TestPlan::testVpmbMetricRepeat()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// check minimum gas result
 | 
						// check minimum gas result
 | 
				
			||||||
	dp = testPlan.dp;
 | 
						dp = testPlan.dp;
 | 
				
			||||||
	while(!dp->minimum_gas.mbar && dp->next) dp = dp->next;
 | 
						while (!dp->minimum_gas.mbar && dp->next)
 | 
				
			||||||
 | 
							dp = dp->next;
 | 
				
			||||||
	QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 61l);
 | 
						QCOMPARE(lrint(dp->minimum_gas.mbar / 1000.0), 61l);
 | 
				
			||||||
	// print first ceiling
 | 
						// print first ceiling
 | 
				
			||||||
	printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
						printf("First ceiling %.1f m\n", (mbar_to_depth(test_deco_state.first_ceiling_pressure.mbar, &displayed_dive) * 0.001));
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -3,14 +3,14 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/subsurface-qt/SettingsObjectWrapper.h"
 | 
					#include "core/subsurface-qt/SettingsObjectWrapper.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					 | 
				
			||||||
#include <QDate>
 | 
					#include <QDate>
 | 
				
			||||||
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TEST(METHOD, VALUE) \
 | 
					#define TEST(METHOD, VALUE)      \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE); \
 | 
						QCOMPARE(METHOD, VALUE); \
 | 
				
			||||||
pref->sync(); \
 | 
						pref->sync();            \
 | 
				
			||||||
pref->load(); \
 | 
						pref->load();            \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE);
 | 
						QCOMPARE(METHOD, VALUE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestPreferences::initTestCase()
 | 
					void TestPreferences::initTestCase()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -165,17 +165,17 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	fb->setUserId("tomaz-user-id");
 | 
						fb->setUserId("tomaz-user-id");
 | 
				
			||||||
	fb->setAlbumId("album-id");
 | 
						fb->setAlbumId("album-id");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(fb->accessToken(),QStringLiteral("rand-access-token"));
 | 
						TEST(fb->accessToken(), QStringLiteral("rand-access-token"));
 | 
				
			||||||
	TEST(fb->userId(),     QStringLiteral("tomaz-user-id"));
 | 
						TEST(fb->userId(), QStringLiteral("tomaz-user-id"));
 | 
				
			||||||
	TEST(fb->albumId(),    QStringLiteral("album-id"));
 | 
						TEST(fb->albumId(), QStringLiteral("album-id"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	fb->setAccessToken("rand-access-token-2");
 | 
						fb->setAccessToken("rand-access-token-2");
 | 
				
			||||||
	fb->setUserId("tomaz-user-id-2");
 | 
						fb->setUserId("tomaz-user-id-2");
 | 
				
			||||||
	fb->setAlbumId("album-id-2");
 | 
						fb->setAlbumId("album-id-2");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(fb->accessToken(),QStringLiteral("rand-access-token-2"));
 | 
						TEST(fb->accessToken(), QStringLiteral("rand-access-token-2"));
 | 
				
			||||||
	TEST(fb->userId(),     QStringLiteral("tomaz-user-id-2"));
 | 
						TEST(fb->userId(), QStringLiteral("tomaz-user-id-2"));
 | 
				
			||||||
	TEST(fb->albumId(),    QStringLiteral("album-id-2"));
 | 
						TEST(fb->albumId(), QStringLiteral("album-id-2"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto geo = pref->geocoding;
 | 
						auto geo = pref->geocoding;
 | 
				
			||||||
	geo->setFirstTaxonomyCategory(TC_NONE);
 | 
						geo->setFirstTaxonomyCategory(TC_NONE);
 | 
				
			||||||
| 
						 | 
					@ -202,12 +202,12 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	proxy->setUser("unknown");
 | 
						proxy->setUser("unknown");
 | 
				
			||||||
	proxy->setPass("secret");
 | 
						proxy->setPass("secret");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(proxy->type(),2);
 | 
						TEST(proxy->type(), 2);
 | 
				
			||||||
	TEST(proxy->port(),80);
 | 
						TEST(proxy->port(), 80);
 | 
				
			||||||
	TEST(proxy->auth(),true);
 | 
						TEST(proxy->auth(), true);
 | 
				
			||||||
	TEST(proxy->host(),QStringLiteral("localhost"));
 | 
						TEST(proxy->host(), QStringLiteral("localhost"));
 | 
				
			||||||
	TEST(proxy->user(),QStringLiteral("unknown"));
 | 
						TEST(proxy->user(), QStringLiteral("unknown"));
 | 
				
			||||||
	TEST(proxy->pass(),QStringLiteral("secret"));
 | 
						TEST(proxy->pass(), QStringLiteral("secret"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	proxy->setType(3);
 | 
						proxy->setType(3);
 | 
				
			||||||
	proxy->setPort(8080);
 | 
						proxy->setPort(8080);
 | 
				
			||||||
| 
						 | 
					@ -216,12 +216,12 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	proxy->setUser("unknown_1");
 | 
						proxy->setUser("unknown_1");
 | 
				
			||||||
	proxy->setPass("secret_1");
 | 
						proxy->setPass("secret_1");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(proxy->type(),3);
 | 
						TEST(proxy->type(), 3);
 | 
				
			||||||
	TEST(proxy->port(),8080);
 | 
						TEST(proxy->port(), 8080);
 | 
				
			||||||
	TEST(proxy->auth(),false);
 | 
						TEST(proxy->auth(), false);
 | 
				
			||||||
	TEST(proxy->host(),QStringLiteral("127.0.0.1"));
 | 
						TEST(proxy->host(), QStringLiteral("127.0.0.1"));
 | 
				
			||||||
	TEST(proxy->user(),QStringLiteral("unknown_1"));
 | 
						TEST(proxy->user(), QStringLiteral("unknown_1"));
 | 
				
			||||||
	TEST(proxy->pass(),QStringLiteral("secret_1"));
 | 
						TEST(proxy->pass(), QStringLiteral("secret_1"));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto planner = pref->planner_settings;
 | 
						auto planner = pref->planner_settings;
 | 
				
			||||||
	planner->setLastStop(true);
 | 
						planner->setLastStop(true);
 | 
				
			||||||
| 
						 | 
					@ -249,30 +249,30 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	planner->setDecoMode(BUEHLMANN);
 | 
						planner->setDecoMode(BUEHLMANN);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->lastStop(),true);
 | 
						TEST(planner->lastStop(), true);
 | 
				
			||||||
	TEST(planner->verbatimPlan(),true);
 | 
						TEST(planner->verbatimPlan(), true);
 | 
				
			||||||
	TEST(planner->displayRuntime(),true);
 | 
						TEST(planner->displayRuntime(), true);
 | 
				
			||||||
	TEST(planner->displayDuration(),true);
 | 
						TEST(planner->displayDuration(), true);
 | 
				
			||||||
	TEST(planner->displayTransitions(),true);
 | 
						TEST(planner->displayTransitions(), true);
 | 
				
			||||||
	TEST(planner->doo2breaks(),true);
 | 
						TEST(planner->doo2breaks(), true);
 | 
				
			||||||
	TEST(planner->dropStoneMode(),true);
 | 
						TEST(planner->dropStoneMode(), true);
 | 
				
			||||||
	TEST(planner->safetyStop(),true);
 | 
						TEST(planner->safetyStop(), true);
 | 
				
			||||||
	TEST(planner->switchAtRequiredStop(),true);
 | 
						TEST(planner->switchAtRequiredStop(), true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->ascrate75(),1);
 | 
						TEST(planner->ascrate75(), 1);
 | 
				
			||||||
	TEST(planner->ascrate50(),2);
 | 
						TEST(planner->ascrate50(), 2);
 | 
				
			||||||
	TEST(planner->ascratestops(),3);
 | 
						TEST(planner->ascratestops(), 3);
 | 
				
			||||||
	TEST(planner->ascratelast6m(),4);
 | 
						TEST(planner->ascratelast6m(), 4);
 | 
				
			||||||
	TEST(planner->descrate(),5);
 | 
						TEST(planner->descrate(), 5);
 | 
				
			||||||
	TEST(planner->bottompo2(),6);
 | 
						TEST(planner->bottompo2(), 6);
 | 
				
			||||||
	TEST(planner->decopo2(),7);
 | 
						TEST(planner->decopo2(), 7);
 | 
				
			||||||
	TEST(planner->bestmixend(),8);
 | 
						TEST(planner->bestmixend(), 8);
 | 
				
			||||||
	TEST(planner->reserveGas(),9);
 | 
						TEST(planner->reserveGas(), 9);
 | 
				
			||||||
	TEST(planner->minSwitchDuration(),10);
 | 
						TEST(planner->minSwitchDuration(), 10);
 | 
				
			||||||
	TEST(planner->bottomSac(),11);
 | 
						TEST(planner->bottomSac(), 11);
 | 
				
			||||||
	TEST(planner->decoSac(),12);
 | 
						TEST(planner->decoSac(), 12);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->decoMode(),BUEHLMANN);
 | 
						TEST(planner->decoMode(), BUEHLMANN);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	planner->setLastStop(false);
 | 
						planner->setLastStop(false);
 | 
				
			||||||
	planner->setVerbatimPlan(false);
 | 
						planner->setVerbatimPlan(false);
 | 
				
			||||||
| 
						 | 
					@ -299,30 +299,30 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	planner->setDecoMode(RECREATIONAL);
 | 
						planner->setDecoMode(RECREATIONAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->lastStop(),false);
 | 
						TEST(planner->lastStop(), false);
 | 
				
			||||||
	TEST(planner->verbatimPlan(),false);
 | 
						TEST(planner->verbatimPlan(), false);
 | 
				
			||||||
	TEST(planner->displayRuntime(),false);
 | 
						TEST(planner->displayRuntime(), false);
 | 
				
			||||||
	TEST(planner->displayDuration(),false);
 | 
						TEST(planner->displayDuration(), false);
 | 
				
			||||||
	TEST(planner->displayTransitions(),false);
 | 
						TEST(planner->displayTransitions(), false);
 | 
				
			||||||
	TEST(planner->doo2breaks(),false);
 | 
						TEST(planner->doo2breaks(), false);
 | 
				
			||||||
	TEST(planner->dropStoneMode(),false);
 | 
						TEST(planner->dropStoneMode(), false);
 | 
				
			||||||
	TEST(planner->safetyStop(),false);
 | 
						TEST(planner->safetyStop(), false);
 | 
				
			||||||
	TEST(planner->switchAtRequiredStop(),false);
 | 
						TEST(planner->switchAtRequiredStop(), false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->ascrate75(),11);
 | 
						TEST(planner->ascrate75(), 11);
 | 
				
			||||||
	TEST(planner->ascrate50(),12);
 | 
						TEST(planner->ascrate50(), 12);
 | 
				
			||||||
	TEST(planner->ascratestops(),13);
 | 
						TEST(planner->ascratestops(), 13);
 | 
				
			||||||
	TEST(planner->ascratelast6m(),14);
 | 
						TEST(planner->ascratelast6m(), 14);
 | 
				
			||||||
	TEST(planner->descrate(),15);
 | 
						TEST(planner->descrate(), 15);
 | 
				
			||||||
	TEST(planner->bottompo2(),16);
 | 
						TEST(planner->bottompo2(), 16);
 | 
				
			||||||
	TEST(planner->decopo2(),17);
 | 
						TEST(planner->decopo2(), 17);
 | 
				
			||||||
	TEST(planner->bestmixend(),18);
 | 
						TEST(planner->bestmixend(), 18);
 | 
				
			||||||
	TEST(planner->reserveGas(),19);
 | 
						TEST(planner->reserveGas(), 19);
 | 
				
			||||||
	TEST(planner->minSwitchDuration(),110);
 | 
						TEST(planner->minSwitchDuration(), 110);
 | 
				
			||||||
	TEST(planner->bottomSac(),111);
 | 
						TEST(planner->bottomSac(), 111);
 | 
				
			||||||
	TEST(planner->decoSac(),112);
 | 
						TEST(planner->decoSac(), 112);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(planner->decoMode(),RECREATIONAL);
 | 
						TEST(planner->decoMode(), RECREATIONAL);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto units = pref->unit_settings;
 | 
						auto units = pref->unit_settings;
 | 
				
			||||||
	units->setLength(0);
 | 
						units->setLength(0);
 | 
				
			||||||
| 
						 | 
					@ -334,14 +334,14 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	units->setUnitSystem(QStringLiteral("metric"));
 | 
						units->setUnitSystem(QStringLiteral("metric"));
 | 
				
			||||||
	units->setCoordinatesTraditional(false);
 | 
						units->setCoordinatesTraditional(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(units->length(),0);
 | 
						TEST(units->length(), 0);
 | 
				
			||||||
	TEST(units->pressure(),0);
 | 
						TEST(units->pressure(), 0);
 | 
				
			||||||
	TEST(units->volume(),0);
 | 
						TEST(units->volume(), 0);
 | 
				
			||||||
	TEST(units->temperature(),0);
 | 
						TEST(units->temperature(), 0);
 | 
				
			||||||
	TEST(units->weight(),0);
 | 
						TEST(units->weight(), 0);
 | 
				
			||||||
	TEST(units->verticalSpeedTime(),0);
 | 
						TEST(units->verticalSpeedTime(), 0);
 | 
				
			||||||
	TEST(units->unitSystem(),QStringLiteral("metric"));
 | 
						TEST(units->unitSystem(), QStringLiteral("metric"));
 | 
				
			||||||
	TEST(units->coordinatesTraditional(),false);
 | 
						TEST(units->coordinatesTraditional(), false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	units->setLength(1);
 | 
						units->setLength(1);
 | 
				
			||||||
	units->setPressure(1);
 | 
						units->setPressure(1);
 | 
				
			||||||
| 
						 | 
					@ -352,60 +352,60 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	units->setUnitSystem(QStringLiteral("fake-metric-system"));
 | 
						units->setUnitSystem(QStringLiteral("fake-metric-system"));
 | 
				
			||||||
	units->setCoordinatesTraditional(true);
 | 
						units->setCoordinatesTraditional(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(units->length(),1);
 | 
						TEST(units->length(), 1);
 | 
				
			||||||
	TEST(units->pressure(),1);
 | 
						TEST(units->pressure(), 1);
 | 
				
			||||||
	TEST(units->volume(),1);
 | 
						TEST(units->volume(), 1);
 | 
				
			||||||
	TEST(units->temperature(),1);
 | 
						TEST(units->temperature(), 1);
 | 
				
			||||||
	TEST(units->weight(),1);
 | 
						TEST(units->weight(), 1);
 | 
				
			||||||
	TEST(units->verticalSpeedTime(),1);
 | 
						TEST(units->verticalSpeedTime(), 1);
 | 
				
			||||||
	TEST(units->unitSystem(),QStringLiteral("personalized"));
 | 
						TEST(units->unitSystem(), QStringLiteral("personalized"));
 | 
				
			||||||
	TEST(units->coordinatesTraditional(),true);
 | 
						TEST(units->coordinatesTraditional(), true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto general = pref->general_settings;
 | 
						auto general = pref->general_settings;
 | 
				
			||||||
	general->setDefaultFilename       ("filename");
 | 
						general->setDefaultFilename("filename");
 | 
				
			||||||
	general->setDefaultCylinder       ("cylinder_2");
 | 
						general->setDefaultCylinder("cylinder_2");
 | 
				
			||||||
	//TODOl: Change this to a enum. 	// This is 'undefined', it will need to figure out later between no_file or use_deault file.
 | 
						//TODOl: Change this to a enum. 	// This is 'undefined', it will need to figure out later between no_file or use_deault file.
 | 
				
			||||||
	general->setDefaultFileBehavior   (0);
 | 
						general->setDefaultFileBehavior(0);
 | 
				
			||||||
	general->setDefaultSetPoint       (0);
 | 
						general->setDefaultSetPoint(0);
 | 
				
			||||||
	general->setO2Consumption         (0);
 | 
						general->setO2Consumption(0);
 | 
				
			||||||
	general->setPscrRatio             (0);
 | 
						general->setPscrRatio(0);
 | 
				
			||||||
	general->setUseDefaultFile        (true);
 | 
						general->setUseDefaultFile(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(general->defaultFilename(), QStringLiteral("filename"));
 | 
						TEST(general->defaultFilename(), QStringLiteral("filename"));
 | 
				
			||||||
	TEST(general->defaultCylinder(), QStringLiteral("cylinder_2"));
 | 
						TEST(general->defaultCylinder(), QStringLiteral("cylinder_2"));
 | 
				
			||||||
	TEST(general->defaultFileBehavior(), (short) LOCAL_DEFAULT_FILE); // since we have a default file, here it returns
 | 
						TEST(general->defaultFileBehavior(), (short)LOCAL_DEFAULT_FILE); // since we have a default file, here it returns
 | 
				
			||||||
	TEST(general->defaultSetPoint(), 0);
 | 
						TEST(general->defaultSetPoint(), 0);
 | 
				
			||||||
	TEST(general->o2Consumption(), 0);
 | 
						TEST(general->o2Consumption(), 0);
 | 
				
			||||||
	TEST(general->pscrRatio(), 0);
 | 
						TEST(general->pscrRatio(), 0);
 | 
				
			||||||
	TEST(general->useDefaultFile(), true);
 | 
						TEST(general->useDefaultFile(), true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	general->setDefaultFilename       ("no_file_name");
 | 
						general->setDefaultFilename("no_file_name");
 | 
				
			||||||
	general->setDefaultCylinder       ("cylinder_1");
 | 
						general->setDefaultCylinder("cylinder_1");
 | 
				
			||||||
	//TODOl: Change this to a enum.
 | 
						//TODOl: Change this to a enum.
 | 
				
			||||||
	general->setDefaultFileBehavior   (CLOUD_DEFAULT_FILE);
 | 
						general->setDefaultFileBehavior(CLOUD_DEFAULT_FILE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	general->setDefaultSetPoint       (1);
 | 
						general->setDefaultSetPoint(1);
 | 
				
			||||||
	general->setO2Consumption         (1);
 | 
						general->setO2Consumption(1);
 | 
				
			||||||
	general->setPscrRatio             (1);
 | 
						general->setPscrRatio(1);
 | 
				
			||||||
	general->setUseDefaultFile        (false);
 | 
						general->setUseDefaultFile(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(general->defaultFilename(), QStringLiteral("no_file_name"));
 | 
						TEST(general->defaultFilename(), QStringLiteral("no_file_name"));
 | 
				
			||||||
	TEST(general->defaultCylinder(), QStringLiteral("cylinder_1"));
 | 
						TEST(general->defaultCylinder(), QStringLiteral("cylinder_1"));
 | 
				
			||||||
	TEST(general->defaultFileBehavior(), (short) CLOUD_DEFAULT_FILE);
 | 
						TEST(general->defaultFileBehavior(), (short)CLOUD_DEFAULT_FILE);
 | 
				
			||||||
	TEST(general->defaultSetPoint(), 1);
 | 
						TEST(general->defaultSetPoint(), 1);
 | 
				
			||||||
	TEST(general->o2Consumption(), 1);
 | 
						TEST(general->o2Consumption(), 1);
 | 
				
			||||||
	TEST(general->pscrRatio(), 1);
 | 
						TEST(general->pscrRatio(), 1);
 | 
				
			||||||
	TEST(general->useDefaultFile(), false);
 | 
						TEST(general->useDefaultFile(), false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto language = pref->language_settings;
 | 
						auto language = pref->language_settings;
 | 
				
			||||||
	language->setLangLocale         ("en_US");
 | 
						language->setLangLocale("en_US");
 | 
				
			||||||
	language->setLanguage           ("en");
 | 
						language->setLanguage("en");
 | 
				
			||||||
	language->setTimeFormat         ("hh:mm");
 | 
						language->setTimeFormat("hh:mm");
 | 
				
			||||||
	language->setDateFormat         ("dd/mm/yy");
 | 
						language->setDateFormat("dd/mm/yy");
 | 
				
			||||||
	language->setDateFormatShort    ("dd/mm");
 | 
						language->setDateFormatShort("dd/mm");
 | 
				
			||||||
	language->setTimeFormatOverride (false);
 | 
						language->setTimeFormatOverride(false);
 | 
				
			||||||
	language->setDateFormatOverride (false);
 | 
						language->setDateFormatOverride(false);
 | 
				
			||||||
	language->setUseSystemLanguage  (false);
 | 
						language->setUseSystemLanguage(false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(language->langLocale(), QStringLiteral("en_US"));
 | 
						TEST(language->langLocale(), QStringLiteral("en_US"));
 | 
				
			||||||
	TEST(language->language(), QStringLiteral("en"));
 | 
						TEST(language->language(), QStringLiteral("en"));
 | 
				
			||||||
| 
						 | 
					@ -416,22 +416,22 @@ void TestPreferences::testPreferences()
 | 
				
			||||||
	TEST(language->dateFormatOverride(), false);
 | 
						TEST(language->dateFormatOverride(), false);
 | 
				
			||||||
	TEST(language->useSystemLanguage(), false);
 | 
						TEST(language->useSystemLanguage(), false);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	language->setLangLocale         ("en_EN");
 | 
						language->setLangLocale("en_EN");
 | 
				
			||||||
	language->setLanguage           ("br");
 | 
						language->setLanguage("br");
 | 
				
			||||||
	language->setTimeFormat         ("mm:hh");
 | 
						language->setTimeFormat("mm:hh");
 | 
				
			||||||
	language->setDateFormat         ("yy/mm/dd");
 | 
						language->setDateFormat("yy/mm/dd");
 | 
				
			||||||
	language->setDateFormatShort    ("dd/yy");
 | 
						language->setDateFormatShort("dd/yy");
 | 
				
			||||||
	language->setTimeFormatOverride (true);
 | 
						language->setTimeFormatOverride(true);
 | 
				
			||||||
	language->setDateFormatOverride (true);
 | 
						language->setDateFormatOverride(true);
 | 
				
			||||||
	language->setUseSystemLanguage  (true);
 | 
						language->setUseSystemLanguage(true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	TEST(language->langLocale(), QStringLiteral("en_EN"));
 | 
						TEST(language->langLocale(), QStringLiteral("en_EN"));
 | 
				
			||||||
	TEST(language->language(), QStringLiteral("br"));
 | 
						TEST(language->language(), QStringLiteral("br"));
 | 
				
			||||||
	TEST(language->timeFormat(), QStringLiteral("mm:hh"));
 | 
						TEST(language->timeFormat(), QStringLiteral("mm:hh"));
 | 
				
			||||||
	TEST(language->dateFormat(), QStringLiteral("yy/mm/dd"));
 | 
						TEST(language->dateFormat(), QStringLiteral("yy/mm/dd"));
 | 
				
			||||||
	TEST(language->dateFormatShort(), QStringLiteral("dd/yy"));
 | 
						TEST(language->dateFormatShort(), QStringLiteral("dd/yy"));
 | 
				
			||||||
	TEST(language->timeFormatOverride(),true);
 | 
						TEST(language->timeFormatOverride(), true);
 | 
				
			||||||
	TEST(language->dateFormatOverride(),true);
 | 
						TEST(language->dateFormatOverride(), true);
 | 
				
			||||||
	TEST(language->useSystemLanguage(), true);
 | 
						TEST(language->useSystemLanguage(), true);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto location = pref->location_settings;
 | 
						auto location = pref->location_settings;
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,8 +5,7 @@
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
#include <functional>
 | 
					#include <functional>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestPreferences : public QObject
 | 
					class TestPreferences : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -5,7 +5,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestProfile : public QObject{
 | 
					class TestProfile : public QObject {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void testRedCeiling();
 | 
						void testRedCeiling();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testqPrefAnimations.h"
 | 
					#include "testqPrefAnimations.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings/qPref.h"
 | 
					 | 
				
			||||||
#include "core/pref.h"
 | 
					#include "core/pref.h"
 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/settings/qPref.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDate>
 | 
					#include <QDate>
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
| 
						 | 
					@ -39,7 +39,7 @@ void TestQPrefAnimations::test_set_struct()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefAnimations::test_set_load_struct()
 | 
					void TestQPrefAnimations::test_set_load_struct()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	// test set func -> load -> struct pref 
 | 
						// test set func -> load -> struct pref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto tst = qPrefAnimations::instance();
 | 
						auto tst = qPrefAnimations::instance();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QObject>
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestQPrefAnimations : public QObject
 | 
					class TestQPrefAnimations : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testqPrefCloudStorage.h"
 | 
					#include "testqPrefCloudStorage.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings/qPref.h"
 | 
					 | 
				
			||||||
#include "core/pref.h"
 | 
					#include "core/pref.h"
 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/settings/qPref.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -48,7 +48,6 @@ void TestQPrefCloudStorage::test_struct_get()
 | 
				
			||||||
	QCOMPARE(tst->save_password_local(), prefs.save_password_local);
 | 
						QCOMPARE(tst->save_password_local(), prefs.save_password_local);
 | 
				
			||||||
	QCOMPARE(tst->save_userid_local(), prefs.save_userid_local);
 | 
						QCOMPARE(tst->save_userid_local(), prefs.save_userid_local);
 | 
				
			||||||
	QCOMPARE(tst->userid(), QString(prefs.userid));
 | 
						QCOMPARE(tst->userid(), QString(prefs.userid));
 | 
				
			||||||
 | 
					 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefCloudStorage::test_set_struct()
 | 
					void TestQPrefCloudStorage::test_set_struct()
 | 
				
			||||||
| 
						 | 
					@ -88,7 +87,7 @@ void TestQPrefCloudStorage::test_set_struct()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefCloudStorage::test_set_load_struct()
 | 
					void TestQPrefCloudStorage::test_set_load_struct()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	// test set func -> load -> struct pref 
 | 
						// test set func -> load -> struct pref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto tst = qPrefCloudStorage::instance();
 | 
						auto tst = qPrefCloudStorage::instance();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -206,11 +205,11 @@ void TestQPrefCloudStorage::test_multiple()
 | 
				
			||||||
	QCOMPARE(tst->cloud_timeout(), tst_direct->cloud_timeout());
 | 
						QCOMPARE(tst->cloud_timeout(), tst_direct->cloud_timeout());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TEST(METHOD, VALUE) \
 | 
					#define TEST(METHOD, VALUE)      \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE); \
 | 
						QCOMPARE(METHOD, VALUE); \
 | 
				
			||||||
cloud->sync(); \
 | 
						cloud->sync();           \
 | 
				
			||||||
cloud->load(); \
 | 
						cloud->load();           \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE);
 | 
						QCOMPARE(METHOD, VALUE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefCloudStorage::test_oldPreferences()
 | 
					void TestQPrefCloudStorage::test_oldPreferences()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QObject>
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestQPrefCloudStorage : public QObject
 | 
					class TestQPrefCloudStorage : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testqPrefDisplay.h"
 | 
					#include "testqPrefDisplay.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings/qPref.h"
 | 
					 | 
				
			||||||
#include "core/pref.h"
 | 
					#include "core/pref.h"
 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/settings/qPref.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QDate>
 | 
					#include <QDate>
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
| 
						 | 
					@ -25,7 +25,7 @@ void TestQPrefDisplay::test_struct_get()
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("comic");
 | 
						prefs.divelist_font = copy_qstring("comic");
 | 
				
			||||||
	prefs.font_size = 12.0;
 | 
						prefs.font_size = 12.0;
 | 
				
			||||||
	prefs.show_developer = false;
 | 
						prefs.show_developer = false;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme");
 | 
						prefs.theme = copy_qstring("myTheme");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(display->display_invalid_dives(), prefs.display_invalid_dives);
 | 
						QCOMPARE(display->display_invalid_dives(), prefs.display_invalid_dives);
 | 
				
			||||||
	QCOMPARE(display->divelist_font(), QString(prefs.divelist_font));
 | 
						QCOMPARE(display->divelist_font(), QString(prefs.divelist_font));
 | 
				
			||||||
| 
						 | 
					@ -44,7 +44,7 @@ void TestQPrefDisplay::test_set_struct()
 | 
				
			||||||
	display->set_divelist_font("doNotCareAtAll");
 | 
						display->set_divelist_font("doNotCareAtAll");
 | 
				
			||||||
	display->set_font_size(12.0);
 | 
						display->set_font_size(12.0);
 | 
				
			||||||
	display->set_show_developer(false);
 | 
						display->set_show_developer(false);
 | 
				
			||||||
 	display->set_theme("myTheme");
 | 
						display->set_theme("myTheme");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(prefs.display_invalid_dives, true);
 | 
						QCOMPARE(prefs.display_invalid_dives, true);
 | 
				
			||||||
	QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
 | 
						QCOMPARE(prefs.divelist_font, "doNotCareAtAll");
 | 
				
			||||||
| 
						 | 
					@ -55,7 +55,7 @@ void TestQPrefDisplay::test_set_struct()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefDisplay::test_set_load_struct()
 | 
					void TestQPrefDisplay::test_set_load_struct()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	// test set func -> load -> struct pref 
 | 
						// test set func -> load -> struct pref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto display = qPrefDisplay::instance();
 | 
						auto display = qPrefDisplay::instance();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -63,13 +63,13 @@ void TestQPrefDisplay::test_set_load_struct()
 | 
				
			||||||
	display->set_divelist_font("doNotCareString");
 | 
						display->set_divelist_font("doNotCareString");
 | 
				
			||||||
	display->set_font_size(15.0);
 | 
						display->set_font_size(15.0);
 | 
				
			||||||
	display->set_show_developer(true);
 | 
						display->set_show_developer(true);
 | 
				
			||||||
 	display->set_theme("myTheme2");
 | 
						display->set_theme("myTheme2");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	prefs.display_invalid_dives = true;
 | 
						prefs.display_invalid_dives = true;
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("doNotCareAtAll");
 | 
						prefs.divelist_font = copy_qstring("doNotCareAtAll");
 | 
				
			||||||
	prefs.font_size = 12.0;
 | 
						prefs.font_size = 12.0;
 | 
				
			||||||
	prefs.show_developer = false;
 | 
						prefs.show_developer = false;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme");
 | 
						prefs.theme = copy_qstring("myTheme");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	display->load();
 | 
						display->load();
 | 
				
			||||||
	QCOMPARE(prefs.display_invalid_dives, false);
 | 
						QCOMPARE(prefs.display_invalid_dives, false);
 | 
				
			||||||
| 
						 | 
					@ -89,14 +89,14 @@ void TestQPrefDisplay::test_struct_disk()
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("doNotCareAtAll");
 | 
						prefs.divelist_font = copy_qstring("doNotCareAtAll");
 | 
				
			||||||
	prefs.font_size = 17.0;
 | 
						prefs.font_size = 17.0;
 | 
				
			||||||
	prefs.show_developer = false;
 | 
						prefs.show_developer = false;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme3");
 | 
						prefs.theme = copy_qstring("myTheme3");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	display->sync();
 | 
						display->sync();
 | 
				
			||||||
	prefs.display_invalid_dives = false;
 | 
						prefs.display_invalid_dives = false;
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("noString");
 | 
						prefs.divelist_font = copy_qstring("noString");
 | 
				
			||||||
	prefs.font_size = 11.0;
 | 
						prefs.font_size = 11.0;
 | 
				
			||||||
	prefs.show_developer = true;
 | 
						prefs.show_developer = true;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme");
 | 
						prefs.theme = copy_qstring("myTheme");
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	display->load();
 | 
						display->load();
 | 
				
			||||||
	QCOMPARE(prefs.display_invalid_dives, true);
 | 
						QCOMPARE(prefs.display_invalid_dives, true);
 | 
				
			||||||
| 
						 | 
					@ -114,14 +114,14 @@ void TestQPrefDisplay::test_multiple()
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("comic");
 | 
						prefs.divelist_font = copy_qstring("comic");
 | 
				
			||||||
	prefs.font_size = 11.0;
 | 
						prefs.font_size = 11.0;
 | 
				
			||||||
	prefs.show_developer = true;
 | 
						prefs.show_developer = true;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme");
 | 
						prefs.theme = copy_qstring("myTheme");
 | 
				
			||||||
	auto display_direct = new qPrefDisplay;
 | 
						auto display_direct = new qPrefDisplay;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	prefs.display_invalid_dives = true;
 | 
						prefs.display_invalid_dives = true;
 | 
				
			||||||
	prefs.divelist_font = copy_qstring("multipleCharsInString");
 | 
						prefs.divelist_font = copy_qstring("multipleCharsInString");
 | 
				
			||||||
	prefs.font_size = 15.0;
 | 
						prefs.font_size = 15.0;
 | 
				
			||||||
	prefs.show_developer = false;
 | 
						prefs.show_developer = false;
 | 
				
			||||||
 	prefs.theme = copy_qstring("myTheme8");
 | 
						prefs.theme = copy_qstring("myTheme8");
 | 
				
			||||||
	auto display = qPrefDisplay::instance();
 | 
						auto display = qPrefDisplay::instance();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	QCOMPARE(display->display_invalid_dives(), display_direct->display_invalid_dives());
 | 
						QCOMPARE(display->display_invalid_dives(), display_direct->display_invalid_dives());
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QObject>
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestQPrefDisplay : public QObject
 | 
					class TestQPrefDisplay : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void initTestCase();
 | 
						void initTestCase();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,9 +1,9 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testqPrefDiveComputer.h"
 | 
					#include "testqPrefDiveComputer.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings/qPref.h"
 | 
					 | 
				
			||||||
#include "core/pref.h"
 | 
					#include "core/pref.h"
 | 
				
			||||||
#include "core/qthelper.h"
 | 
					#include "core/qthelper.h"
 | 
				
			||||||
 | 
					#include "core/settings/qPref.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QTest>
 | 
					#include <QTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -54,7 +54,7 @@ void TestQPrefDiveComputer::test_set_struct()
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefDiveComputer::test_set_load_struct()
 | 
					void TestQPrefDiveComputer::test_set_load_struct()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
	// test set func -> load -> struct pref 
 | 
						// test set func -> load -> struct pref
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	auto tst = qPrefDiveComputer::instance();
 | 
						auto tst = qPrefDiveComputer::instance();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -120,11 +120,11 @@ void TestQPrefDiveComputer::test_multiple()
 | 
				
			||||||
	QCOMPARE(tst->download_mode(), tst_direct->download_mode());
 | 
						QCOMPARE(tst->download_mode(), tst_direct->download_mode());
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#define TEST(METHOD, VALUE) \
 | 
					#define TEST(METHOD, VALUE)      \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE); \
 | 
						QCOMPARE(METHOD, VALUE); \
 | 
				
			||||||
dc->sync(); \
 | 
						dc->sync();              \
 | 
				
			||||||
dc->load(); \
 | 
						dc->load();              \
 | 
				
			||||||
QCOMPARE(METHOD, VALUE);
 | 
						QCOMPARE(METHOD, VALUE);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestQPrefDiveComputer::test_oldPreferences()
 | 
					void TestQPrefDiveComputer::test_oldPreferences()
 | 
				
			||||||
{
 | 
					{
 | 
				
			||||||
| 
						 | 
					@ -152,4 +152,3 @@ void TestQPrefDiveComputer::test_oldPreferences()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
QTEST_MAIN(TestQPrefDiveComputer)
 | 
					QTEST_MAIN(TestQPrefDiveComputer)
 | 
				
			||||||
 | 
					 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QObject>
 | 
					#include <QObject>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestQPrefDiveComputer : public QObject
 | 
					class TestQPrefDiveComputer : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
 | 
					
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,13 +1,12 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
 | 
					#include <QApplication>
 | 
				
			||||||
 | 
					#include <QQmlContext>
 | 
				
			||||||
#include <QQmlEngine>
 | 
					#include <QQmlEngine>
 | 
				
			||||||
#include <QtQuickTest>
 | 
					#include <QtQuickTest>
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
#include <QQmlEngine>
 | 
					 | 
				
			||||||
#include <QQmlContext>
 | 
					 | 
				
			||||||
#include <QApplication>
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "core/settings/qPref.h"
 | 
					 | 
				
			||||||
#include "core/qt-gui.h"
 | 
					#include "core/qt-gui.h"
 | 
				
			||||||
 | 
					#include "core/settings/qPref.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// this is the content of QUICK_TEST_MAIN amended with
 | 
					// this is the content of QUICK_TEST_MAIN amended with
 | 
				
			||||||
// registration of ssrf classes
 | 
					// registration of ssrf classes
 | 
				
			||||||
| 
						 | 
					@ -34,7 +33,7 @@ int main(int argc, char **argv)
 | 
				
			||||||
	// save tst_dir and pass rest to Qt
 | 
						// save tst_dir and pass rest to Qt
 | 
				
			||||||
	const char *tst_dir = argv[1];
 | 
						const char *tst_dir = argv[1];
 | 
				
			||||||
	for (int i = 1; i < argc; i++)
 | 
						for (int i = 1; i < argc; i++)
 | 
				
			||||||
		argv[i] = argv[i+1];
 | 
							argv[i] = argv[i + 1];
 | 
				
			||||||
	argc--;
 | 
						argc--;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Register types
 | 
						// Register types
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1,8 +1,8 @@
 | 
				
			||||||
// SPDX-License-Identifier: GPL-2.0
 | 
					// SPDX-License-Identifier: GPL-2.0
 | 
				
			||||||
#include "testrenumber.h"
 | 
					#include "testrenumber.h"
 | 
				
			||||||
#include "core/dive.h"
 | 
					#include "core/dive.h"
 | 
				
			||||||
#include "core/file.h"
 | 
					 | 
				
			||||||
#include "core/divelist.h"
 | 
					#include "core/divelist.h"
 | 
				
			||||||
 | 
					#include "core/file.h"
 | 
				
			||||||
#include <QTextStream>
 | 
					#include <QTextStream>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void TestRenumber::setup()
 | 
					void TestRenumber::setup()
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,8 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestRenumber : public QObject
 | 
					class TestRenumber : public QObject {
 | 
				
			||||||
{
 | 
					 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void setup();
 | 
						void setup();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -10,15 +10,15 @@ void TestUnitConversion::testUnitConversions()
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(ml_to_cuft(1000), 0.0353147), true);
 | 
						QCOMPARE(IS_FP_SAME(ml_to_cuft(1000), 0.0353147), true);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(cuft_to_l(1), 28.316847), true);
 | 
						QCOMPARE(IS_FP_SAME(cuft_to_l(1), 28.316847), true);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(mm_to_feet(1000), 3.280840), true);
 | 
						QCOMPARE(IS_FP_SAME(mm_to_feet(1000), 3.280840), true);
 | 
				
			||||||
	QCOMPARE(feet_to_mm(1), (long unsigned int) 305);
 | 
						QCOMPARE(feet_to_mm(1), (long unsigned int)305);
 | 
				
			||||||
	QCOMPARE(to_feet((depth_t){ 1000 }), 3);
 | 
						QCOMPARE(to_feet((depth_t){1000}), 3);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(mkelvin_to_C(647000), 373.85), true);
 | 
						QCOMPARE(IS_FP_SAME(mkelvin_to_C(647000), 373.85), true);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(mkelvin_to_F(647000), 704.93), true);
 | 
						QCOMPARE(IS_FP_SAME(mkelvin_to_F(647000), 704.93), true);
 | 
				
			||||||
	QCOMPARE(F_to_mkelvin(704.93), (unsigned long)647000);
 | 
						QCOMPARE(F_to_mkelvin(704.93), (unsigned long)647000);
 | 
				
			||||||
	QCOMPARE(C_to_mkelvin(373.85), (unsigned long)647000);
 | 
						QCOMPARE(C_to_mkelvin(373.85), (unsigned long)647000);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(psi_to_bar(14.6959488), 1.01325), true);
 | 
						QCOMPARE(IS_FP_SAME(psi_to_bar(14.6959488), 1.01325), true);
 | 
				
			||||||
	QCOMPARE(psi_to_mbar(14.6959488), (long)1013);
 | 
						QCOMPARE(psi_to_mbar(14.6959488), (long)1013);
 | 
				
			||||||
	QCOMPARE(to_PSI((pressure_t){ 1013 }), (int)15);
 | 
						QCOMPARE(to_PSI((pressure_t){1013}), (int)15);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(bar_to_atm(1.013), 1.0), true);
 | 
						QCOMPARE(IS_FP_SAME(bar_to_atm(1.013), 1.0), true);
 | 
				
			||||||
	QCOMPARE(IS_FP_SAME(mbar_to_atm(1013), 1.0), true);
 | 
						QCOMPARE(IS_FP_SAME(mbar_to_atm(1013), 1.0), true);
 | 
				
			||||||
	QCOMPARE(mbar_to_PSI(1013), (int)15);
 | 
						QCOMPARE(mbar_to_PSI(1013), (int)15);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -4,7 +4,7 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <QtTest>
 | 
					#include <QtTest>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class TestUnitConversion : public QObject{
 | 
					class TestUnitConversion : public QObject {
 | 
				
			||||||
	Q_OBJECT
 | 
						Q_OBJECT
 | 
				
			||||||
private slots:
 | 
					private slots:
 | 
				
			||||||
	void testUnitConversions();
 | 
						void testUnitConversions();
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue