mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Add test for dive site duplication bug
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
e0587cb6df
commit
1b37e0f1a4
4 changed files with 57 additions and 0 deletions
|
@ -573,6 +573,7 @@ if(NOT NO_TESTS)
|
||||||
TEST(TestParse testparse.cpp)
|
TEST(TestParse testparse.cpp)
|
||||||
TEST(TestGitStorage testgitstorage.cpp)
|
TEST(TestGitStorage testgitstorage.cpp)
|
||||||
TEST(TestPlan testplan.cpp)
|
TEST(TestPlan testplan.cpp)
|
||||||
|
TEST(TestDiveSiteDuplication testdivesiteduplication.cpp)
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
# install a few things so that one can run Subsurface from the build
|
# install a few things so that one can run Subsurface from the build
|
||||||
|
|
32
dives/TwoTimesTwo.ssrf
Normal file
32
dives/TwoTimesTwo.ssrf
Normal file
|
@ -0,0 +1,32 @@
|
||||||
|
<divelog program='subsurface' version='2'>
|
||||||
|
<dives>
|
||||||
|
<dive number='1' date='2014-03-15' time='21:44:06' duration='52:20 min'>
|
||||||
|
<location gps='7.132557 134.224213'>Blue Corner</location>
|
||||||
|
<notes>First dive with this location</notes>
|
||||||
|
<divecomputer model='manually added dive'>
|
||||||
|
<depth max='15.0 m' mean='9.908 m' />
|
||||||
|
</divecomputer>
|
||||||
|
</dive>
|
||||||
|
<dive number='2' date='2014-03-16' time='21:44:06' duration='52:20 min'>
|
||||||
|
<location gps='7.132557 134.224213'>Blue Corner, Palau</location>
|
||||||
|
<notes>Second dive with this location</notes>
|
||||||
|
<divecomputer model='manually added dive'>
|
||||||
|
<depth max='15.0 m' mean='9.908 m' />
|
||||||
|
</divecomputer>
|
||||||
|
</dive>
|
||||||
|
<dive number='3' date='2014-03-17' time='21:44:06' duration='52:20 min'>
|
||||||
|
<location gps='7.132557 134.224213'>Blue Corner</location>
|
||||||
|
<notes>First dive with this location</notes>
|
||||||
|
<divecomputer model='manually added dive'>
|
||||||
|
<depth max='15.0 m' mean='9.908 m' />
|
||||||
|
</divecomputer>
|
||||||
|
</dive>
|
||||||
|
<dive number='4' date='2014-03-18' time='21:44:06' duration='52:20 min'>
|
||||||
|
<location gps='7.132557 134.224213'>Blue Corner, Palau</location>
|
||||||
|
<notes>Second dive with this location</notes>
|
||||||
|
<divecomputer model='manually added dive'>
|
||||||
|
<depth max='15.0 m' mean='9.908 m' />
|
||||||
|
</divecomputer>
|
||||||
|
</dive>
|
||||||
|
</dives>
|
||||||
|
</divelog>
|
11
tests/testdivesiteduplication.cpp
Normal file
11
tests/testdivesiteduplication.cpp
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
#include "testdivesiteduplication.h"
|
||||||
|
#include "dive.h"
|
||||||
|
#include "divesite.h"
|
||||||
|
|
||||||
|
void TestDiveSiteDuplication::testReadV2()
|
||||||
|
{
|
||||||
|
QCOMPARE(parse_file(SUBSURFACE_SOURCE "/dives/TwoTimesTwo.ssrf"), 0);
|
||||||
|
QCOMPARE(dive_site_table.nr, 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
QTEST_MAIN(TestDiveSiteDuplication)
|
13
tests/testdivesiteduplication.h
Normal file
13
tests/testdivesiteduplication.h
Normal file
|
@ -0,0 +1,13 @@
|
||||||
|
#ifndef TESTDIVESITEDUPLICATION_H
|
||||||
|
#define TESTDIVESITEDUPLICATION_H
|
||||||
|
|
||||||
|
#include <QTest>
|
||||||
|
|
||||||
|
class TestDiveSiteDuplication : public QObject
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
private slots:
|
||||||
|
void testReadV2();
|
||||||
|
};
|
||||||
|
|
||||||
|
#endif // TESTDIVESITEDUPLICATION_H
|
Loading…
Add table
Add a link
Reference in a new issue