diff --git a/palace/utils/tablecsv.hpp b/palace/utils/tablecsv.hpp index e3ab6afc0..cfd4750b3 100644 --- a/palace/utils/tablecsv.hpp +++ b/palace/utils/tablecsv.hpp @@ -208,7 +208,7 @@ class Table auto to = [&buf](auto f, auto &&...a) { fmt::format_to(std::back_inserter(buf), f, std::forward(a)...); }; - for (int i = 0; i < n_cols(); i++) + for (size_t i = 0; i < n_cols(); i++) { if (i > 0) { @@ -225,7 +225,7 @@ class Table auto to = [&buf](auto f, auto &&...a) { fmt::format_to(std::back_inserter(buf), f, std::forward(a)...); }; - for (int i = 0; i < n_cols(); i++) + for (size_t i = 0; i < n_cols(); i++) { if (i > 0) { @@ -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); } diff --git a/test/unit/test-tablecsv.cpp b/test/unit/test-tablecsv.cpp index 44846e02d..763984cb4 100644 --- a/test/unit/test-tablecsv.cpp +++ b/test/unit/test-tablecsv.cpp @@ -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); @@ -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); @@ -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);