aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
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>
2019-10-27Cleanup: remove pointless call to get_unitsGravatar Dirk Hohndel
This simply returns the address of prefs.units. Found by Coverity. Fixes CID 60237 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-08-08Cleanup: move planner/deco related declarations planner/deco.hGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-08-08Cleanup: move error reporting function declarations to errorhelper.hGravatar Berthold Stoeger
Move the declarations of the "report_error()" and "set_error_cb()" functions and the "verbose" variable to errorhelper.h. Thus, error-reporting translation units don't have to import the big dive.h header file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: move trip-related functions into own translation unitGravatar Berthold Stoeger
These functions were spread out over dive.c and divelist.c. Move them into their own file to make all this a bit less monolithic. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-06-19Cleanup: move tag functions into own translation unitGravatar Berthold Stoeger
Make dive.h a bit slimmer. It's only a drop in the bucket - but at least when modifying tag functions not the *whole* application is rebuilt anymore. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-05-15Convert the atmospheric pressure in the Information Tab to an editable fieldGravatar willemferguson
The Information tab shows the atmospheric pressure. Make this value editable and also ensure that changes to it are undo-able. Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
2019-05-12Turn application state into enumGravatar Berthold Stoeger
The application state was encoded in a QByteArray. Thus, there was no compile-time checking. Typos would lead to silent failures. Turn the application state into an enum. Use the enum-class construct, so that the values don't polute the global namespace. Moreover, this makes them strongly typed, i.e. they don't auto-convert to integers. A disadvantage is that the enums now have to be cast to int explicitly when used to index an array. Replace two hash-maps in MainWindow to arrays of fixed sizes. Move the application-state details into their own files. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Dive site: fix merging testsGravatar Berthold Stoeger
The handling of dive site merging changed and therefore the tests have to be adapted. 1) Dive sites are recognized as identical based on their name. Therefore, give the dive sites that should be merged the same name. 2) The dive site id of the first imported dive is kept. Thus, merge and reverse merge produce two different output files. Create a second file reflecting that fact. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Dive sites: prepare for dive site ref-countingGravatar Berthold Stoeger
Add a dive site table to each dive site to keep track of dives that have been added to a dive site. Add two functions to add dives to / remove dives from dive sites. Since dive sites now contain a dive table, the order of includes had to be changed: "divesite.h" now includes "dive.h" and not vice-versa. This caused some include churn. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Cleanup: move parse-function declarations out of "dive.h"Gravatar Berthold Stoeger
Move the declaration of these functions to "file.h" and "parse.h" according to the translation unit they are defined in. Thus, not all users of "dive.h" have to suck in "sqlite3.h". Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Undo: make undo-system dive site-awareGravatar Berthold Stoeger
As opposed to dive trips, dive sites were always directly added to the global table, even on import. Instead, parse the divesites into a distinct table and merge them on import. Currently, this does not do any merging of dive sites, i.e. dive sites are considered as either equal or different. Nevertheless, merging of data should be rather easy to implement and simply follow the code of the dive merging. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Parser: parse into custom dive site tableGravatar Berthold Stoeger
To extend the undo system to dive sites, the importers and downloaders must not parse directly into the global dive site table. Instead, pass a dive_site_table argument to parse into. For now, always pass the global dive_site_table so that this commit should not cause any functional change. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12Dive site: add dive site table parameter to dive site functionsGravatar Berthold Stoeger
To enable undo of dive site functions, it is crucial to work with different dive site tables. Therefore add a dive site table parameter to dive site functions. For now, always pass the global dive site table. Thus, this commit shouldn't alter any functionality. After this change, a simple search for dive_site_table reveals all places where the global dive site table is accessed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-12CMake: move enable_testing() to the top levelGravatar Rolf Eike Beer
This allows calling ctest from the main build directory instead of having to change one level down. As a bonus the unittests now show up in my KDevelop so I can directly run them from the IDE. Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-12tests: use new style syntax to connect QSignalSpyGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-04-04Cleanup: make qPref::registerQML() staticGravatar Berthold Stoeger
This member function does not access any other member of the object. Make it static. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-04Cleanup: remove qPref::canonical_version() and qPref::mobile_version()Gravatar Berthold Stoeger
These two member functions were never used, but cause frequent recompilation of the qPref.cpp file. Remove them for now until their usefulness becomes evident. These were the only functions tested in test_qPref.qml. Therefore remove this test-file. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-03-27CMake: use function instead of macroGravatar Rolf Eike Beer
Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-02-01facebook: remove the featute from the code baseGravatar Lubomir I. Ivanov
Remove from: - unit tests - desktop widgets - preferences - core intergration - cmakefiles - build scripts - icons - docs Also remove the plugins and social network integration. Signed-off-by: Lubomir I. Ivanov <neolit123@gmail.com>
2019-01-19Import: control process_imported_dives() by flagsGravatar Berthold Stoeger
process_imported_dives() takes four boolean parameters. Replace these by flags. This makes the function calls much more descriptive. Morover, it becomes easier to add or remove flags. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>