Skip to content

Commit

Permalink
Fix table tests with changed default
Browse files Browse the repository at this point in the history
  • Loading branch information
phdum-a committed Nov 22, 2024
1 parent 6dc1257 commit 2e4ec3d
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
6 changes: 3 additions & 3 deletions palace/utils/tablecsv.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,7 @@ class Table
auto to = [&buf](auto f, auto &&...a)
{ fmt::format_to(std::back_inserter(buf), f, std::forward<decltype(a)>(a)...); };

for (int i = 0; i < n_cols(); i++)
for (size_t i = 0; i < n_cols(); i++)
{
if (i > 0)
{
Expand All @@ -225,7 +225,7 @@ class Table
auto to = [&buf](auto f, auto &&...a)
{ fmt::format_to(std::back_inserter(buf), f, std::forward<decltype(a)>(a)...); };

for (int i = 0; i < n_cols(); i++)
for (size_t i = 0; i < n_cols(); i++)
{
if (i > 0)
{
Expand Down Expand Up @@ -254,7 +254,7 @@ class Table
{
fmt::memory_buffer buf{};
append_header(buf);
for (int j = 0; j < n_rows(); j++)
for (size_t j = 0; j < n_rows(); j++)
{
append_row(buf, j);
}
Expand Down
18 changes: 9 additions & 9 deletions test/unit/test-tablecsv.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,9 @@ TEST_CASE("TableCSV", "[tablecsv]")

// clang-format off
auto table_str1 = std::string(
" Header Col 1, Header Col 2, Header Col 3\n"
" NULL, +2.000000000e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
" Header Col 1, Header Col 2, Header Col 3\n"
" NULL, +2.000000000e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
);
// clang-format on
CHECK(table.format_table() == table_str1);
Expand All @@ -87,9 +87,9 @@ TEST_CASE("TableCSV", "[tablecsv]")

// clang-format off
auto table_str2 = std::string(
" Header Col 1, Header Col 2, Header Col 3\n"
" NULL, +2.000000e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
" Header Col 1, Header Col 2, Header Col 3\n"
" NULL, +2.000000e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
);
// clang-format on
CHECK(table.format_table() == table_str2);
Expand All @@ -101,9 +101,9 @@ TEST_CASE("TableCSV", "[tablecsv]")

// clang-format off
auto table_str3 = std::string(
" Header Col 1,Header Col 2, Header Col 3\n"
" NULL, 2.00e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
" Header Col 1,Header Col 2, Header Col 3\n"
" NULL, 2.00e+00, +3.000000000e+00\n"
" NULL, NULL, +6.000000000e+00\n"
);
// clang-format on
CHECK(table.format_table() == table_str3);
Expand Down

0 comments on commit 2e4ec3d

Please sign in to comment.