Skip to content

Commit cff6dc4

Browse files
Fix TestConfigurationMgr to have correct expectations.
1 parent 0f05535 commit cff6dc4

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/platform/tests/TestConfigurationMgr.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -389,10 +389,17 @@ TEST_F(TestConfigurationMgr, GetPrimaryMACAddress)
389389
MutableByteSpan mac6Bytes(macBuffer6Bytes);
390390

391391
err = ConfigurationMgr().GetPrimaryMACAddress(mac8Bytes);
392-
if (mac8Bytes.size() != ConfigurationManager::kPrimaryMACAddressLength)
392+
if (sizeof(macBuffer8Bytes) != ConfigurationManager::kPrimaryMACAddressLength)
393393
{
394+
// Should have failed input validation
394395
EXPECT_EQ(err, CHIP_ERROR_INVALID_ARGUMENT);
395396
}
397+
else if (mac8Bytes.size() != ConfigurationManager::kPrimaryMACAddressLength)
398+
{
399+
// This can happen if the primary address is Thread but then there is no
400+
// Thread address to be had and we fell back to Wi-Fi.
401+
EXPECT_EQ(mac8Bytes.size(), ConfigurationManager::kEthernetMACAddressLength);
402+
}
396403

397404
err = ConfigurationMgr().GetPrimaryMACAddress(mac6Bytes);
398405
if (mac6Bytes.size() != ConfigurationManager::kPrimaryMACAddressLength)

0 commit comments

Comments
 (0)