summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-11 17:15:17 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2020-09-11 17:25:23 +0200
commitfc32261c208546ed7af52aaba04354553080cccb (patch)
tree281a8a4a101ef65d0e745f1596e0e6383ebeb988
parent82ee7cecf052ce11dbfe0e05719c44744b906ecc (diff)
downloadrtems-central-fc32261c208546ed7af52aaba04354553080cccb.tar.bz2
validation: Use call_function()
-rw-r--r--rtemsspec/tests/test_validation.py15
-rw-r--r--rtemsspec/validation.py15
2 files changed, 12 insertions, 18 deletions
diff --git a/rtemsspec/tests/test_validation.py b/rtemsspec/tests/test_validation.py
index 9aaafff..da73527 100644
--- a/rtemsspec/tests/test_validation.py
+++ b/rtemsspec/tests/test_validation.py
@@ -806,10 +806,7 @@ T_TEST_CASE_FIXTURE( Directive, &Directive_Fixture )
ctx,
Directive_TransitionMap[ index ][ 0 ]
);
- Directive_Post_Id_Check(
- ctx,
- Directive_TransitionMap[ index ][ 1 ]
- );
+ Directive_Post_Id_Check( ctx, Directive_TransitionMap[ index ][ 1 ] );
++index;
}
}
@@ -1726,14 +1723,8 @@ void Action2_Run( int *a, int b, int *c )
Action2_Pre_A_Prepare( ctx, ctx->pcs[ 0 ] );
Action2_Pre_B_Prepare( ctx, ctx->pcs[ 1 ] );
Action2_Action( ctx );
- Action2_Post_A_Check(
- ctx,
- Action2_TransitionMap[ index ][ 0 ]
- );
- Action2_Post_B_Check(
- ctx,
- Action2_TransitionMap[ index ][ 1 ]
- );
+ Action2_Post_A_Check( ctx, Action2_TransitionMap[ index ][ 0 ] );
+ Action2_Post_B_Check( ctx, Action2_TransitionMap[ index ][ 1 ] );
Action2_Cleanup( ctx );
++index;
}
diff --git a/rtemsspec/validation.py b/rtemsspec/validation.py
index a9b3850..4154588 100644
--- a/rtemsspec/validation.py
+++ b/rtemsspec/validation.py
@@ -554,7 +554,8 @@ class _TestDirectiveItem(_TestItem):
def _add_call(self, content: CContent, key: str, name: str) -> None:
if self[key] is not None:
- content.append(f"{self.ident}_{name}( ctx );")
+ content.gap = False
+ content.call_function(None, f"{self.ident}_{name}", ["ctx"])
def _add_loop_body(self, content: CContent) -> None:
with content.condition(f"{self.ident}_TransitionInfo[ index ].Skip"):
@@ -562,14 +563,16 @@ class _TestDirectiveItem(_TestItem):
content.add_blank_line()
self._add_call(content, "test-prepare", "Prepare")
for index, enum in enumerate(self._pre_index_to_enum):
- content.append(f"{enum[0]}_Prepare( ctx, ctx->pcs[ {index} ] );")
+ content.gap = False
+ content.call_function(None, f"{enum[0]}_Prepare",
+ ["ctx", f"ctx->pcs[ {index} ]"])
self._add_call(content, "test-action", "Action")
transition_map = f"{self.ident}_TransitionMap"
for index, enum in enumerate(self._post_index_to_enum):
- content.append([
- f"{enum[0]}_Check(", " ctx,",
- f" {transition_map}[ index ][ {index} ]", ");"
- ])
+ content.gap = False
+ content.call_function(
+ None, f"{enum[0]}_Check",
+ ["ctx", f"{transition_map}[ index ][ {index} ]"])
self._add_call(content, "test-cleanup", "Cleanup")
content.append("++index;")