subsurface/tests
Berthold Stoeger e20ec9248c core: fix leak when clearing dive log
46cf2fc086 fixed a bug where clearing of a divelog, such as the one
used for import, would erase dives in the global(!) divelog.

However, the new code used the function clear_dive_table(), which
only cleared the table without unregistering the dives. In particular,
the dives were not removed from the trips, which means that the trips
were not free()d.

This reinstates the old code, but now passes a divelog paremeter
to delete_single_dive() instead of accessing the global divelog.
Moreover, delete dives from the back to avoid unnecessary
copying.

An alternative and definitely simpler solution might be to just
add a "clear_trip_table()" after "clear_dive_table()".

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2024-05-13 08:58:03 +12:00
..
.gitignore
CMakeLists.txt Add tests for formatDiveGasString 2023-10-18 21:34:56 +13:00
testAirPressure.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testAirPressure.h
testdivesiteduplication.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testdivesiteduplication.h
testformatDiveGasString.cpp Add another test for formatDiveGasString 2023-10-18 21:34:56 +13:00
testformatDiveGasString.h Add another test for formatDiveGasString 2023-10-18 21:34:56 +13:00
testgitstorage.cpp core: fix leak when clearing dive log 2024-05-13 08:58:03 +12:00
testgitstorage.h testing/git-storage: fairly fundamental rewrite of the storage test 2020-04-15 07:58:10 -07:00
testgpscoords.cpp
testgpscoords.h
testhelper.cpp
testhelper.h
testmerge.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testmerge.h
testparse.cpp core: turn a memblock in the parser to std::string 2024-03-10 11:01:42 +13:00
testparse.h Test case for multicylinder support on CSV import 2020-05-26 11:33:10 -07:00
testparseperformance.cpp Convert qDebug() to report_info() in testing code 2024-04-23 07:47:11 +07:00
testparseperformance.h
testpicture.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testpicture.h
testplan.cpp Planner: Fix Editing of Plans in Multi-Divecomputer Dives. 2024-05-11 12:51:45 +12:00
testplan.h Fix invalid bailout gas choice when planning a CCR dive. 2023-02-17 10:49:24 +01:00
testplannershared.cpp
testplannershared.h
testprofile.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testprofile.h cloudstorage: adapt tests 2021-04-19 12:51:01 -07:00
testqml.cpp
testqml.h
testqPrefCloudStorage.cpp cloudstorage: adapt tests 2021-04-19 12:51:01 -07:00
testqPrefCloudStorage.h
testqPrefDisplay.cpp desktop: remove user survey 2020-04-19 14:27:54 -07:00
testqPrefDisplay.h
testqPrefDiveComputer.cpp
testqPrefDiveComputer.h
testqPrefDivePlanner.cpp
testqPrefDivePlanner.h
testqPrefEquipment.cpp Equipment: Include Unused Tanks in Merge if Preference is Enabled. 2023-07-25 11:19:03 +12:00
testqPrefEquipment.h
testqPrefGeneral.cpp
testqPrefGeneral.h
testqPrefGeocoding.cpp
testqPrefGeocoding.h
testqPrefLanguage.cpp
testqPrefLanguage.h
testqPrefLog.cpp
testqPrefLog.h
testqPrefMedia.cpp
testqPrefMedia.h
testqPrefPartialPressureGas.cpp
testqPrefPartialPressureGas.h
testqPrefProxy.cpp
testqPrefProxy.h
testqPrefTechnicalDetails.cpp Desktop: Add a Button to Hide the Infobox in the Dive Profile. 2023-06-25 14:40:23 +02:00
testqPrefTechnicalDetails.h
testqPrefUnits.cpp
testqPrefUnits.h
testqPrefUpdateManager.cpp preferences: remove pointless member 2021-01-06 10:18:23 -08:00
testqPrefUpdateManager.h
testrenumber.cpp core: introduce divelog structure 2023-04-14 21:20:23 +02:00
testrenumber.h
testtaglist.cpp core: use C++-primitives for g_tag_list 2024-04-23 07:47:11 +07:00
testtaglist.h
testunitconversion.cpp core: move floating point functions to own header file 2022-08-30 22:34:38 +02:00
testunitconversion.h
tst_qPrefCloudStorage.qml cloudstorage: some cleanup of cloud url handling 2021-04-19 12:51:01 -07:00
tst_qPrefDisplay.qml desktop: remove user survey 2020-04-19 14:27:54 -07:00
tst_qPrefDiveComputer.qml
tst_qPrefDivePlanner.qml
tst_qPrefGeneral.qml
tst_qPrefGeocoding.qml
tst_qPrefLanguage.qml
tst_qPrefPartialPressureGas.qml
tst_qPrefProxy.qml
tst_qPrefTechnicalDetails.qml Equipment: Include Unused Tanks in Merge if Preference is Enabled. 2023-07-25 11:19:03 +12:00
tst_qPrefUnits.qml
tst_qPrefUpdateManager.qml