mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Create test case for DivingLog SQLite import
Signed-off-by: Miika Turkia <miika.turkia@gmail.com> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
76fe262a0f
commit
c19f4869af
3 changed files with 730 additions and 0 deletions
|
@ -1,5 +1,6 @@
|
|||
#include "testparse.h"
|
||||
#include "dive.h"
|
||||
#include "file.h"
|
||||
#include <QTextStream>
|
||||
|
||||
void TestParse::testParseCSV()
|
||||
|
@ -18,6 +19,20 @@ void TestParse::testParseCSV()
|
|||
fprintf(stderr, "number of dives %d \n", dive_table.nr);
|
||||
}
|
||||
|
||||
void TestParse::testParseDivingLog()
|
||||
{
|
||||
// Parsing of DivingLog import from SQLite database
|
||||
sqlite3 *handle;
|
||||
|
||||
struct dive_site *ds = alloc_dive_site(0xdeadbeef);
|
||||
ds->name = copy_string("Suomi - - Hälvälä");
|
||||
|
||||
QCOMPARE(sqlite3_open(SUBSURFACE_SOURCE "/dives/TestDivingLog4.1.1.sql", &handle), 0);
|
||||
QCOMPARE(parse_divinglog_buffer(handle, 0, 0, 0, &dive_table), 0);
|
||||
|
||||
sqlite3_close(handle);
|
||||
}
|
||||
|
||||
void TestParse::testParseV2NoQuestion()
|
||||
{
|
||||
// parsing of a V2 file should work
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue