From da270b2ac4b6f19f4ee9862aef17a12267c6a26a Mon Sep 17 00:00:00 2001 From: Olivier Dion <olivier.dion@savoirfairelinux.com> Date: Fri, 15 Oct 2021 10:27:34 -0400 Subject: [PATCH] agent/utils: Add to_guile::operator int() Change-Id: I12a30be4d77574f66bd6fc207cfee501bdb41bfa --- test/agent/src/utils.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/agent/src/utils.h b/test/agent/src/utils.h index be2d82b9f2..9b00d06eb4 100644 --- a/test/agent/src/utils.h +++ b/test/agent/src/utils.h @@ -116,6 +116,13 @@ struct from_guile return scm_to_bool(value); } + operator int() + { + AGENT_ASSERT(scm_is_integer(value), "Scheme value must be of type integer"); + + return scm_to_int(value); + } + operator std::string() { AGENT_ASSERT(scm_is_string(value), "Scheme value must be of type string"); -- GitLab