aboutsummaryrefslogtreecommitdiffstats
path: root/dives
AgeCommit message (Collapse)Author
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>
2015-02-14Test dives for duplicate names and conflicting GPSGravatar Dirk Hohndel
The conflicting GPS is somewhat artificial. Since the GPS gets parsed first in our syntax, the different GPS location would create a new dive site and we'd end up with two dive sites of the same name with different coordinates. By having a location tag with just the name and no coordinates we make sure that this gets identified with the existing dive site and THEN add the GPS coordinates in the second location tag. This would never happen in a XML file created by Subsurface, but it does a good job in testing the different code paths. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-12-04Remove Poseidon XML fileGravatar Dirk Hohndel
The CSV/TXT import is working well now, the XML file is just causing confusion. Suggested-by: Willem Ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17For CCR dives, the diluent cylinder is the current cylinderGravatar Robert C. Helling
Change the meaning that _the_ cylinder (as we treat it in OC dives) is the diluent cylinder (rather than the O2 cylinder). This eliminates special cases. Now, for CCR, we have to handle the O2 cylinder in addition (rather than the diluent in addition). Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-17CCR test diveGravatar Dirk Hohndel
This is an anonymized version of a real dive. With the latest changes the SAC calculations now make "mostly sense". What's clearly still broken is the tank pressure graph. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-10Replace XML reference log for PoseidonGravatar willem ferguson
The Poseidon xml dive log in the /dives folder is faulty. This patch replace it with a fully working one. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-07Load and save extra data in Subsurface XML formatGravatar Dirk Hohndel
Includes test dive to test missing attributes and the overall syntax. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-11-01Replace Poseidon example dive log files in dives directoryGravatar willem ferguson
The present example files have dives with some unusual characteristics due to the fact that the dive pushes the limits of the Poseidon recreational rebreather. Replace these example files with a dive that does not have any unusual characteristics. This facilitates debugging of the Poseidon code. The xml file represents the same dive as the two text files. The xml file will ultimately be removed. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-30Add Poseidon example CSV and TXT files to the dives directoryGravatar Willem Ferguson
Two files are added to the dived directory. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-28Add test dive for Seabear HUDCGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-10-11CCR patch: Import and store oxygen sensor dataGravatar willem ferguson
This patch allows the importing of oxygen sensor and setpoint data from Poseidon CCR dive logs. 1) Change parse-xml.c to read up to three oxygen sensor values from xml. and to store the information in sample structures 2) Change parse-xml.c to read o2 setpoint values fro xml and to store it in sample structures 3) Change dive.c to delete all sensor and setpoint values where subsequent samples have sensor/setpoint values that are the same. 4) Change profile.c to store the sensor/setpoint values from the samples into plotinfo. 5) Change the sample Poseidon xml log in the dives directory to ensure the correct order and hierarchy of the dive and divecomputer nodes. [Dirk Hohndel: minor cleanup, removed debug code, whitespace] Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-08-27Add uncompressed Poseidon CCR XML dive log to the directory subsurface/dives.Gravatar willem ferguson
This file is not in the original unformatted style of Posedon but in an intermediate XML for developing the Qt interface. At the end of development this file will be replaced by the original unformatted dive log. Signed-off-by: willem ferguson <willemferguson@zoology.up.ac.za> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-29Add test dive with heart rate informationGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-07-15Fix the description of test dive cylindersGravatar Miika Turkia
It is really confusing when the size of the cylinder does not match the description. Inconsistent data in will mean inconsistent data out and validating that export works means I try to get consistent data out... Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-06-11Add beginning of pretend CCR XML fileGravatar Dirk Hohndel
Note that we are missing code to write out the new attributes, so saving this test dive back to a file loses them. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-07Add test dive that shows heart rateGravatar Dirk Hohndel
This is adapted from a real dive file, anonymized and massively shortened. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2014-04-05Add test dive that has an unused cylinderGravatar Dirk Hohndel
This way one can test that the corresponding preferences option works correctly. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>