From 13f1e8ca409f6510a2551e281cbfa33e5b544c5a Mon Sep 17 00:00:00 2001 From: Frederik Hennig <frederik.hennig@fau.de> Date: Mon, 17 Feb 2025 18:34:06 +0100 Subject: [PATCH] fix test suite --- src/pystencilssfg/ir/entities.py | 6 ++++++ tests/generator_scripts/source/Conditionals.py | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/pystencilssfg/ir/entities.py b/src/pystencilssfg/ir/entities.py index d97e810..8d79825 100644 --- a/src/pystencilssfg/ir/entities.py +++ b/src/pystencilssfg/ir/entities.py @@ -343,6 +343,8 @@ class SfgMethod(SfgClassMember, CommonFunctionProperties): ): super().__init__(cls) + self._name = name + from .postprocessing import CallTreePostProcessing param_collector = CallTreePostProcessing() @@ -363,6 +365,10 @@ class SfgMethod(SfgClassMember, CommonFunctionProperties): attributes, ) + @property + def name(self) -> str: + return self._name + @property def static(self) -> bool: return self._static diff --git a/tests/generator_scripts/source/Conditionals.py b/tests/generator_scripts/source/Conditionals.py index 9016b73..6c24908 100644 --- a/tests/generator_scripts/source/Conditionals.py +++ b/tests/generator_scripts/source/Conditionals.py @@ -22,7 +22,7 @@ with SourceFileGenerator() as sfg: ) ) - sfg.function("getRating", "int32")( + sfg.function("getRating").returns("int32")( sfg.switch(noodle, autobreak=False) .case("Noodles::RIGATONI")( "return 13;" @@ -39,7 +39,7 @@ with SourceFileGenerator() as sfg: "return 0;" ) - sfg.function("isItalian", return_type="bool")( + sfg.function("isItalian").returns("bool")( sfg.branch( sfg.expr("{0} == Noodles::RIGATONI || {0} == Noodles::SPAGHETTI", noodle) )( -- GitLab