had the time to finish some patches today, and I also hope to continue
finishing others.
Those tests pass. :D
From 2570b3e1f34322f55ccda938e7ab70c887bef10b Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tcanabr...@kde.org>
Date: Fri, 14 Oct 2016 09:27:46 +0200
Subject: [PATCH 1/2] Finish vendor testing.

Signed-off-by: Tomaz Canabrava <tcanabr...@kde.org>
---
 tests/testpreferences.cpp | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index 14a40cb..f3d00a1 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -89,6 +89,11 @@ void TestPreferences::testPreferences()
 	TEST(dc->dc_product(), QStringLiteral("Thingy1"));
 	dc->setProduct("Thingy2");
 	TEST(dc->dc_product(), QStringLiteral("Thingy2"));
+
+	dc->setVendor("Sharewater");
+	TEST(dc->dc_vendor(), QStringLiteral("Sharewater"));
+	dc->setVendor("OSTS");
+	TEST(dc->dc_vendor(), QStringLiteral("OSTS"));
 }
 
 QTEST_MAIN(TestPreferences)
-- 
2.10.0

From 8bb69ba4e193ff673bc6918944315a7a0b0d8f8d Mon Sep 17 00:00:00 2001
From: Tomaz Canabrava <tcanabr...@kde.org>
Date: Fri, 14 Oct 2016 09:47:19 +0200
Subject: [PATCH 2/2] Test TecDetails.

Biggest test that I created. test all of TecDetails
information. Untested.

Signed-off-by: Tomaz Canabrava <tcanabr...@kde.org>
---
 tests/testpreferences.cpp | 107 ++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 107 insertions(+)

diff --git a/tests/testpreferences.cpp b/tests/testpreferences.cpp
index f3d00a1..b22fb4e 100644
--- a/tests/testpreferences.cpp
+++ b/tests/testpreferences.cpp
@@ -94,6 +94,113 @@ void TestPreferences::testPreferences()
 	TEST(dc->dc_vendor(), QStringLiteral("Sharewater"));
 	dc->setVendor("OSTS");
 	TEST(dc->dc_vendor(), QStringLiteral("OSTS"));
