check for already existing enum value added; added test (#1453)

* check for already existing enum value added; added test

* added enum value name to exception message

* test for defining enum with multiple identical names moved to test_enum.cpp/py
This commit is contained in:
Krzysztof Fornalczyk
2018-09-11 10:59:56 +02:00
committed by Wenzel Jakob
parent 35c82c7250
commit 5c8746ff13
3 changed files with 24 additions and 1 deletions

View File

@@ -148,3 +148,9 @@ def test_enum_to_int():
m.test_enum_to_uint(m.ClassWithUnscopedEnum.EMode.EFirstMode)
m.test_enum_to_long_long(m.Flags.Read)
m.test_enum_to_long_long(m.ClassWithUnscopedEnum.EMode.EFirstMode)
def test_duplicate_enum_name():
with pytest.raises(ValueError) as excinfo:
m.register_bad_enum()
assert str(excinfo.value) == "Enum error - element with name: ONE already exists"