aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2018-07-26Whitespace cleanup testsGravatar Dirk Hohndel
Again, entirely script based. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-07-25tests: add DiveComputer qml test casesGravatar jan Iversen
Add tst_qPrefDiveComputer qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25tests: move DiveComputer test from testpreferencesGravatar jan Iversen
Remove DiveComputer test in testpreferences add the same DiveComputer tests to testqPrefDiveComputer Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25tests: add qPrefDiveComputer testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefDiveComputer work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-25core: activate qPrefDiveComputerGravatar jan Iversen
remove DiveComputer from SettingsObjectWrapper and reference qPrefDiveComputer update files using SettingsObjectWrapper/DiveComputer to use qPrefDiveComputer this activated qPrefDiveComputer and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-21tests: add CloudStorage qml test casesGravatar jan Iversen
Add tst_qPrefCloudStorage qml file to test C++ qml connection Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-21tests: move CloudStorage test from testpreferencesGravatar jan Iversen
Remove CloudStorage test in testpreferences add the same CloudStorage tests to testqPrefCloudStorage Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-21tests: add qPrefCloudStorage testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefCloudStorage work together Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-21core: activate qPrefCloudStorageGravatar jan Iversen
remove CloudStorage from SettingsObjectWrapper and reference qPrefCloudStorage update files using SettingsObjectWrapper/CloudStorage to use qPrefCloudStorage this activated qPrefCloudStorage and removed the similar class from SettingsObjectWrapper. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-18tests: update qPrefAnimations test casesGravatar jan Iversen
remove include of QtTest in header, becaue it is not needed, add include of QObject in header, so moc can generate code. add QTest in cpp file, which replaces QtTest Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-18tests: update qPrefDisplay test casesGravatar jan Iversen
remove include of QtTest in header, becaue it is not needed, add include of QObject in header, so moc can generate code. add QTest in cpp file, which replaces QtTest Change content of strings to test divelist_font to a not normal font name, to ensure less confusion by readers. Remark the old surrounding code accept illegal font names, but correcting this is not covered in this commit. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-18tests: update CMakeLists.txt to incude qPref* in both placesGravatar jan Iversen
Files are listed in 2 places in CMakeLists.txt, update file to secure qPrefAnimations and qPrefDisplay are listed correctly Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: add qPrefAnimations qml testcasesGravatar jan Iversen
add test of qml C++ interface Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: add qPrefAnimations testcasesGravatar jan Iversen
add test cases to secure struct preferences and qPrefAnimations work together remove animation tests from testpreferences Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: make qprefdisplay test fileGravatar jan Iversen
Remove display tests from testpreferences and make a new file Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: add qPrefDisplay qml testcasesGravatar jan Iversen
add test of qml C++ interface Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: add qPrefDisplay testcasesGravatar jan Iversen
remove test macro, split in functions and add test cases the existing test macro does not work because sync() does not save these variables to disk (set* does) Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: make qprefdisplay test fileGravatar jan Iversen
Remove display tests from testpreferences and make a new file Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12core: activate qPrefDisplay in SettingsObjectWrapperGravatar jan Iversen
add the prepared class qPrefDisplay to SettingsObjectWrapper and thereby making it active. As a consequence of the uniform naming standard desktop-widgets/preferences_defaults.cpp and tests/testpreferences.cpp have been updated. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: update testqml to use shared register_qml_types()Gravatar jan Iversen
add subsurface-helper.cpp to TestQML target remove local qmlRegisterType() and add register_qml_types() instead Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: add .gitignore to ignore qmlc filesGravatar jan Iversen
With Qt 5.11 the qml compiler is included and qmlc files created in the same directory as the qml file (at least for the qml test harness). ignore *.qmlc Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-12tests: make qml test harnessGravatar jan Iversen
build a qml test runner that includes ssrf interface The qml test runner allows having qml test files. Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-06tests: make testpreferences.h loadable independent of testdiveGravatar jan Iversen
set #ifdef TESTPREFERENCES in testpreferences.h so it can be loaded with other header files Signed-off-by: Jan Iversen <jani@apache.org>
2018-07-04Dive pictures: remove hashesGravatar Berthold Stoeger
In the last commits, the canonical-to-local filename map was made independent from the image hashes and the location of moved images was based on filename not hashes. The hashes are now in principle unused (except for conversion of old-style local filename lookups). Therefore, remove the hashes in this commit. This makes addition of images distinctly faster. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-07-04Dive pictures: index local file name by canonical filnameGravatar Berthold Stoeger
The connection canonical filename to local filename was done via two maps: 1) canonical filename -> hash 2) hash -> local filename But the local filename was always queried from the canonical filename. Therefore, directly index the former with the latter. On startup, convert the old map to the new one. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-05-14Add planner infra structure for bailoutGravatar Robert C. Helling
Add a divemode column to the planner model and a corresponding field to struct divepoint and fill it in the corresponding functions. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-05-14Core: remove dive.h from files that don't need itGravatar Dirk Hohndel
Of course, quite a few of them indirectly get it through other header files. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-05-14Core: introduce new subsurface-string headerGravatar Dirk Hohndel
First small step to shrinking dive.h. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2018-04-19CSV import: fix setpoint (typo)Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-04-09Change taglist_get_tagstring to support 'unlimited' tag list sizeGravatar Jeremie Guichard
Previous taglist_get_tagstring signature/implementation did not allow handling of cases where inputted buffer could not contain all tags. New implementation allocates buffer based on pre-computed size allowing to insert all tags in the returned string. Added get_taglist_string in qthelper to handle conversion to QString Added TestTagList with tests for taglist_get_tagstring Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2018-03-19CSV import/export: Sort parameter list and add commentGravatar Stefan Fuchs
Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2018-03-14Cleanup: introduce copy_qstring() functionGravatar Berthold Stoeger
strdup(qPrintable(s)) and copy_string(qPrintable(s)) were such common occurrences that they seem worthy of a short helper-function. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-14Cleanup: consistently use qPrintable()Gravatar Berthold Stoeger
Replace constructs of the kind s.toUtf8().data(), s.toUtf8().constData(), s.toLocal8Bit().data(), s.toLocal8Bit.constData() or qUtf8Printable(s) by qPrintable(s). This is concise, consistent and - in principle - more performant than the .data() versions. Sadly, owing to a suboptimal implementation, qPrintable(s) currently is a pessimization compared to s.toUtf8().data(). A fix is scheduled for new Qt versions: https://codereview.qt-project.org/#/c/221331/ Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Remove hash field from picture-structureGravatar Berthold Stoeger
The hash field in the picture-structure was in principle non-operational. It was set on loading, but never actually changed. The authoritative hash comes from the filename->hash map. Therefore, make this explicit by removing the hash field from the picture structure. Instead of filling the picture structure on loading, add the hash directly to the filename->hash map. This is done in the register_hash() function, which does not overwrite old entries. I.e. the local hash has priority over the save-file. This policy might be refined in the future. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Fold add_hash() call into learnHash() functionGravatar Berthold Stoeger
learnHash() was always called in conjunction with add_hash(). The pattern was that a local filename and a hash were connected in the hash-to-filename and the filename-to-hash maps. Then, the original picture-filename or url were registered in the filename-to-hash map. This commit changes learnHash() to take three parameters (original-filename, local-filename and hash) and do all of the above. The new code is simpler because no dummy picture struct has to be generated in DiveListView::loadImageFromURL(). The tests were extended to check for all hash<->filename associations. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-03-05Cleanup: Don't store hash in picture struct in learnHash()Gravatar Berthold Stoeger
learnHash() is called either on a local picture structure [DiveListView::loadImageFromURL()] or on a cloned picture structure [ImageDownloader::saveImage()]. In neither case the picture structure is passed to the frontend. Therefore, storing the new hash in the picture struct is not necessary. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-01-08Parameter size needs to be increased for testGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Update DL7 tests to current importGravatar Miika Turkia
As we now parse dives without profile, we get 2 more dives from the sample log import (3 in total). And naturally also the resulting XML to compare against needs to be updated. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Compare DL7 import to saved conversionGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add test for DL7 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-06Remove cloud_background_sync preferences optionGravatar Berthold Stoeger
The preferences flag cloud_background_sync used to be used heavily in the mobile code, but is not used there anymore. Now, it is accessed only in one place, but does not do what it actually says: If it is off, the remote storage is not synced on save (but will be synced on next load). Syncing on save can also be prevented by unchecking the "Cloud online" menu checkbox. Since the latter seems more logical and general (support for non-cloud remote git repositories), remove the cloud_background_sync option. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-03Fix typo in TestGitStorage: SapleDives -> SampleDivesGravatar Berthold Stoeger
Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-12-03Add tests to read/write "file://..." style local git repositoriesGravatar Berthold Stoeger
Requested-by: Dirk Hohndel <dirk@hohndel.org> Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-27Refactore parse-xml.c into parse.c and parse-xml.cGravatar Miika Turkia
This should help us to move parsing that is not XML related to other files, hopefully making the code cleaner. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Add test for DM5 importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-25Localize global planner stateGravatar Robert C. Helling
For UI responsiveness, we need to be able to run the planner in the background. This needs the planner state to be localized (and we need to pass a pointer around). In order to not let too many lines overrun (and to save typing in the future) I have renamed instances of struct deco_state to ds. Yes this should have gone to a separate commit but I accidentally commit --amend'ed it. Computing of planner variations is temporarily disabled. Unlock the planner when returning early So we don't deadlock in add dive and recreational mode (which use the planner without actually planning). Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-11-20Make handling of booleans consistent on the C++-side of preferencesGravatar Berthold Stoeger
In general, the C++-side of the preferences code consistently uses the bool data type for boolean settings. There are five exceptions, which use short instead: showPo2 showPn2 showPhe saveUserIdLocal displayInvalidDives This patch attempts to make the code more consistent by turning these into bools as well. Tests showed that writing as short and reading as bool is handled gracefully by the Qt variant code. Therefore, an upgrade should not cause user-visible changes to their settings. As a bonus, two extern declarations of the set_save_userid_local() function, which is not defined anywhere, were removed. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-11-12Typo: modp02 -> modpO2Gravatar Berthold Stoeger
Fixes two function names, where O2 was written as 02. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-10-29Remove three obsolete preferences options for geocodingGravatar Stefan Fuchs
These options are not used any longer/were never used and can be removed to not confuse the users. Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-10-01More VPMB state in special structureGravatar Robert C. Helling
... and reset deco information in profile ceiling computation. The planner test then needs to know about the struct holding the deco state. Signed-off-by: Robert C. Helling <helling@atdotde.de>