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 <jani@apache.org>
This commit is contained in:
jan Iversen 2018-09-02 14:35:43 +02:00 committed by Dirk Hohndel
parent d5bbfac6a3
commit 4d57b52062
2 changed files with 15 additions and 15 deletions

View file

@ -93,8 +93,8 @@ struct preferences {
const char *cloud_storage_email_encoded; const char *cloud_storage_email_encoded;
const char *cloud_storage_password; const char *cloud_storage_password;
const char *cloud_storage_pin; const char *cloud_storage_pin;
short cloud_timeout; int cloud_timeout;
short cloud_verification_status; int cloud_verification_status;
bool save_password_local; bool save_password_local;
// ********** DiveComputer ********** // ********** DiveComputer **********
@ -181,8 +181,8 @@ struct preferences {
enum deco_mode display_deco_mode; enum deco_mode display_deco_mode;
bool display_unused_tanks; bool display_unused_tanks;
bool ead; bool ead;
short gfhigh; int gfhigh;
short gflow; int gflow;
bool gf_low_at_maxdepth; bool gf_low_at_maxdepth;
bool hrgraph; bool hrgraph;
bool mod; bool mod;
@ -199,7 +199,7 @@ struct preferences {
bool show_sac; bool show_sac;
bool show_scr_ocpo2; bool show_scr_ocpo2;
bool tankbar; bool tankbar;
short vpmb_conservatism; int vpmb_conservatism;
bool zoomed_plot; bool zoomed_plot;
// ********** Units ********** // ********** Units **********

View file

@ -55,8 +55,8 @@ void TestQPrefTechnicalDetails::test_struct_get()
QCOMPARE(tst->display_deco_mode(), prefs.display_deco_mode); QCOMPARE(tst->display_deco_mode(), prefs.display_deco_mode);
QCOMPARE(tst->display_unused_tanks(), prefs.display_unused_tanks); QCOMPARE(tst->display_unused_tanks(), prefs.display_unused_tanks);
QCOMPARE(tst->ead(), prefs.ead); QCOMPARE(tst->ead(), prefs.ead);
QCOMPARE(tst->gfhigh(), (int)prefs.gfhigh); QCOMPARE(tst->gfhigh(), prefs.gfhigh);
QCOMPARE(tst->gflow(), (int)prefs.gflow); QCOMPARE(tst->gflow(), prefs.gflow);
QCOMPARE(tst->gf_low_at_maxdepth(), prefs.gf_low_at_maxdepth); QCOMPARE(tst->gf_low_at_maxdepth(), prefs.gf_low_at_maxdepth);
QCOMPARE(tst->hrgraph(), prefs.hrgraph); QCOMPARE(tst->hrgraph(), prefs.hrgraph);
QCOMPARE(tst->mod(), prefs.mod); QCOMPARE(tst->mod(), prefs.mod);
@ -72,7 +72,7 @@ void TestQPrefTechnicalDetails::test_struct_get()
QCOMPARE(tst->show_sac(), prefs.show_sac); QCOMPARE(tst->show_sac(), prefs.show_sac);
QCOMPARE(tst->show_scr_ocpo2(), prefs.show_scr_ocpo2); QCOMPARE(tst->show_scr_ocpo2(), prefs.show_scr_ocpo2);
QCOMPARE(tst->tankbar(), prefs.tankbar); 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); 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_deco_mode, RECREATIONAL);
QCOMPARE(prefs.display_unused_tanks, false); QCOMPARE(prefs.display_unused_tanks, false);
QCOMPARE(prefs.ead, false); QCOMPARE(prefs.ead, false);
QCOMPARE((int)prefs.gfhigh, 29); QCOMPARE(prefs.gfhigh, 29);
QCOMPARE((int)prefs.gflow, 24); QCOMPARE(prefs.gflow, 24);
QCOMPARE(prefs.gf_low_at_maxdepth, false); QCOMPARE(prefs.gf_low_at_maxdepth, false);
QCOMPARE(prefs.hrgraph, false); QCOMPARE(prefs.hrgraph, false);
QCOMPARE(prefs.mod, false); QCOMPARE(prefs.mod, false);
@ -134,7 +134,7 @@ void TestQPrefTechnicalDetails::test_set_struct()
QCOMPARE(prefs.show_sac, false); QCOMPARE(prefs.show_sac, false);
QCOMPARE(prefs.show_scr_ocpo2, false); QCOMPARE(prefs.show_scr_ocpo2, false);
QCOMPARE(prefs.tankbar, false); QCOMPARE(prefs.tankbar, false);
QCOMPARE((int)prefs.vpmb_conservatism, 64); QCOMPARE(prefs.vpmb_conservatism, 64);
QCOMPARE(prefs.zoomed_plot, false); QCOMPARE(prefs.zoomed_plot, false);
} }
@ -225,7 +225,7 @@ void TestQPrefTechnicalDetails::test_set_load_struct()
QCOMPARE(prefs.show_sac, true); QCOMPARE(prefs.show_sac, true);
QCOMPARE(prefs.show_scr_ocpo2, true); QCOMPARE(prefs.show_scr_ocpo2, true);
QCOMPARE(prefs.tankbar, true); QCOMPARE(prefs.tankbar, true);
QCOMPARE((int)prefs.vpmb_conservatism, 64); QCOMPARE(prefs.vpmb_conservatism, 64);
QCOMPARE(prefs.zoomed_plot, true); QCOMPARE(prefs.zoomed_plot, true);
} }
@ -300,8 +300,8 @@ void TestQPrefTechnicalDetails::test_struct_disk()
QCOMPARE(prefs.display_deco_mode, BUEHLMANN); QCOMPARE(prefs.display_deco_mode, BUEHLMANN);
QCOMPARE(prefs.display_unused_tanks, true); QCOMPARE(prefs.display_unused_tanks, true);
QCOMPARE(prefs.ead, true); QCOMPARE(prefs.ead, true);
QCOMPARE((int)prefs.gfhigh, 11); QCOMPARE(prefs.gfhigh, 11);
QCOMPARE((int)prefs.gflow, 12); QCOMPARE(prefs.gflow, 12);
QCOMPARE(prefs.gf_low_at_maxdepth, true); QCOMPARE(prefs.gf_low_at_maxdepth, true);
QCOMPARE(prefs.hrgraph, true); QCOMPARE(prefs.hrgraph, true);
QCOMPARE(prefs.mod, true); QCOMPARE(prefs.mod, true);
@ -317,7 +317,7 @@ void TestQPrefTechnicalDetails::test_struct_disk()
QCOMPARE(prefs.show_sac, true); QCOMPARE(prefs.show_sac, true);
QCOMPARE(prefs.show_scr_ocpo2, true); QCOMPARE(prefs.show_scr_ocpo2, true);
QCOMPARE(prefs.tankbar, true); QCOMPARE(prefs.tankbar, true);
QCOMPARE((int)prefs.vpmb_conservatism, 15); QCOMPARE(prefs.vpmb_conservatism, 15);
QCOMPARE(prefs.zoomed_plot, true); QCOMPARE(prefs.zoomed_plot, true);
} }