Skip to content

Commit e6f23a0

Browse files
authored
improve tests exception output, minor code style fix (#216)
1 parent ab199f5 commit e6f23a0

110 files changed

Lines changed: 117 additions & 113 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

src/rapidcsv.h

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* rapidcsv.h
33
*
44
* URL: https://github.com/d99kris/rapidcsv
5-
* Version: 8.96
5+
* Version: 8.97
66
*
77
* Copyright (C) 2017-2026 Kristofer Berggren
88
* All rights reserved.
@@ -1456,7 +1456,8 @@ namespace rapidcsv
14561456
{
14571457
mData.resize(rowIdx + 1);
14581458
}
1459-
auto& row = mData[rowIdx];
1459+
1460+
std::vector<std::string>& row = mData[rowIdx];
14601461
if (dataColumnIdx >= row.size())
14611462
{
14621463
row.resize(dataColumnIdx + 1);
@@ -1527,7 +1528,8 @@ namespace rapidcsv
15271528
{
15281529
mData.resize(dataRowIdx + 1);
15291530
}
1530-
auto& row = mData[dataRowIdx];
1531+
1532+
std::vector<std::string>& row = mData[dataRowIdx];
15311533
if (mLabelParams.mRowNameIdx >= static_cast<int>(row.size()))
15321534
{
15331535
row.resize(static_cast<size_t>(mLabelParams.mRowNameIdx) + 1);
@@ -1892,7 +1894,9 @@ namespace rapidcsv
18921894
str.erase(str.begin(), std::find_if(str.begin(), str.end(), [](unsigned char ch) { return !isspace(ch); }));
18931895

18941896
// rtrim
1895-
str.erase(std::find_if(str.rbegin(), str.rend(), [](unsigned char ch) { return !isspace(ch); }).base(), str.end());
1897+
str.erase(std::find_if(str.rbegin(), str.rend(), [](unsigned char ch) {
1898+
return !isspace(ch);
1899+
}).base(), str.end());
18961900

18971901
return str;
18981902
}

tests/ptest001.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ int main()
3333
}
3434
catch (const std::exception& ex)
3535
{
36-
std::cout << ex.what() << std::endl;
36+
std::cout << "exception: " << ex.what() << std::endl;
3737
rv = 1;
3838
}
3939

tests/ptest002.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ int main()
2525
}
2626
catch (const std::exception& ex)
2727
{
28-
std::cout << ex.what() << std::endl;
28+
std::cout << "exception: " << ex.what() << std::endl;
2929
rv = 1;
3030
}
3131

tests/test001.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ int main()
2929
}
3030
catch (const std::exception& ex)
3131
{
32-
std::cout << ex.what() << std::endl;
32+
std::cout << "exception: " << ex.what() << std::endl;
3333
rv = 1;
3434
}
3535

tests/test002.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ int main()
5050
}
5151
catch (const std::exception& ex)
5252
{
53-
std::cout << ex.what() << std::endl;
53+
std::cout << "exception: " << ex.what() << std::endl;
5454
rv = 1;
5555
}
5656

tests/test003.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ int main()
4040
}
4141
catch (const std::exception& ex)
4242
{
43-
std::cout << ex.what() << std::endl;
43+
std::cout << "exception: " << ex.what() << std::endl;
4444
rv = 1;
4545
}
4646

tests/test004.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ int main()
5656
}
5757
catch (const std::exception& ex)
5858
{
59-
std::cout << ex.what() << std::endl;
59+
std::cout << "exception: " << ex.what() << std::endl;
6060
rv = 1;
6161
}
6262

tests/test005.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ int main()
3737
}
3838
catch (const std::exception& ex)
3939
{
40-
std::cout << ex.what() << std::endl;
40+
std::cout << "exception: " << ex.what() << std::endl;
4141
rv = 1;
4242
}
4343

tests/test006.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ int main()
5252
}
5353
catch (const std::exception& ex)
5454
{
55-
std::cout << ex.what() << std::endl;
55+
std::cout << "exception: " << ex.what() << std::endl;
5656
rv = 1;
5757
}
5858

tests/test007.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ int main()
4141
}
4242
catch (const std::exception& ex)
4343
{
44-
std::cout << ex.what() << std::endl;
44+
std::cout << "exception: " << ex.what() << std::endl;
4545
rv = 1;
4646
}
4747

0 commit comments

Comments
 (0)