aboutsummaryrefslogtreecommitdiffstats
path: root/tests
AgeCommit message (Collapse)Author
2016-03-24Fix tests linkageGravatar Tomaz Canabrava
I wasn't linking the tests against the qrc library, which made trying to load the xslt transformation files for the parse test fail. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-23Prevent possible SIGSEGV in testGravatar Dirk Hohndel
If the load fails the get_dive(1) could return NULL. Let's catch that as an error instead of having the test crash. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in testplan.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-09Silence warnings in testparse.cppGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-03-07Fix annoyances on file.cGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2016-02-01Silence compiler warningsGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-07Remove unnecessary call from testsGravatar Dirk Hohndel
Now that the WindowTitleUpdater is fixed we don't need to create an instance in the tests, either. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-11-02Do not depend on the subsurface_core qrc for testsGravatar Tomaz Canabrava
Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-30CMake for tests in its own folderGravatar Tomaz Canabrava
Besides making it more simple to add a new test now since you don't need to play hide and seek with the main cmake this has another good thing: on IDE's that scan the cmake to create targets on the project tree, the main project was being popullated with test-targets on the main tree and not inside the tests directory. Signed-off-by: Tomaz Canabrava <tomaz.canabrava@intel.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-07Add test for more GPS coordinatesGravatar Dirk Hohndel
We really should be able to parse the coordinates that we show in our own HTML export as well as the standard Google format... both have a comma between the latitude and longitude. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06TestPlan: update known Subsurface runtimesGravatar Rick Walsh
The purpose of testing against known Subsurface runtimes is to warn (when test is run in verbose mode) if the runtime has altered. Before the next release, we should update the known Subsurface runtimes to match current behaviour, so we are alerted when we change something during the next release cycle. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06TestPlan: include subsurfacestartup.hGravatar Rick Walsh
Commit 9d8b0ad introduces the copy_prefs function, and uses it to replace prefs = default_prefs. We need to include subsurfacestartup.h for it to work in testplan.cpp, otherwise TestPlan_build fails. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-06Correctly copy preferencesGravatar Dirk Hohndel
When just assigning one structure to the other we copy the string pointers. If we then modify those strings in the copy, we happily free the strings of the original. And then resetting the preferences equally happily reused those strings, pointing to long since freed memory. I think what I did now is excessive for the current use case in that it copies a ton of strings that are unset in the default_prefs. But I figured this is a rarely used function and I might as well do it correctly. Also, once we implement multi user support with per user preferences we will be copying completely populated preferences around (at least that's my guess). Fixes #940 Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-10-05Add test for import, merge and renumberingGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-29Make sure we don't create multiple dive sites with the same uuidGravatar Dirk Hohndel
This shouldn't happen, but in case there is a logic error higher up in the code somewhere, this will prevent it from happening, period. If the code asks for a new dive site with a specific uuid, simply return the existing dive site with that uuid. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-27TestPlan: Set VPM-B conservatism to zeroGravatar Rick Walsh
The VPM-B benchmark results are all based on nominal/zero conservatism, so we should make sure we use zero conservatism in the tests. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-22TestPlan: Add test for repeating diveGravatar Rick Walsh
If variables were accidentally carried through from a previous calculated plan, subsequent plan could be affected. This test aims to detect if this happens. Commit 8994270 corrected such a bug. If it were reverted, this test would fail (as it should). Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-18Git storage test: need to instantiate the window title updater classGravatar Dirk Hohndel
Otherwise calling the static function can cause a crash in mark_divelist_changed() Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-13Test case: compare DLD log with a saved oneGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-13Test case: reading zip and DLD parsingGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-09-02Prevent tests from hanging when offlineGravatar Robert C. Helling
From 31e324797c06d366f49db453a67a119819ca8012 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" <helling@atdotde.de> Date: Wed, 2 Sep 2015 17:28:12 +0200 Subject: [PATCH] Test that there is a dive so that the TestGitStorage does not hang when offline. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31Adopt expected times in TestPlanGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-31Changed qInfo() to qDebug()Gravatar Robert C. Helling
... as the former was introduced only in Qt 5.5 in order to make the test build also with 5.4 Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-30Add test case for multi line dive notes mergingGravatar Dirk Hohndel
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-08-30TestPlan: Do not re-declare bool resultGravatar Rick Walsh
Fixing this error makes TestPlan pass again. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29VPM-B Tests: Compare against known Subsurface runtimeGravatar Rick Walsh
We should compare the calculated runtime against the runtime previously calculated by Subsurface, expecting them to match exactly, in order to detect if a change has been made. We still compare against a benchmark, allowing some difference. Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29Update expected runtime of VPM-B test to match benchmarkGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-29VPM-B Tests: Output first ceilingGravatar Rick Walsh
This is useful for determining why we calculate a difference profile Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-27Update tests to use cleaner CSV parsing "API"Gravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Dive planner tests: pass dives that are close to expected durationGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Merge branch 'gitMerge'Gravatar Dirk Hohndel
2015-08-25Change Seabear TestParse to use reduced parametersGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Change TestParse to use reduced parametersGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25VPM-B: Add more planner testsGravatar Rick Walsh
Add more VPM-B planner tests. The "expected" total run time is taken as the total run time produced by the Fortran VPM-B program. For all these tests, the results are within two minutes, which is a good result, but most are classified as a "fail". Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Test VPM-B Correct expected dive time in commentGravatar Rick Walsh
Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Test another VPM-B dive planGravatar Rick Walsh
This adds a test for 100 m for 60 min dive on trimix using VPM-B Signed-off-by: Rick Walsh <rickmwalsh@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Cloud storage: second merge test, delete dive on one side, modify on otherGravatar Dirk Hohndel
Delete a dive while offline, modify it from a different system while online. Then resync. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Cloud storage: first test case for a very simple mergeGravatar Dirk Hohndel
- We add a dive while offline. - On a different computer (here simulated by a different local cache) we add a different file. - Now we go back to the previous local cache (the one where we added a different dive in the first step) and take that online (i.e., connect to cloud storage). Now both of the new dives should have been added to our data file. This is a rather trivial test with no conflict and a straight forward merge. We need to add a lot more test cases to make sure this works as expected and doesn't leave the user with a corrupt state. Ideally whatever happens, the user should never see an error... Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Cloud storage: test offline operationGravatar Dirk Hohndel
All this really does is make sure that the fast forward works if the local cache has received updates that haven't made it to the server, yet. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Cloud storage: add test for simple save / load from our test accountGravatar Dirk Hohndel
This will fail if the proxy settings of the user running the test are incorrect. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-25Add simple test for git storageGravatar Dirk Hohndel
This just makes sure that writing data to git storage and reading it back gives you the same result. Without the fixed generation of initial dive site UUIDs this fails. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-08-23Add a test for the VPM-B mode of the plannerGravatar Robert C. Helling
Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Seabear import: fix detection of empty linesGravatar Miika Turkia
The old code trusted in Windows new lines with length of 3. The new code strips out spaces and line ending chars resulting in empty line being of length 0. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-28Test case: Seabear new formatGravatar Miika Turkia
This validates Seabear import from H3 and T1 dive computers that use new CSV format to store the logs. The fields wary depending on the dive mode, thus we need to parse the field configuration during import. Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-27Test case: HUDC importGravatar Miika Turkia
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-26Test DM4 importGravatar 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-06Fix typo in test and some numbersGravatar Robert C. Helling
With these values I reproduce the runtimes from the UI. Signed-off-by: Robert C. Helling <helling@atdotde.de> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2015-07-05Adapt the test to the API changeGravatar Dirk Hohndel
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>