Skip to content

Commit 5657c8d

Browse files
authored
Merge pull request #1981 from peternewman/uint64-type
Check if an interface is listed multiple times in LIST_INTERFACES
2 parents 597672a + cf52b2a commit 5657c8d

3 files changed

Lines changed: 16 additions & 0 deletions

File tree

common/utils/StringUtils.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -488,18 +488,22 @@ void CapitalizeLabel(string *s) {
488488
void CustomCapitalizeLabel(string *s) {
489489
// Remember to update the Doxygen in include/ola/StringUtils.h too
490490
static const char* const transforms[] = {
491+
"asc",
491492
"dhcp",
492493
"dmx",
493494
"dns",
494495
"ip",
495496
"ipv4", // Should really be IPv4 probably, but better than nothing
496497
"ipv6", // Should really be IPv6 probably, but better than nothing
498+
"json",
497499
"led",
498500
"mdmx", // City Theatrical, should really be mDMX, but better than nothing
501+
"nsc",
499502
"pdl",
500503
"pid",
501504
"rdm",
502505
"uid",
506+
"url",
503507
NULL
504508
};
505509
const size_t size = s->size();

include/ola/StringUtils.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -490,16 +490,20 @@ void CapitalizeLabel(std::string *s);
490490
*
491491
* @param s a string to transform.
492492
* The following are capitalized:
493+
* - asc
493494
* - dhcp
494495
* - dmx
495496
* - dns
496497
* - ip
497498
* - ipv4
498499
* - ipv6
500+
* - json
499501
* - led
500502
* - mdmx
503+
* - nsc
501504
* - rdm
502505
* - uid
506+
* - url
503507
*/
504508
void CustomCapitalizeLabel(std::string *s);
505509

tools/rdm/TestDefinitions.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7280,9 +7280,11 @@ def VerifyResult(self, response, fields):
72807280
return
72817281

72827282
interfaces = []
7283+
count_by_interface = {}
72837284

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

7302+
# Check for duplicate interfaces
7303+
for interface, count in count_by_interface.items():
7304+
if count > 1:
7305+
self.AddAdvisory('Interface %s listed %d times in list interfaces' %
7306+
(interface, count))
7307+
73007308
self.SetProperty(self.PROVIDES[0], interfaces)
73017309

73027310

0 commit comments

Comments
 (0)