Beginning of the DiveComputer unittests.

Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2016-09-09 13:32:21 -03:00 committed by Dirk Hohndel
parent 41db8ea219
commit ce838b9982

View file

@ -73,6 +73,22 @@ void TestPreferences::testPreferences()
TEST(cloud->verificationStatus(), (short)0);
cloud->setVerificationStatus(1);
TEST(cloud->verificationStatus(), (short)1);
auto dc = pref->dive_computer_settings;
dc->setDevice("TomazComputer");
TEST(dc->dc_device(), QStringLiteral("TomazComputer"));
dc->setDevice("Deepwater");
TEST(dc->dc_device(), QStringLiteral("Deepwater"));
dc->setDownloadMode(0);
TEST(dc->downloadMode(), 0);
dc->setDownloadMode(1);
TEST(dc->downloadMode(), 1);
dc->setProduct("Thingy1");
TEST(dc->dc_product(), QStringLiteral("Thingy1"));
dc->setProduct("Thingy2");
TEST(dc->dc_product(), QStringLiteral("Thingy2"));
}
QTEST_MAIN(TestPreferences)