␉int test = 1;␍␊ |
␉// Test 1␍␊ |
␉{␍␊ |
RowReader tmp;␍␊ |
RowReader tmp(",");␍␊ |
stringstream ss;␍␊ |
ss << "field1,field2,field3\r\n123,234,345\r\n999,000,111\r\n";␍␊ |
ss >> tmp;␍␊ |
|
case 0:␍␊ |
if (tmp["field1"] != "123")␍␊ |
{␍␊ |
cout << tmp["field1"] << endl;␍␊ |
cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |
|
case 1:␍␊ |
if (tmp["field1"] != "999")␍␊ |
{␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |
|
case 0:␍␊ |
if (tmp["field1"] != "123")␍␊ |
{␍␊ |
cout << tmp["field1"] << endl;␍␊ |
cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |
|
case 1:␍␊ |
if (tmp["field1"] != "999")␍␊ |
{␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |
|
case 0:␍␊ |
if (tmp["field1"] != "123")␍␊ |
{␍␊ |
cout << tmp["field1"] << endl;␍␊ |
cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |
|
case 1:␍␊ |
if (tmp["field1"] != "999")␍␊ |
{␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << tmp["field1"] << endl;␍␊ |
cerr << "Failed at row " << row << endl;␍␊ |
␉␉␉␉␉␉␉␉␉␉cerr << "Failed at test " << test << endl;␍␊ |
return 1;␍␊ |