Fixs Mac address containing non-hex digit.

PiperOrigin-RevId: 536562911
This commit is contained in:
Edwin Wu
2023-05-30 18:20:30 -07:00
committed by Copybara-Service
parent 72f74f3698
commit 6060bc1856
2 changed files with 9 additions and 5 deletions
@@ -82,6 +82,10 @@ TEST(BluetoothUtilsTest, InvalidStringReturnsEmptyByteArray) {
std::string bad_bt_mac_address_4 = "BLUETOOTHCHIP";
bytes_result = BluetoothUtils::FromString(bad_bt_mac_address_4);
EXPECT_TRUE(bytes_result.Empty());
std::string bad_bt_mac_address_5 = "G1:F2:F3:F4:F5:F6";
bytes_result = BluetoothUtils::FromString(bad_bt_mac_address_5);
EXPECT_TRUE(bytes_result.Empty());
}
TEST(BluetoothUtilsTest, FromNumber) {