Browse Source

Tools: param_metadata: check for duplicate enteries in parameter value field

c415-sdk
Rishabh 5 years ago committed by Peter Barker
parent
commit
c859287310
  1. 9
      Tools/autotest/param_metadata/param_parse.py

9
Tools/autotest/param_metadata/param_parse.py

@ -296,6 +296,15 @@ def validate(param): @@ -296,6 +296,15 @@ def validate(param):
if not is_number(max_value):
error("Max value not number: %s %s" % (param.name, max_value))
return
# Check for duplicate in @value field
if (hasattr(param, "Values")):
valueList = param.__dict__["Values"].split(",")
values = []
for i in valueList:
i = i.replace(" ","")
values.append(i.partition(":")[0])
if (len(values) != len(set(values))):
error("Duplicate values found")
# Validate units
if (hasattr(param, "Units")):
if (param.__dict__["Units"] != "") and (param.__dict__["Units"] not in known_units):

Loading…
Cancel
Save