// // Created by stani on 3/14/25. // #define DOCTEST_CONFIG_IMPLEMENT_WITH_MAIN #include #include #include #include "../../src/Config.h" #include "../../src/helper/CsvBinary.h" TEST_CASE("Test Csv to binary and back") { CsvBinary::csvToBinary("Verbrauchsprofile.csv","Verbrauchsprofil.bin"); auto verbrauchsProfil = CsvBinary::binaryToVector("Verbrauchsprofil.bin"); for (const auto & [fst, snd]: *verbrauchsProfil) { LOG_DEBUG_INFO("Sum from {}: {}",fst ,std::accumulate( snd.begin(), snd.end(), 0.f, [](const float sum, const std::string& val) { return sum + std::stof(val); // Convert string to float before addition } )); } }