aboutsummaryrefslogtreecommitdiffstats
path: root/dives
AgeCommit message (Collapse)Author
2020-09-04Implement Seac SeacSync databaser parser.Gravatar James Wobser
Dives for the seac action computer are imported by the seacsync program into two tables in an sqlite3 database. The dive information is read from the headers_dive table. The dive_data table is then queried for each dive to get samples. The seac action computer is the only current supported computer by the seacsync program. It only supports two gas mixes, so the parser will toggle between two cylinders whenever it detects a change in the active O2 mix. Dive start time is stored in UTC with a timezone offset. A helper function to read this was added to qthelper. Default cases have been added to some switch statements to assist in future development for other dive types and salinity. Example database has been added to ./dives/TestDiveSeacSync.db Signed-off-by: James Wobser <james.wobser@gmail.com>
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>