Changeset 726c9e8 in subsurface


Ignore:
Timestamp:
May 12, 2017, 2:05:33 PM (2 weeks ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
a489b3f
Parents:
f2e23e78
git-author:
Miika Turkia <miika.turkia@…> (05/09/17 12:28:04)
git-committer:
Dirk Hohndel <dirk@…> (05/12/17 14:05:33)
Message:

Test case for CSV profile export to imperial and back

Signed-off-by: Miika Turkia <miika.turkia@…>

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/testparse.cpp

    rd7cf340 r726c9e8  
    371371}
    372372
     373int TestParse::parseCSVprofile(int units, std::string file)
     374{
     375        verbose = 1;
     376        char *params[55];
     377        int pnr = 0;
     378
     379        params[pnr++] = strdup("dateField");
     380        params[pnr++] = intdup(1);
     381        params[pnr++] = strdup("datefmt");
     382        params[pnr++] = intdup(2);
     383        params[pnr++] = strdup("starttimeField");
     384        params[pnr++] = intdup(2);
     385        params[pnr++] = strdup("numberField");
     386        params[pnr++] = intdup(0);
     387        params[pnr++] = strdup("timeField");
     388        params[pnr++] = intdup(3);
     389        params[pnr++] = strdup("depthField");
     390        params[pnr++] = intdup(4);
     391        params[pnr++] = strdup("tempField");
     392        params[pnr++] = intdup(5);
     393        params[pnr++] = strdup("pressureField");
     394        params[pnr++] = intdup(6);
     395        params[pnr++] = strdup("units");
     396        params[pnr++] = intdup(units);
     397        params[pnr++] = NULL;
     398
     399        return parse_csv_file(file.c_str(), params, pnr - 1, "csv");
     400}
     401
     402void TestParse::exportCSVDiveProfile()
     403{
     404        parse_file(SUBSURFACE_TEST_DATA "/dives/test40.xml");
     405
     406        export_dives_xslt("testcsvexportprofile.csv", 0, 0, "xml2csv.xslt");
     407        export_dives_xslt("testcsvexportprofileimperial.csv", 0, 1, "xml2csv.xslt");
     408
     409        clear_dive_file_data();
     410
     411        parseCSVprofile(1, "testcsvexportprofileimperial.csv");
     412        export_dives_xslt("testcsvexportprofile2.csv", 0, 0, "xml2csv.xslt");
     413
     414        FILE_COMPARE("testcsvexportprofile2.csv",
     415                "testcsvexportprofile.csv");
     416
     417        clear_dive_file_data();
     418}
     419
    373420void TestParse::exportUDDF()
    374421{
     
    391438{
    392439        exportCSVDiveDetails();
     440        exportCSVDiveProfile();
    393441        exportUDDF();
    394442}
  • tests/testparse.h

    re52d9c2 r726c9e8  
    2727        int parseCSVmanual(int, std::string);
    2828        void exportCSVDiveDetails();
     29        int parseCSVprofile(int, std::string);
     30        void exportCSVDiveProfile();
    2931        void exportUDDF();
    3032        void testExport();
Note: See TracChangeset for help on using the changeset viewer.