+
+	auto tecDetails = pref->techDetails;
+	tecDetails->setModp02(0.2);
+	TEST(tecDetails->modp02(), 0.2);
+	tecDetails->setModp02(1.0);
+	TEST(tecDetails->modp02(), 1.0);
+
+	tecDetails->setGflow(2);
+	TEST(tecDetails->gflow(), 2);
+	tecDetails->setGflow(3);
+	TEST(tecDetails->gflow(), 3);
+
+	tecDetails->setGfhigh(4);
+	TEST(tecDetails->gfhigh(), 4);
+	tecDetails->setGfhigh(5);
+	TEST(tecDetails->gfhigh(), 5);
+
+	tecDetails->setVpmbConservatism(5);
+	TEST(tecDetails->vpmbConservatism(), (short)5);
+	tecDetails->setVpmbConservatism(6);
+	TEST(tecDetails->vpmbConservatism(), (short)6);
+
+	tecDetails->setEad(true);
+	TEST(tecDetails->ead(), true);
+	tecDetails->setMod(true);
+	TEST(tecDetails->mod(), true);
+	tecDetails->setDCceiling(true);
+	TEST(tecDetails->dcceiling(), true);
+	tecDetails->setRedceiling(true);
+	TEST(tecDetails->redceiling(), true);
+	tecDetails->setCalcceiling(true);
+	TEST(tecDetails->calcceiling(), true);
+	tecDetails->setCalcceiling3m(true);
+	TEST(tecDetails->calcceiling3m(), true);
+	tecDetails->setCalcalltissues(true);
+	TEST(tecDetails->calcalltissues(), true);
+	tecDetails->setCalcndltts(true);
+	TEST(tecDetails->calcndltts(), true);
+	tecDetails->setBuehlmann(true);
+	TEST(tecDetails->buehlmann(), true);
+	tecDetails->setHRgraph(true);
+	TEST(tecDetails->hrgraph(), true);
+	tecDetails->setTankBar(true);
+	TEST(tecDetails->tankBar(), true);
+	tecDetails->setPercentageGraph(true);
+	TEST(tecDetails->percentageGraph(), true);
+	tecDetails->setRulerGraph(true);
+	TEST(tecDetails->rulerGraph(), true);
+	tecDetails->setShowCCRSetpoint(true);
+	TEST(tecDetails->showCCRSetpoint(), true);
+	tecDetails->setShowCCRSensors(true);
+	TEST(tecDetails->showCCRSensors(), true);
+	tecDetails->setZoomedPlot(true);
+	TEST(tecDetails->zoomedPlot(), true);
+	tecDetails->setShowSac(true);
+	TEST(tecDetails->showSac(), true);
+	tecDetails->setGfLowAtMaxDepth(true);
+	TEST(tecDetails->gfLowAtMaxDepth(), true);
+	tecDetails->setDisplayUnusedTanks(true);
+	TEST(tecDetails->displayUnusedTanks(), true);
+	tecDetails->setShowAverageDepth(true);
+	TEST(tecDetails->showAverageDepth(), true);
+	tecDetails->setShowPicturesInProfile(true);
+	TEST(tecDetails->showPicturesInProfile(), true);
+
+	tecDetails->setEad(false);
+	TEST(tecDetails->ead(), false);
+	tecDetails->setMod(false);
+	TEST(tecDetails->mod(), false);
+	tecDetails->setDCceiling(false);
+	TEST(tecDetails->dcceiling(), false);
+	tecDetails->setRedceiling(false);
+	TEST(tecDetails->redceiling(), false);
+	tecDetails->setCalcceiling(false);
+	TEST(tecDetails->calcceiling(), false);
+	tecDetails->setCalcceiling3m(false);
+	TEST(tecDetails->calcceiling3m(), false);
+	tecDetails->setCalcalltissues(false);
+	TEST(tecDetails->calcalltissues(), false);
+	tecDetails->setCalcndltts(false);
+	TEST(tecDetails->calcndltts(), false);
+	tecDetails->setBuehlmann(false);
+	TEST(tecDetails->buehlmann(), false);
+	tecDetails->setHRgraph(false);
+	TEST(tecDetails->hrgraph(), false);
+	tecDetails->setTankBar(false);
+	TEST(tecDetails->tankBar(), false);
+	tecDetails->setPercentageGraph(false);
+	TEST(tecDetails->percentageGraph(), false);
+	tecDetails->setRulerGraph(false);
+	TEST(tecDetails->rulerGraph(), false);
+	tecDetails->setShowCCRSetpoint(false);
+	TEST(tecDetails->showCCRSetpoint(), false);
+	tecDetails->setShowCCRSensors(false);
+	TEST(tecDetails->showCCRSensors(), false);
+	tecDetails->setZoomedPlot(false);
+	TEST(tecDetails->zoomedPlot(), false);
+	tecDetails->setShowSac(false);
+	TEST(tecDetails->showSac(), false);
+	tecDetails->setGfLowAtMaxDepth(false);
+	TEST(tecDetails->gfLowAtMaxDepth(), false);
+	tecDetails->setDisplayUnusedTanks(false);
+	TEST(tecDetails->displayUnusedTanks(), false);
+	tecDetails->setShowAverageDepth(false);
+	TEST(tecDetails->showAverageDepth(), false);
+	tecDetails->setShowPicturesInProfile(false);
+	TEST(tecDetails->showPicturesInProfile(), false);
 }
 
 QTEST_MAIN(TestPreferences)
-- 
2.10.0

_______________________________________________
subsurface mailing list
subsurface@subsurface-divelog.org
http://lists.subsurface-divelog.org/cgi-bin/mailman/listinfo/subsurface

Reply via email to