From afe363fa8569c0634e5bc20dc54c204533a638d7 Mon Sep 17 00:00:00 2001 From: "Robert C. Helling" Date: Mon, 10 Sep 2018 14:47:56 +0200 Subject: Optional anonymization upon export Add a checkbox that triggers replacement of all English characters by x's in notes, buddy, dive guide and (while we are at it) suit. This is ment for people sharing logs for debugging that are concious about privacy issues. It leaves the lenth of strings in tact as well as special charcters as those might be needed to track down a particular parsing problem. Signed-off-by: Robert C. Helling --- tests/testparse.cpp | 16 ++++++++-------- tests/testplan.cpp | 26 +++++++++++++------------- 2 files changed, 21 insertions(+), 21 deletions(-) (limited to 'tests') diff --git a/tests/testparse.cpp b/tests/testparse.cpp index 59531af70..623e6cc5e 100644 --- a/tests/testparse.cpp +++ b/tests/testparse.cpp @@ -373,13 +373,13 @@ void TestParse::exportCSVDiveDetails() { parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); - export_dives_xslt("testcsvexportmanual.csv", 0, 0, "xml2manualcsv.xslt"); - export_dives_xslt("testcsvexportmanualimperial.csv", 0, 1, "xml2manualcsv.xslt"); + export_dives_xslt("testcsvexportmanual.csv", 0, 0, "xml2manualcsv.xslt", false); + export_dives_xslt("testcsvexportmanualimperial.csv", 0, 1, "xml2manualcsv.xslt", false); clear_dive_file_data(); parseCSVmanual(1, "testcsvexportmanualimperial.csv"); - export_dives_xslt("testcsvexportmanual2.csv", 0, 0, "xml2manualcsv.xslt"); + export_dives_xslt("testcsvexportmanual2.csv", 0, 0, "xml2manualcsv.xslt", false); FILE_COMPARE("testcsvexportmanual2.csv", "testcsvexportmanual.csv"); @@ -422,13 +422,13 @@ void TestParse::exportCSVDiveProfile() { parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); - export_dives_xslt("testcsvexportprofile.csv", 0, 0, "xml2csv.xslt"); - export_dives_xslt("testcsvexportprofileimperial.csv", 0, 1, "xml2csv.xslt"); + export_dives_xslt("testcsvexportprofile.csv", 0, 0, "xml2csv.xslt", false); + export_dives_xslt("testcsvexportprofileimperial.csv", 0, 1, "xml2csv.xslt", false); clear_dive_file_data(); parseCSVprofile(1, "testcsvexportprofileimperial.csv"); - export_dives_xslt("testcsvexportprofile2.csv", 0, 0, "xml2csv.xslt"); + export_dives_xslt("testcsvexportprofile2.csv", 0, 0, "xml2csv.xslt", false); FILE_COMPARE("testcsvexportprofile2.csv", "testcsvexportprofile.csv"); @@ -440,12 +440,12 @@ void TestParse::exportUDDF() { parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml", &dive_table); - export_dives_xslt("testuddfexport.uddf", 0, 1, "uddf-export.xslt"); + export_dives_xslt("testuddfexport.uddf", 0, 1, "uddf-export.xslt", false); clear_dive_file_data(); parse_file("testuddfexport.uddf", &dive_table); - export_dives_xslt("testuddfexport2.uddf", 0, 1, "uddf-export.xslt"); + export_dives_xslt("testuddfexport2.uddf", 0, 1, "uddf-export.xslt", false); FILE_COMPARE("testuddfexport.uddf", "testuddfexport2.uddf"); diff --git a/tests/testplan.cpp b/tests/testplan.cpp index dd62aa777..092015c58 100644 --- a/tests/testplan.cpp +++ b/tests/testplan.cpp @@ -368,7 +368,7 @@ void TestPlan::testMetric() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -409,7 +409,7 @@ void TestPlan::testImperial() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -450,7 +450,7 @@ void TestPlan::testVpmbMetric45m30minTx() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -481,7 +481,7 @@ void TestPlan::testVpmbMetric60m10minTx() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -512,7 +512,7 @@ void TestPlan::testVpmbMetric60m30minAir() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -543,7 +543,7 @@ void TestPlan::testVpmbMetric60m30minEan50() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -580,7 +580,7 @@ void TestPlan::testVpmbMetric60m30minTx() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -617,7 +617,7 @@ void TestPlan::testVpmbMetric100m60min() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -660,7 +660,7 @@ void TestPlan::testVpmbMetricMultiLevelAir() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -691,7 +691,7 @@ void TestPlan::testVpmbMetric100m10min() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -738,7 +738,7 @@ void TestPlan::testVpmbMetricRepeat() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -759,7 +759,7 @@ void TestPlan::testVpmbMetricRepeat() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result @@ -796,7 +796,7 @@ void TestPlan::testVpmbMetricRepeat() #if DEBUG free(displayed_dive.notes); displayed_dive.notes = NULL; - save_dive(stdout, &displayed_dive); + save_dive(stdout, &displayed_dive, false); #endif // check minimum gas result -- cgit v1.2.3-70-g09d2