[rtems-central commit] validation: Reject more duplicates

Sebastian Huber sebh at rtems.org
Thu Mar 25 06:38:48 UTC 2021


Module:    rtems-central
Branch:    master
Commit:    e8a919e8eaf71786d831f1bc0343c0395f44b418
Changeset: http://git.rtems.org/rtems-central/commit/?id=e8a919e8eaf71786d831f1bc0343c0395f44b418

Author:    Sebastian Huber <sebastian.huber at embedded-brains.de>
Date:      Thu Mar 25 07:31:08 2021 +0100

validation: Reject more duplicates

---

 rtemsspec/validation.py | 15 ++++++++-------
 1 file changed, 8 insertions(+), 7 deletions(-)

diff --git a/rtemsspec/validation.py b/rtemsspec/validation.py
index 5a3e776..944764f 100644
--- a/rtemsspec/validation.py
+++ b/rtemsspec/validation.py
@@ -845,13 +845,14 @@ class TransitionMap:
                 Transition(desc_idx, enabled_by, skip_post_cond[0],
                            pre_cond_na, skip_post_cond[1:]))
             if transition_map[map_idx]:
-                if isinstance(enabled_by, bool) and enabled_by:
-                    raise ValueError(
-                        f"transition map descriptor {desc_idx} of "
-                        f"{self._item.spec} duplicates pre-condition set "
-                        f"{{{self._map_index_to_pre_conditions(map_idx)}}} "
-                        "defined by transition map descriptor "
-                        f"{transition_map[map_idx][0].desc_idx}")
+                for existing in transition_map[map_idx].variants:
+                    if existing.enabled_by == variant.enabled_by:
+                        raise ValueError(
+                            f"transition map descriptor {desc_idx} of "
+                            f"{self._item.spec} duplicates pre-condition set "
+                            f"{{{self._map_index_to_pre_conditions(map_idx)}}}"
+                            " defined by transition map descriptor "
+                            f"{existing.desc_idx}")
                 default = transition_map[map_idx][0]
                 if (default.post_cond, default.skip,
                         default.pre_cond_na) == (variant.post_cond,



More information about the vc mailing list