From 110ee840ccd1ac53e2caabcd17b905c92a93c634 Mon Sep 17 00:00:00 2001 From: ado Date: Sun, 25 Feb 2024 03:54:33 +0100 Subject: [PATCH] Fix header usage functionality --- include/ss/parser.hpp | 2 +- test/test_helpers.hpp | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/include/ss/parser.hpp b/include/ss/parser.hpp index 5e6d370..c655d38 100644 --- a/include/ss/parser.hpp +++ b/include/ss/parser.hpp @@ -214,7 +214,7 @@ public: reader_.next_line_converter_.set_column_mapping(column_mappings, header_.size()); - if (line() == 1) { + if (line() == 0) { ignore_next(); } } diff --git a/test/test_helpers.hpp b/test/test_helpers.hpp index f6a4b34..c345883 100644 --- a/test/test_helpers.hpp +++ b/test/test_helpers.hpp @@ -78,13 +78,17 @@ struct unique_file_name { unique_file_name(const std::string& test) { do { - name = "random_file_test_" + test + "_" + std::to_string(i++) + + name = "ssp_test_" + test + "_" + std::to_string(i++) + "_" + time_now_rand() + "_file.csv"; } while (std::filesystem::exists(name)); } ~unique_file_name() { - std::filesystem::remove(name); + try { + std::filesystem::remove(name); + } catch (const std::filesystem::filesystem_error& e) { + std::cerr << e.what() << std::endl; + } } };