2017-04-27 18:21:27 +00:00
|
|
|
// SPDX-License-Identifier: GPL-2.0
|
2014-04-17 15:21:39 +00:00
|
|
|
#include "testprofile.h"
|
2019-03-04 22:20:29 +00:00
|
|
|
#include "core/divesite.h"
|
2019-05-31 14:09:14 +00:00
|
|
|
#include "core/trip.h"
|
2019-03-03 21:29:40 +00:00
|
|
|
#include "core/file.h"
|
2020-05-02 19:38:55 +00:00
|
|
|
#include "core/save-profiledata.h"
|
2014-04-17 15:21:39 +00:00
|
|
|
|
2020-05-02 19:38:55 +00:00
|
|
|
void TestProfile::testProfileExport()
|
2014-04-17 15:21:39 +00:00
|
|
|
{
|
2020-05-02 19:38:55 +00:00
|
|
|
parse_file("../dives/abitofeverything.ssrf", &dive_table, &trip_table, &dive_site_table);
|
|
|
|
save_profiledata("exportprofile.csv", false);
|
|
|
|
QFile org("../dives/exportprofilereference.csv");
|
|
|
|
org.open(QFile::ReadOnly);
|
|
|
|
QFile out("exportprofile.csv");
|
|
|
|
out.open(QFile::ReadOnly);
|
|
|
|
QTextStream orgS(&org);
|
|
|
|
QTextStream outS(&out);
|
|
|
|
QString readin = orgS.readAll();
|
|
|
|
QString written = outS.readAll();
|
|
|
|
QCOMPARE(readin, written);
|
|
|
|
|
2014-04-17 15:21:39 +00:00
|
|
|
}
|
|
|
|
|
2017-02-05 22:26:51 +00:00
|
|
|
QTEST_GUILESS_MAIN(TestProfile)
|