Commit d76cebc3 authored by Michael Büsch's avatar Michael Büsch

enum: Add assertion for itemAt sequence

Signed-off-by: Michael Büsch's avatarMichael Buesch <m@bues.ch>
parent d1a91007
......@@ -2,7 +2,7 @@
#
# AWL simulator - utility functions
#
# Copyright 2012-2013 Michael Buesch <m@bues.ch>
# Copyright 2012-2015 Michael Buesch <m@bues.ch>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
......@@ -68,6 +68,7 @@ class MagicEnumerationGenerator(object):
def itemAt(self, number):
assert(self.__num is not None)
assert(number >= self.__num)
self.__num = number + 1
return number
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment