[rtems-central commit] validation: Fix N/A scope description
Sebastian Huber
sebh at rtems.org
Fri Aug 7 09:12:43 UTC 2020
Module: rtems-central
Branch: master
Commit: a5814469ab20fe3c19fc64d96521b004e7e7229e
Changeset: http://git.rtems.org/rtems-central/commit/?id=a5814469ab20fe3c19fc64d96521b004e7e7229e
Author: Sebastian Huber <sebastian.huber at embedded-brains.de>
Date: Tue Aug 4 12:01:59 2020 +0200
validation: Fix N/A scope description
---
rtemsspec/tests/test_validation.py | 15 ++++++++++-----
rtemsspec/validation.py | 6 ++++--
2 files changed, 14 insertions(+), 7 deletions(-)
diff --git a/rtemsspec/tests/test_validation.py b/rtemsspec/tests/test_validation.py
index 32402fe..7c7c242 100644
--- a/rtemsspec/tests/test_validation.py
+++ b/rtemsspec/tests/test_validation.py
@@ -246,7 +246,8 @@ static ClassicTaskIdentification_Context
static const char * const ClassicTaskIdentification_PreDesc_Name[] = {
"Invalid",
"Self",
- "Valid"
+ "Valid",
+ "NA"
};
static const char * const ClassicTaskIdentification_PreDesc_Node[] = {
@@ -255,12 +256,14 @@ static const char * const ClassicTaskIdentification_PreDesc_Node[] = {
"Invalid",
"SearchAll",
"SearchOther",
- "SearchLocal"
+ "SearchLocal",
+ "NA"
};
static const char * const ClassicTaskIdentification_PreDesc_Id[] = {
"NullPtr",
- "Valid"
+ "Valid",
+ "NA"
};
static const char * const * const ClassicTaskIdentification_PreDesc[] = {
@@ -1195,13 +1198,15 @@ static Action2_Context
static const char * const Action2_PreDesc_A[] = {
"X",
- "Y"
+ "Y",
+ "NA"
};
static const char * const Action2_PreDesc_B[] = {
"X",
"Y",
- "Z"
+ "Z",
+ "NA"
};
static const char * const * const Action2_PreDesc[] = {
diff --git a/rtemsspec/validation.py b/rtemsspec/validation.py
index d617cf7..cf3053a 100644
--- a/rtemsspec/validation.py
+++ b/rtemsspec/validation.py
@@ -286,8 +286,10 @@ class _TestDirectiveItem(_TestItem):
content.add("static const char * const "
f"{self.ident}_PreDesc_{condition['name']}[] = {{")
with content.indent():
- content.add(",\n".join(f"\"{state['name']}\""
- for state in condition["states"]))
+ content.add(",\n".join(
+ itertools.chain((f"\"{state['name']}\""
+ for state in condition["states"]),
+ ["\"NA\""])))
content.add("};")
content.add("static const char * const * const "
f"{self.ident}_PreDesc[] = {{")
More information about the vc
mailing list