From 4d57b52062ab902dee8d82e453eda586ce78ab3e Mon Sep 17 00:00:00 2001 From: jan Iversen Date: Sun, 2 Sep 2018 14:35:43 +0200 Subject: core/tests: change short to int in pref.h Simplify structure preferences by removing short. Update test cases to not do (int). Signed-off-by: Jan Iversen --- core/pref.h | 10 +++++----- tests/testqPrefTechnicalDetails.cpp | 20 ++++++++++---------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/core/pref.h b/core/pref.h index 86636b878..4db6d0e40 100644 --- a/core/pref.h +++ b/core/pref.h @@ -93,8 +93,8 @@ struct preferences { const char *cloud_storage_email_encoded; const char *cloud_storage_password; const char *cloud_storage_pin; - short cloud_timeout; - short cloud_verification_status; + int cloud_timeout; + int cloud_verification_status; bool save_password_local; // ********** DiveComputer ********** @@ -181,8 +181,8 @@ struct preferences { enum deco_mode display_deco_mode; bool display_unused_tanks; bool ead; - short gfhigh; - short gflow; + int gfhigh; + int gflow; bool gf_low_at_maxdepth; bool hrgraph; bool mod; @@ -199,7 +199,7 @@ struct preferences { bool show_sac; bool show_scr_ocpo2; bool tankbar; - short vpmb_conservatism; + int vpmb_conservatism; bool zoomed_plot; // ********** Units ********** diff --git a/tests/testqPrefTechnicalDetails.cpp b/tests/testqPrefTechnicalDetails.cpp index 5f3fb4477..328541102 100644 --- a/tests/testqPrefTechnicalDetails.cpp +++ b/tests/testqPrefTechnicalDetails.cpp @@ -55,8 +55,8 @@ void TestQPrefTechnicalDetails::test_struct_get() QCOMPARE(tst->display_deco_mode(), prefs.display_deco_mode); QCOMPARE(tst->display_unused_tanks(), prefs.display_unused_tanks); QCOMPARE(tst->ead(), prefs.ead); - QCOMPARE(tst->gfhigh(), (int)prefs.gfhigh); - QCOMPARE(tst->gflow(), (int)prefs.gflow); + QCOMPARE(tst->gfhigh(), prefs.gfhigh); + QCOMPARE(tst->gflow(), prefs.gflow); QCOMPARE(tst->gf_low_at_maxdepth(), prefs.gf_low_at_maxdepth); QCOMPARE(tst->hrgraph(), prefs.hrgraph); QCOMPARE(tst->mod(), prefs.mod); @@ -72,7 +72,7 @@ void TestQPrefTechnicalDetails::test_struct_get() QCOMPARE(tst->show_sac(), prefs.show_sac); QCOMPARE(tst->show_scr_ocpo2(), prefs.show_scr_ocpo2); QCOMPARE(tst->tankbar(), prefs.tankbar); - QCOMPARE(tst->vpmb_conservatism(), (int)prefs.vpmb_conservatism); + QCOMPARE(tst->vpmb_conservatism(), prefs.vpmb_conservatism); QCOMPARE(tst->zoomed_plot(), prefs.zoomed_plot); } @@ -117,8 +117,8 @@ void TestQPrefTechnicalDetails::test_set_struct() QCOMPARE(prefs.display_deco_mode, RECREATIONAL); QCOMPARE(prefs.display_unused_tanks, false); QCOMPARE(prefs.ead, false); - QCOMPARE((int)prefs.gfhigh, 29); - QCOMPARE((int)prefs.gflow, 24); + QCOMPARE(prefs.gfhigh, 29); + QCOMPARE(prefs.gflow, 24); QCOMPARE(prefs.gf_low_at_maxdepth, false); QCOMPARE(prefs.hrgraph, false); QCOMPARE(prefs.mod, false); @@ -134,7 +134,7 @@ void TestQPrefTechnicalDetails::test_set_struct() QCOMPARE(prefs.show_sac, false); QCOMPARE(prefs.show_scr_ocpo2, false); QCOMPARE(prefs.tankbar, false); - QCOMPARE((int)prefs.vpmb_conservatism, 64); + QCOMPARE(prefs.vpmb_conservatism, 64); QCOMPARE(prefs.zoomed_plot, false); } @@ -225,7 +225,7 @@ void TestQPrefTechnicalDetails::test_set_load_struct() QCOMPARE(prefs.show_sac, true); QCOMPARE(prefs.show_scr_ocpo2, true); QCOMPARE(prefs.tankbar, true); - QCOMPARE((int)prefs.vpmb_conservatism, 64); + QCOMPARE(prefs.vpmb_conservatism, 64); QCOMPARE(prefs.zoomed_plot, true); } @@ -300,8 +300,8 @@ void TestQPrefTechnicalDetails::test_struct_disk() QCOMPARE(prefs.display_deco_mode, BUEHLMANN); QCOMPARE(prefs.display_unused_tanks, true); QCOMPARE(prefs.ead, true); - QCOMPARE((int)prefs.gfhigh, 11); - QCOMPARE((int)prefs.gflow, 12); + QCOMPARE(prefs.gfhigh, 11); + QCOMPARE(prefs.gflow, 12); QCOMPARE(prefs.gf_low_at_maxdepth, true); QCOMPARE(prefs.hrgraph, true); QCOMPARE(prefs.mod, true); @@ -317,7 +317,7 @@ void TestQPrefTechnicalDetails::test_struct_disk() QCOMPARE(prefs.show_sac, true); QCOMPARE(prefs.show_scr_ocpo2, true); QCOMPARE(prefs.tankbar, true); - QCOMPARE((int)prefs.vpmb_conservatism, 15); + QCOMPARE(prefs.vpmb_conservatism, 15); QCOMPARE(prefs.zoomed_plot, true); } -- cgit v1.2.3-70-g09d2