aligned tests with latest FileReader changes

This commit is contained in:
john30
2018-04-08 13:48:52 +02:00
parent 000d68f3c2
commit bee1fc5b8a
4 changed files with 20 additions and 20 deletions
+5 -5
View File
@@ -69,7 +69,7 @@ class TestReader : public MappedFileReader {
return RESULT_OK; // leave it to DataField::create
}
result_t addFromFile(const string& filename, unsigned int lineNo, map<string, string>* row,
vector< map<string, string> >* subRows, string* errorDescription) override {
vector< map<string, string> >* subRows, string* errorDescription, bool replace) override {
if (!row->empty() || subRows->empty()) {
cout << "read line " << static_cast<unsigned>(lineNo) << ": read error: got "
<< static_cast<unsigned>(row->size()) << "/0 main, " << static_cast<unsigned>(subRows->size())
@@ -512,7 +512,7 @@ int main() {
istringstream dummystr("#");
string errorDescription;
vector<string> row;
templates->readLineFromStream(&dummystr, __FILE__, false, &lineNo, &row, &errorDescription, NULL, NULL);
templates->readLineFromStream(&dummystr, __FILE__, false, &lineNo, &row, &errorDescription, false, NULL, NULL);
const DataField* fields = NULL;
for (unsigned int i = 0; i < sizeof(checks) / sizeof(checks[0]); i++) {
string check[5] = checks[i];
@@ -567,7 +567,7 @@ int main() {
}
if (isTemplate) {
lineNo = baseLine + i;
result = templates->readLineFromStream(&isstr, __FILE__, false, &lineNo, &row, &errorDescription, NULL, NULL);
result = templates->readLineFromStream(&isstr, __FILE__, false, &lineNo, &row, &errorDescription, false, NULL, NULL);
if (result != RESULT_OK) {
cout << "\"" << check[0] << "\": template read error: " << getResultCode(result) << ", "
<< errorDescription << endl;
@@ -579,7 +579,7 @@ int main() {
lineNo = 0;
dummystr.clear();
dummystr.str("#");
result = reader.readLineFromStream(&dummystr, __FILE__, false, &lineNo, &row, &errorDescription, NULL, NULL);
result = reader.readLineFromStream(&dummystr, __FILE__, false, &lineNo, &row, &errorDescription, false, NULL, NULL);
if (result != RESULT_OK) {
cout << "\"" << check[0] << "\": read header error: " << getResultCode(result) << ", " << errorDescription
<< endl;
@@ -587,7 +587,7 @@ int main() {
continue;
}
lineNo = baseLine + i;
result = reader.readLineFromStream(&isstr, "", false, &lineNo, &row, &errorDescription, NULL, NULL);
result = reader.readLineFromStream(&isstr, "", false, &lineNo, &row, &errorDescription, false, NULL, NULL);
fields = reader.m_fields;
if (failedCreate) {
if (result == RESULT_OK) {