aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2020-04-24cleanup: move clearing of device nodes to clear_dive_file_data()Gravatar Berthold Stoeger
It makes no sense to keep the device nodes if all the other data is cleared. Let's do this automatically and not explicitly. This ensures that the function is also called on mobile. Currently it was only called on desktop. Weirdly, the parser-tests were expecting that the device nodes were not reset by clear_dive_file_data() and therefore divecomputers were accumulating in the test results. Thus, the additional computers had to be removed from the expected test results. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-04-19desktop: remove user surveyGravatar Dirk Hohndel
We have never made good use of the results. Let's just remove it. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing: re-enable TestGitStorageGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing/git-storage: alternative random number generation for Qt 5.9Gravatar Dirk Hohndel
We still need to support Qt 5.9 for Ubuntu 18.04 / Bionic. This uses deprecated calls to qrand() - but then qrand() wasn't deprecated in 5.9. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-15testing/git-storage: fairly fundamental rewrite of the storage testGravatar Dirk Hohndel
The old test was broken in many ways and kept failing for a number of reasons. Some of them were addressed in the previous commits (the missing HEAD ref being the main one), the other one was that the tests kept stepping on top of each other - as were potentially random users or reviewers using the 'universal' test account. This uses a random one of ten dedicated test accounts, and on top of that uses a random branch name (instead of the fixed email address associated with the account). This also rewrites several of the tests dealing with offline changes to correctly model going offline (but keeps one that directly writes to the local cache). Finally this change also tries to do a much better job cleaning up after itself and not leaving data behind the the next run could stumble over. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-04-10media: move picture function from dive.c to picture.cGravatar Berthold Stoeger
Currently, move only those functions that do not access dive structures. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-31cleanup: don't compile subsurface-helper.cpp for testsGravatar Berthold Stoeger
It is unclear why the subsurface-helper.cpp file was linked with the tests. In any case, it led to comlicated ifdef-ery, so let's remove that for now and readd later if the need arises. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-03-11Grammar: replaces 'indexes' by 'indices'Gravatar Robert C. Helling
Grammar-nazi ran git grep -l 'indexes' | xargs sed -i '' -e 's/indexes/indices/g' to prevent future wincing when reading the source code. Unfortunatly, Qt itself is infected as in QModelIndexList QItemSelection::indexes() const Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-03-09tests: don't build PlannerSharedGravatar Dirk Hohndel
Once we start using the commands on mobile, the dependencies for this test break. And since we have disabled the failed attempt to create a planner for mobile, there's no point running these tests right now. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-02-04Cleanup: rename plannerShared to PlannerSharedGravatar Berthold Stoeger
Usually, we use PascalCase (i.e. camelCase with a capital letter at the start) for class names. For consistency, let's do it here as well. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-31Remove plannerShared::instance()Gravatar Berthold Stoeger
This class contains only static functions (i.e. it does not contain any state). There does not seem to be a reason to have an instance of that class. Therefore, remove the instance() function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-01-26GitHub Actions: disabling TestGitStorage againGravatar Dirk Hohndel
I thought I had it fixed, but we still see a ridiculous number of random, unexplained failures which distract from what we are trying to do with the GitHub Actions. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-25diveplanner: adjust sac-factor calculation.Gravatar jan Iversen
The real values are 1.0 to 10.0, but QML needs int so mobile gets values 10.0 to 100.0 add sacfactor() to QMLInterface and update QML. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25dive planner: correct bottomsac/decosac calc.Gravatar jan Iversen
Move conversion cuft <-> liter from desktop-widget/diveplanner.cpp to plannerShared, to facilitate the same results in mobile diveplanner Use Backend for bottomsac/decosac and update to check for switch LITER <-> CUFT Add bottomsac/decosac to QMLinterface. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-25diveplanner: call planner model directly for simple variables.Gravatar jan Iversen
Variables without conversion, do not need to pass plannerShared (due to the QML interface). Simple variables do not pass plannerShared, but diveplanner in desktop-widgets and qmlinterface in mobile-widgets call the implementation directly. Signed-off-by: jan Iversen <jan@casacondor.com>
2020-01-20backend-shared: remove asc/desc functionsGravatar jan Iversen
Ascent/Descent rate functions are fully implemented in diveplannermodel, therefore remove these functions. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20core/settings:: remove string functions for unitsGravatar jan Iversen
Remove string version of unit_system, duration_units, length, pressure, temperature, vertical_speed_time, and volume, including tests and make signals strongly typed in C++ Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-20core/settings: allow signals to be strongly typed in C++Gravatar jan Iversen
Register enums to allow them to be used in signal handlers instead of int. Signed-off-by: jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: add empty table structuresGravatar Dirk Hohndel
It seemed to make sense to combine all three types in one commit. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-10code cleanup: use setPath to set directoryGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-04Revert "build system: disable TestGitStorage"Gravatar Dirk Hohndel
This reverts commit d0e52140e586e4f9537738177d54400a855b7d2b. TestGitStorage should work again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-02build system: disable TestGitStorageGravatar Dirk Hohndel
While this appears to work fine when tested individually, when running as part of the GitHub actions it causes random failures. This needs to be rethought. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01tests: allow overwriting cloud accountGravatar Dirk Hohndel
TestGitStorage is used in all test runs, which results in occasional errors because two test runs step on each other. This allows us to use different accounts in different runs. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-01tests: refactor TestGitStorageGravatar Dirk Hohndel
It's silly to set up the URL and email in almost every function. Instead do it once at the start and reuse that information. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-31tests: corrected typo in CMakeFiles.txtGravatar jan Iversen
This typo caused that testplannershared was not available in neither desktop nor mobil. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: correct decosac/bottomsac in imperial.Gravatar jan Iversen
The getter returns alwayes in m/1000, making the calculations identical, independent if the system is in Metric or Imperial units. Correct getter test cases. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: correct bestmixend test cases.Gravatar jan Iversen
When unit system Imperial is properly activated, these test cases have wrong values, and thus fail. Use correct values. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-31tests: reactivate test case in testplannersharedGravatar jan Iversen
reactivate deco2 test case, after problem is solved in plannerShared. Also add a commit on bottompo2/decopo2 in imperial mode, that do not use PSI as expected. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29tests: fix TestGitStorage in a mobile buildGravatar Dirk Hohndel
The default behavior of parse_file() is different between a desktop build and a mobile build. This makes parse_file() always assume that it's ok to connect to the cloud. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: correct testplannersharedGravatar jan Iversen
PSI is not implemented for diveplanner Bestmixend in feet is not implemented for diveplanner Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: deactivate testQMLGravatar jan Iversen
Qt 5.13 (and maybe 5.12) introduced new macros for QUICK_TEST_MAIN_WITH_SETUP and as testQML is loosely based on this macro it needs to be redesigned. Before Qt 5.11 it was not possible to do QML testing that depended on classes being registred with the macro QUICK_TEST_MAIN_WITH_SETUP, therefore it was nessecary to make an independent implementation of main(). For now, let the main do a "return 0", to keep the test in the loop. Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix testqPrefDisplayGravatar jan Iversen
Font size are never stored on disk for the mobile version, so testing load/save does not make sense. add #ifndef SUBSURFACE_MOBILE Signed-off-by: Jan Iversen <jan@casacondor.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefLogGravatar Dirk Hohndel
There were several issues with these tests, including checking the value argument against bool values even if the underlying preference isn't bool. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefEquipmentGravatar Dirk Hohndel
When we actually change the value, the argument to the changed signal should be true, not false. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: fix TestQPrefUnitsGravatar Dirk Hohndel
This clearly never was tested. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-28tests: fix cmake syntax confusionGravatar Dirk Hohndel
You cannot have a conditional in the middle of a list. I should have caught this in review. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-29tests: add gas tests for plannerSharedGravatar jan Iversen
Add cases to test gas options. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-29tests: add research values for diveplanning.Gravatar jan Iversen
This commit contains the researched values used for diveplanning, which form the basis for the test cases. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27tests: add test cases plannerShared ratingsGravatar jan Iversen
Add test cases to test ratings variables Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27tests: activate TestPlannerSharedGravatar jan Iversen
Use updated CMakeLists to activate TestPlannerShared but only for mobile builds !! This is due to the fact that commands are currently not available for mobile builds. Using the mobile library version of qt-mobile secured diveplannermodel.cpp is compiled without referencces to commands. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27tests: add framework for plannerShared testGravatar jan Iversen
Add TestPlannerShared test (cpp + h) Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27buildsystem: update tests to include more librariesGravatar jan Iversen
In order to test plannerShared (backend-shared) more libraries are needed. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-12-27core/settings: make qPrefUnit accesable from QMLGravatar jan Iversen
Use string literals to communicate with QML. Instead of passing arounds enum/int value, it seems easier to pass string literals to QML and have that code respond to those Signed-off-by: Jan Iversen <jani@apache.org>
2019-12-25Preferences: add some testsGravatar willemferguson
Write a test program to test the log tab in the preferences main menu I am a bit skeptical about the accuracy of the last section that delas with testing signals. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: add dive log tabGravatar willemferguson
This adds a tab for dive log - related preferences. A suitable test programs is still required. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences: Create a test program for qPrefMediaGravatar willemferguson
This is a companion for the new Media tab in the Preferences UI Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Pereferences UI: add media tabGravatar willemferguson
Remove the preference settings dealing with thumbnails (currently under General preferences and Profile preferences) and put them in a newly-created Media preference tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-25Preferences UI: create new equipment tabGravatar willemferguson
Remove the "Show unused cylinders" checkbox (Profile tab) and the "Set default cylinder" qTextEdit box (General tab) and put them in a separate and new Equipment tab. This sounds like a simple task but, as can be seen from the files changed, was actually a complex matter. Adapt the existing test programs (General and TechDetails) for creating a test program that tests parts of the Equipment tab. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-12-05tests: correct testqPref*.cpp to use static qPref* functions.Gravatar jan Iversen
qPref* set/get functions are static. remove creation of qPref* instances, reference static functions. Signed-off-by: Jan Iversen <jan@casacondor.com>
2019-11-09Core: remove MAX_CYLINDERS restrictionGravatar Berthold Stoeger
Instead of using fixed size arrays, use a new cylinder_table structure. The code copies the weightsystem code, but is significantly more complex because cylinders are such an integral part of the core. Two functions to access the cylinders were added: get_cylinder() and get_or_create_cylinder() The former does a simple array access and supposes that the cylinder exists. The latter is used by the parser(s) and if a cylinder with the given id does not exist, cylinders up to that id are generated. One point will make C programmers cringe: the cylinder structure is passed by value. This is due to the way the table-macros work. A refactoring of the table macros is planned. It has to be noted that the size of a cylinder_t is 64 bytes, i.e. 8 long words on a 64-bit architecture, so passing on the stack is probably not even significantly slower than passing as reference. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>