From 2df34ca61304120c9f254b56ad642b739ea14779 Mon Sep 17 00:00:00 2001 From: MichaelBrunner Date: Sun, 2 Jun 2024 19:06:18 +0200 Subject: [PATCH] ENH: add missing header includes for mac os --- gtfs/test/test_gtfsReader.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/gtfs/test/test_gtfsReader.cpp b/gtfs/test/test_gtfsReader.cpp index c5f22e13..e26c0785 100644 --- a/gtfs/test/test_gtfsReader.cpp +++ b/gtfs/test/test_gtfsReader.cpp @@ -11,11 +11,13 @@ #include #include #include +#include #include #include #include + TEST(GTFS, TestFunction) { const auto agencyFile = R"(C:\Users\MichaelBrunner\source\master-thesis\raptorxx\gtfs\test\test-data\agency.txt)"; const auto calendarFile = R"(C:\Users\MichaelBrunner\source\master-thesis\raptorxx\gtfs\test\test-data\calendar.txt)"; @@ -39,6 +41,8 @@ TEST(GTFS, TestFunction) { LoggingPool::getLogger()->info("Agency: {} {} {}", agency.agencyId, agency.name, agency.timezone); }); + std::array weekday_names = {"Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday", "Sunday"}; + std::ranges::for_each(data.calendars, [&](const auto& calendar) { LoggingPool::getLogger()->info("Service ID: {}", calendar.serviceId); LoggingPool::getLogger()->info("Start Date: {}", fmt::format("{:%F}", calendar.startDate)); @@ -46,8 +50,9 @@ TEST(GTFS, TestFunction) { LoggingPool::getLogger()->info("Weekday Service: "); for (const auto& [day, service] : calendar.weekdayService) { - auto day_name = fmt::format("{:%A}", day); - LoggingPool::getLogger()->info("{}: {}", day_name, (service ? "Service" : "No service")); + auto day_name = weekday_names[day.c_encoding() - 1]; + auto day_name_formatted = fmt::format("{:%A}", day_name); + LoggingPool::getLogger()->info("{}: {}", day_name_formatted, (service ? "Service" : "No service")); } }); } \ No newline at end of file