Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions common/utils/StringUtils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -488,18 +488,22 @@ void CapitalizeLabel(string *s) {
void CustomCapitalizeLabel(string *s) {
// Remember to update the Doxygen in include/ola/StringUtils.h too
static const char* const transforms[] = {
"asc",
"dhcp",
"dmx",
"dns",
"ip",
"ipv4", // Should really be IPv4 probably, but better than nothing
"ipv6", // Should really be IPv6 probably, but better than nothing
"json",
"led",
"mdmx", // City Theatrical, should really be mDMX, but better than nothing
"nsc",
"pdl",
"pid",
"rdm",
"uid",
"url",
NULL
};
const size_t size = s->size();
Expand Down
4 changes: 4 additions & 0 deletions include/ola/StringUtils.h
Original file line number Diff line number Diff line change
Expand Up @@ -490,16 +490,20 @@ void CapitalizeLabel(std::string *s);
*
* @param s a string to transform.
* The following are capitalized:
* - asc
* - dhcp
* - dmx
* - dns
* - ip
* - ipv4
* - ipv6
* - json
* - led
* - mdmx
* - nsc
* - rdm
* - uid
* - url
*/
void CustomCapitalizeLabel(std::string *s);

Expand Down
8 changes: 8 additions & 0 deletions tools/rdm/TestDefinitions.py
Original file line number Diff line number Diff line change
Expand Up @@ -7280,9 +7280,11 @@ def VerifyResult(self, response, fields):
return

interfaces = []
count_by_interface = {}

for interface in fields['interfaces']:
interface_id = interface['interface_identifier']
count_by_interface[interface_id] = count_by_interface.get(interface_id, 0) + 1
if (interface_id < RDM_INTERFACE_INDEX_MIN or
interface_id > RDM_INTERFACE_INDEX_MAX):
self.AddWarning('Interface index %d is outside allowed range (%d to '
Expand All @@ -7297,6 +7299,12 @@ def VerifyResult(self, response, fields):
'interface %d' %
(interface['interface_hardware_type'], interface_id))

# Check for duplicate interfaces
for interface, count in count_by_interface.items():
if count > 1:
self.AddAdvisory('Interface %s listed %d times in list interfaces' %
(interface, count))

self.SetProperty(self.PROVIDES[0], interfaces)


Expand Down
Loading