fix: ut and agents

Change-Id: I3b9fd9da90d153b2b4ce8254fa14216ea87eb7bd
This commit is contained in:
Aline Gondim Santos
2023-09-22 08:31:52 -03:00
parent 737e2f117c
commit 3bbac87283
4 changed files with 16 additions and 3 deletions

View File

@ -21,6 +21,7 @@
#pragma once
#include <cstdint>
#include <filesystem>
#include "logger.h"
@ -211,6 +212,15 @@ struct from_guile
return ret;
}
operator std::filesystem::path()
{
char* str_raw = scm_to_locale_string(value);
std::string ret(str_raw);
free(str_raw);
return std::filesystem::path(ret);
}
template<typename T>
operator std::vector<T>()
{

View File

@ -182,7 +182,7 @@ load_actors(const std::filesystem::path& from_yaml)
std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml)
{
auto actors = load_actors(from_yaml);
auto actors = load_actors(std::filesystem::path(from_yaml));
std::vector<std::string> wait_for;

View File

@ -24,6 +24,8 @@
#include <cstdint>
#include <map>
#include <string>
#include <filesystem>
#include <vector>
constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30;
constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30;
@ -45,7 +47,7 @@ wait_for_removal_of(const std::string& account,
std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT));
extern std::map<std::string, std::string>
load_actors(const std::string& from_yaml);
load_actors(const std::filesystem::path& from_yaml);
extern std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml);

View File

@ -24,6 +24,7 @@
#include <cstdint>
#include <map>
#include <string>
#include <filesystem>
constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30;
constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30;
@ -45,7 +46,7 @@ wait_for_removal_of(const std::string& account,
std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT));
extern std::map<std::string, std::string>
load_actors(const std::string& from_yaml);
load_actors(const std::filesystem::path& from_yaml);
extern std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml);