aboutsummaryrefslogtreecommitdiffstats
path: root/tests/testprofile.cpp
AgeCommit message (Collapse)Author
2021-04-19cloudstorage: adapt testsGravatar Dirk Hohndel
The code assumes that prefs.cloud_base_url is non NULL. Allowing that to be NULL makes no sense during normal operation of the app. Yet, most of the tests don't initialize the prefs at all. Making things worse, if we do correctly initialize the prefs (so as to reasonably approximate the behavior when running the app), things break because some of the reference outputs assume that the prefs are unset. This deserves fixing. For now, simply make sure that cloud_base_url is set for all the tests that try to parse files. Additionally, the semantics how cloud_base_url is saved to disk have changed, so adjust the test for those prefs accordingly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-03-24tests: fix incorrect relative path namesv5.0.0Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2021-03-24Add test for profile in VPMB modeGravatar Robert C. Helling
For some reason, this test seems not to run effectively, at least locally, I had to update the reference file. Added a check that indeed the file to be compared was successfully opened. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-10-24parser: add device_table to parser stateGravatar Berthold Stoeger
If we want to avoid the parsers to directly modify global data, we have to provide a device_table to parse into. This adds such a state and the corresponding function parameters. However, for now this is unused. Adding new parameters is very painful and this commit shows that we urgently need a "struct divelog" collecting all those tables! Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-09-29filter: load filter presets from XML filesGravatar Berthold Stoeger
This is a bit painful: since we don't want to modify the filter presets when the user imports (as opposed to opens) a log, we have to provide a table where the parser stores the presets. Calling the parser is getting quite unwieldy, since many tables are passed. We probably should introduce a structure representing a full log-book at one point, which collects all the things that are saved to the log. Apart from that, this is simply the counterpart to saving to XML. The interpretation of the string data is performed by core functions, not the parser itself to avoid code duplication with the git parser. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2020-05-05Explanatory comment in testprofile.cppGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de>
2020-05-04Add test for profile dataGravatar Robert C. Helling
There was a TestProfile but that was a stub that did not test anything. We have an export function that serialises the profile data (including lots of derived data like deco information and cylinder pressure interpolation). So here is now a simple tests that can detect regressions in the profle. Signed-off-by: Robert C. Helling <helling@atdotde.de>
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-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-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-01-09Parser: add trip_table parameter to parsing functionsGravatar Berthold Stoeger
To allow parsing into arbitrary trip_tables, add the corresponding parameter to the parsing functions and the parser state. Currently, all callers pass the global trip_table so there should be no change in functionality. These arguments will be replaced in subsequent commits. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-08-23Parse: pass dive_table argument to parse_file()Gravatar Berthold Stoeger
To enable undo of divelog-importing it is crucial that parse_file() can parse into arbitrary dive tables. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2017-04-29Add SPDX header to testsGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05Our tests are actually GUILESSGravatar Anton Lundin
Signed-off-by: Anton Lundin <glance@acc.umu.se> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-05Fix compilation with the new folder architectureGravatar Tomaz Canabrava
A few more fixes for things that broke in commit 7be962bfc287 ("Move subsurface-core to core and qt-mobile to mobile-widgets"). [Dirk Hohndel: slightly edited and overlap with Linus' patch removed] Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-17Moved code around to make possible to compile the C part alone.Gravatar Tomaz Canabrava
The C code should be compilable without the need to compile the Gui part, too. This is expecially good for unit testing as we can test all the algorithms without a window appearing out of nowhere. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>