Skip to content
Snippets Groups Projects
Commit 3bbac872 authored by Aline Gondim Santos's avatar Aline Gondim Santos
Browse files

fix: ut and agents

Change-Id: I3b9fd9da90d153b2b4ce8254fa14216ea87eb7bd
parent 737e2f11
No related branches found
No related tags found
No related merge requests found
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
#pragma once #pragma once
#include <cstdint> #include <cstdint>
#include <filesystem>
#include "logger.h" #include "logger.h"
...@@ -211,6 +212,15 @@ struct from_guile ...@@ -211,6 +212,15 @@ struct from_guile
return ret; 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> template<typename T>
operator std::vector<T>() operator std::vector<T>()
{ {
......
...@@ -182,7 +182,7 @@ load_actors(const std::filesystem::path& from_yaml) ...@@ -182,7 +182,7 @@ load_actors(const std::filesystem::path& from_yaml)
std::map<std::string, std::string> std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml) 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; std::vector<std::string> wait_for;
......
...@@ -24,6 +24,8 @@ ...@@ -24,6 +24,8 @@
#include <cstdint> #include <cstdint>
#include <map> #include <map>
#include <string> #include <string>
#include <filesystem>
#include <vector>
constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30; constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30;
constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30; constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30;
...@@ -45,7 +47,7 @@ wait_for_removal_of(const std::string& account, ...@@ -45,7 +47,7 @@ wait_for_removal_of(const std::string& account,
std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT)); std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT));
extern std::map<std::string, std::string> 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> extern std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml); load_actors_and_wait_for_announcement(const std::string& from_yaml);
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
#include <cstdint> #include <cstdint>
#include <map> #include <map>
#include <string> #include <string>
#include <filesystem>
constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30; constexpr size_t WAIT_FOR_ANNOUNCEMENT_TIMEOUT = 30;
constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30; constexpr size_t WAIT_FOR_REMOVAL_TIMEOUT = 30;
...@@ -45,7 +46,7 @@ wait_for_removal_of(const std::string& account, ...@@ -45,7 +46,7 @@ wait_for_removal_of(const std::string& account,
std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT)); std::chrono::seconds timeout = std::chrono::seconds(WAIT_FOR_REMOVAL_TIMEOUT));
extern std::map<std::string, std::string> 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> extern std::map<std::string, std::string>
load_actors_and_wait_for_announcement(const std::string& from_yaml); load_actors_and_wait_for_announcement(const std::string& from_yaml);
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment