From e2f7a9235f111fa07b4978b1fe809087c4dcc2f4 Mon Sep 17 00:00:00 2001 From: Frediano Ziglio Date: Mon, 14 May 2018 23:12:03 +0100 Subject: [PATCH] Check for messages with duplicate names inside a channel Make sure there are not 2 messages with the same name in the same channel. Signed-off-by: Frediano Ziglio Acked-by: Christophe Fergeau --- python_modules/ptypes.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/python_modules/ptypes.py b/python_modules/ptypes.py index 631739e..916ba50 100644 --- a/python_modules/ptypes.py +++ b/python_modules/ptypes.py @@ -1055,6 +1055,8 @@ class ChannelType(Type): m.value = info.count info.count = m.value + 1 info.messages.append(m) + if m.name in info.messages_byname: + raise Exception("Duplicated message name '%s' in channel '%s'" % (m.name, self.name)) info.messages_byname[m.name] = m self.server_messages = server_info.messages