Changeset a0ed0ff in subsurface


Ignore:
Timestamp:
Apr 1, 2017, 8:06:09 AM (3 months ago)
Author:
Dirk Hohndel <dirk@…>
Branches:
master
Children:
acd791b
Parents:
1c03cb2
git-author:
Miika Turkia <miika.turkia@…> (03/13/17 12:53:44)
git-committer:
Dirk Hohndel <dirk@…> (04/01/17 08:06:09)
Message:

Change parseCSV to support unit and file selection

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

Location:
tests
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • tests/testparse.cpp

    rb9a3dfb8 ra0ed0ff  
    5151}
    5252
    53 int TestParse::parseCSV()
     53int TestParse::parseCSV(int units, std::string file)
    5454{
    5555        // some basic file parsing tests
     
    9191        params[pnr++] = intdup(0);
    9292        params[pnr++] = strdup("units");
    93         params[pnr++] = intdup(0);
     93        params[pnr++] = intdup(units);
    9494        params[pnr++] = strdup("datefmt");
    9595        params[pnr++] = intdup(1);
     
    112112        params[pnr++] = NULL;
    113113
    114         return parse_manual_file(SUBSURFACE_TEST_DATA "/dives/test41.csv", params, pnr - 1);
     114        return parse_manual_file(file.c_str(), params, pnr - 1);
    115115}
    116116
     
    144144void TestParse::testParse()
    145145{
    146         QCOMPARE(parseCSV(), 0);
     146        QCOMPARE(parseCSV(0, SUBSURFACE_TEST_DATA "/dives/test41.csv"), 0);
    147147        fprintf(stderr, "number of dives %d \n", dive_table.nr);
    148148       
  • tests/testparse.h

    rb9a3dfb8 ra0ed0ff  
    1212        void cleanup();
    1313
    14         int parseCSV();
     14        int parseCSV(int, std::string);
    1515        int parseDivingLog();
    1616        int parseV2NoQuestion();
Note: See TracChangeset for help on using the changeset viewer.