summaryrefslogtreecommitdiffstats
path: root/dives
AgeCommit message (Collapse)Author
2020-05-14Save SAC, OTU and CNS in the XML exportGravatar Linus Torvalds
We do _not_ read them back, since they are calculated values, although I guess we could aim to do that too at some point in case we have an import from somewhere else that has these values but not the profile (or gas use) to actually calculate them. Fix test-cases that are checked by TestParse (but nothing else) to match. Requested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
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>
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-02-09Correct celcius/celsius typo in test divesGravatar Jason Bramwell
Corrected typos in three files: dives/Test.csv dives/TestComma.csv dives/APDLogViewer.csv Simply replaced the word celcius with celsius. Signed-off-by: Jason Bramwell <jb2cool@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2020-01-24Desktop: Import gps coordinates: test filesGravatar willemferguson
These are test files enabling a test of the import of dive coordinates from GPS Signed-off-by: willemferguson <willemferguson@zoology.up.ac.za>
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-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 site: make UUID generation deterministicGravatar Berthold Stoeger
Instead of using a random UUID, use an SHA1 hash of name, description and notes (if defined). This is necessary for testing. Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2018-10-30Fixed get_gas_at_time for equal timesGravatar Robert C. Helling
This fixes a subtle bug introduced in 5c4569247a31c which unified two functions finding the gasmix at a given time during the dive. There was a slight difference, though: Does a gaschange exactly at that time count or not? For the planner to work, the answer has to be in the affirmative. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2018-04-07Update DM5 test dataGravatar Miika Turkia
Now that we read the temperatures properly, the test comparison must also include them. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add water temperature to test diveGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Update latests changes to test diveGravatar 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-08Add converted DL7 file for test validationGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08Add two dive headers to DL7 sampleGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2018-01-08DL7/zxu sample diveGravatar Miika Turkia
Manually crafted sample dive demonstrating parts of the DL7 format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Fix test parsing as new DC appears in the XML filesGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Add imported version of DM5 test diveGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-11-27Test dives in DM5 database formatGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-10-07Fix divinglog import temperature truncationGravatar Linus Torvalds
The code incorrectly divided the temperature by 10 as an integer, causing unnecessary precision loss due to truncation. Fix it, and update the test results for the now improved temperature import. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-07-24Fix TestParse to handle CCR import properlyGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-07-23Fix comparison data for TestParseGravatar Miika Turkia
It appears that we used to get additional tts=0:00min tags on Seabear parsing. I would assume these to be incorrect as there other values right before these that look more sensible. Also the resent change to streamline the feature of not storing repeating values causes the test to fail. Anyway, just grabbing the new result to compare with as it seems sensible. Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07Include some extradata info on Seabear importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-07Merge branch 'seabear-refactor'Gravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-05-07Update Seabear test data to use proper timesGravatar Miika Turkia
Now that we parse them... Signed-off-by: Miika Turkia <miika.turkia@gmail.com>
2017-05-06Test for adding a picture with data after JFIF EOI to a diveGravatar Stefan Fuchs
Add one more picture to the already existing test. This new picture is a JPEG and has data after JFIF EOI tag. Suggested-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de> Signed-off-by: Stefan Fuchs <sfuchs@gmx.de>
2017-03-09Fix potential double/float to int rounding errorsGravatar Jeremie Guichard
Not using lrint(f) when converting double/float to int creates rounding errors. This error was detected by TestParse::testParseDM4 failure on Windows. It was creating rounding inconsistencies on Linux too, see change in TestDiveDM4.xml. Enable -Wfloat-conversion for gcc version greater than 4.9.0 Signed-off-by: Jeremie Guichard <djebrest@gmail.com>
2017-02-21Simple test case for merging divesGravatar Dirk Hohndel
We do some merging in a couple of the other tests as well, but the idea is to have specific test cases that exercise our merge logic. This one starts simple. Merge a dive with some valid info with a second one that has less data filled. And then try it in both possible orders. It shows a few potential problems. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-21Test for basic image handlingGravatar Robert C. Helling
This tests adding image files to dives including hashing and evaluating exif data. Signed-off-by: Robert C. Helling <helling@atdotde.de>
2017-02-09Add test for merging multiple cylindersGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2017-02-05TestParse: adjust reference outputGravatar Dirk Hohndel
Things have changed a bit in how we store data. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-04-29Fix Qt date interfaces for times before 1970Gravatar Linus Torvalds
This seems to work around the crazy QDateTime::fromTime_t() problem in Qt. It is *very* lightly tested. In fact, the only test is that "test0.xml" change that is part of this patch. Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-12SmartTrak import - Add example divelog fileGravatar Salvador Cuñat
This is the example divelog shipped with Subgear products (OEMs for Scubapro/Uwatec), just changed the name to be meaningful for the reader of the dives directory. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Add missing XML files for TestRenumberGravatar Dirk Hohndel
Oops. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-04Adjust expected output for TestParseGravatar Dirk Hohndel
With commit b26e516e2aff ("Dive_sites-Notes shouldn't be stored as attribute") our output format changed slightly. Adjust the expected output to match that change to ensure that TestParse passes again. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-01Test case: fix Seabear test data to proper dive lengthGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-13Test case: control log for DLD importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30Add test for dive site duplication bugGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Test dives for Seabear new format import comparisonGravatar Miika Turkia
This file contains imported dives from Seabear H3 and T1 dive computers. It is used for validating Seaber import from new file format. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Test dives for Seabear new formatGravatar Miika Turkia
These are test dives for Seabear H3 and T1 dive computers received from Seabear Diving Technology. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27Test dive for Seabear HUDC import comparisonGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26Test dive for DM4 import comparisonGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-24Create test case for DivingLog SQLite importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-13Divinglog test diveGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-06-11Add a more complex sample diveGravatar Dirk Hohndel
This includes trips, dives outside trips, deco, gas changes, dives with multiple dive computers, a really short dive, a rather long dive, a dive with pictures, dive computers with very coarse sample rate, rather fine sample rate, with gas integration, without... Should touch a lot of different scenarios. The file is in V2 format to also allow testing the importing / conversion to dive sites. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-24Adapt CSV test to include suitGravatar Dirk Hohndel
Also fixed it to correctly parse the mean depth (duh, a test that had a bug) and added a buddy field for good measure. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-04-04OSTCTools-Add two sample divesGravatar Salvador Cuñat
Adds two test dives for OSTCTools. I've kept the original naming. Num 173 selected because it implies using EAN32. Num 80, provided in forum by Philippe Tescari, selected because involves gas changes (although user don't seems to have set different gas mixes). Sadly, both dives seems to be from 2N/C devices. Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-16Load remote imagesGravatar Robert C. Helling
When loading an image by filename and by hash fails, try to interpret the filename as URL and download the image. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-14Some simple test for file parsingGravatar Dirk Hohndel
With no V2 question shown - parsing fails when a V2 file is loaded - parsing succeeds when a V3 file is loaded - import of CSV file succeeds With V2 question shown - parsing succeeds when a V2 file is loaded Finally compare the output of reading in the various files with reference output included in the sources. My guess is that this test might be a bit fragile, but hey, it's a start. (reminder: the tests only get built when using cmake) Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-03-10Import Datatrak/WLog filesGravatar Salvador Cuñat
Sequentially parses a file, expected to be a Datatrak/WLog divelog, and converts the dive info into Subsurface's dive structure. As my first DC, back in 90s, was an Aladin Air X, the obvious choice of log software was DTrak (Win version). After using it for some time we moved to WLog (shareware software more user friendly than Dtrak, printing capable, and still better, it runs under wine, which, as linux user, was definitive for me). Then, some years later, my last Aladin died and I moved to an OSTC, forcing me to look for a software that support this DC. I found JDivelog which was capable of import Dtrak logs and used it for some time until discovered Subsurface existence and devoted to it. The fact was that importing Dtrak dives in JDivelog and then re-importing them in Subsurface caused a significant data loss (mainly in the profile events and alarms) and weird location of some other info in the dive notes (mostly tag items in the original Dtrak software). This situation can't actually be solved with tools like divelogs.de which causes similar if no greater data loss. Although this won't be a core feature for Subsurface, I expect it can be useful for some other divers as has been for me. Comments and issues: Datatrak/Wlog files include a lot of diving data which are not directly supported in Subsurface, in these cases we choose mostly to use "tags". The lack of some important info in Datatrak archives (e.g. tank's initial pressure) forces us to do some arbitrary assumptions (e.g. initial pressure = 200 bar). There might be archives coming directly from old DOS days, as first versions of Datatrak run on that OS; they were coded CP437 or CP850, while dive logs coming from Win versions seems to be coded CP1252. Finally, Wlog seems to use a mixed confusing style. Program directly converts some of the old encoded chars to iso8859 but is expected there be some issues with non alphabetic chars, e.g. "ª". There are two text fields: "Other activities" and "Dive notes", both limited to 256 char size. We have merged them in Subsurface's "Dive Notes" although the first one could be "tagged", but we're unsure that the user had filled it in a tag friendly way. WLog adds some information to the dive and lets the user to write more than 256 chars notes. This is achieved, while keeping compatibility with DTrak divelogs, by adding a complementary file named equally as the .log file and with .add extension where all this info is stored. We have, still, not worked with this complementary files. This work is based on the paper referenced in butracker #194 which has some errors (e.g. beginning of log and beginning of dive are changed) and a lot of bytes of unknown meaning. Example.log shows, at least, one more byte than those referred in the paper for the O2 Aladin computer, this could be a byte referred to the use of SCR but the lack of an OC dive with O2 computer makes impossible for us to compare. The only way we have figured out to distinguish a priori between SCR and non SCR dives with O2 computers is that the dives are tagged with a "rebreather" tag. Obviously this is not a very trusty way of doing things. In SCR dives, the O2% in mix means, probably, the maximum O2% in the circuit, not the O2% of the EAN mix in the tanks, which would be unknown in this case. The list of DCs related in bug #194 paper seems incomplete, we have added one or two from WLog and discarded those which are known to exist but whose model is unknown, grouping them under the imaginative name of "unknown". The list can easily be increased in the future if we ever know the models identifiers. BTW, in Example.log, 0x00 identifier is used for some DC dives and from my own divelogs is inferred that 0x00 is used for manually entered dives, this could easily be an error in Example.log coming from a preproduction DC model. Example.log which is shipped in datatrak package is included in dives directory for testing pourposes. [Dirk Hohndel: some small cleanups, merged with latest master, support divesites, remove the pointless memset() before free() calls add to cmake build] Signed-off-by: Salvador Cuñat <salvador.cunat@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>