diff -r 3eeaa517e066f7c0a0ba0c5018db07282d909948 -r b9fb3f140d641d95517e04e3d507e1de9b99e17f Makefile --- a/Makefile Sun Mar 02 10:55:15 2014 -0600 +++ b/Makefile Sat Mar 15 00:16:59 2014 -0500 @@ -8,14 +8,14 @@ all: $(SOURCES) $(EXECUTABLE) -$(EXECUTABLE): $(OBJECTS) - $(CC) $(LDFLAGS) $(OBJECTS) -o $@ +$(EXECUTABLE): $(OBJECTS) + $(CC) $(LDFLAGS) $(OBJECTS) -o $@ .cpp.o: - $(CC) $(CFLAGS) $< -o $@ + $(CC) $(CFLAGS) $< -o $@ clean: - rm -f src/*o csvpp + rm -f src/*o csvpp -test: - $(CC) $(LDFLAGS) -o test \ No newline at end of file +tests: + $(CC) $(LDFLAGS) ./src/csvpp.o ./src/stringhelper.o tests.cpp -o test \ No newline at end of file diff -r 3eeaa517e066f7c0a0ba0c5018db07282d909948 -r b9fb3f140d641d95517e04e3d507e1de9b99e17f tests.cpp --- a/tests.cpp Sun Mar 02 10:55:15 2014 -0600 +++ b/tests.cpp Sat Mar 15 00:16:59 2014 -0500 @@ -2,36 +2,38 @@ #include "csvpp.h" using namespace std; - +using namespace csvpp; int main() { - RowReader tmp; - stringstream ss; - ss << "field1,field2,field3\r\n123,234,345\r\n999,000,111\r\n"; - ss >> tmp; - rowiterator it; - int row = 0; - while(ss >> tmp) - { - switch (row) - { - case 0: - if (tmp["field1"] != "123") - { - cerr << "Failed at row " << row << endl; - return 1; - } - break; - case 1: - if (tmp["field1"] != "999") - { - cerr << "Failed at row " << row << endl; - return 1; - } - break; - } - } - - cout << "All tests ran successfully" << endl; + RowReader tmp; + stringstream ss; + ss << "field1,field2,field3\r\n123,234,345\r\n999,000,111\r\n"; + ss >> tmp; + rowiterator it; + int row = 0; + while(ss >> tmp) + { + switch (row) + { + case 0: + if (tmp["field1"] != "123") + { + cout << tmp["field1"] << endl; + cerr << "Failed at row " << row << endl; + return 1; + } + break; + case 1: + if (tmp["field1"] != "999") + { + cerr << "Failed at row " << row << endl; + return 1; + } + break; + } + row++; + } + + cout << "All tests ran successfully" << endl; return 0; -} \ No newline at end of file +}