Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit e72495de authored by Jakub Tyszkowski's avatar Jakub Tyszkowski Committed by Łukasz Rymanowski
Browse files

LeAudio/Broadcast: Fix comparing vendor codec configurations

Move the data buffer access under the check for having the optional data.

Bug: 340844959
Test: atest bluetooth_test_broadcaster
Flag: EXEMPT; Trivial fix covered by the unit test
Change-Id: Idd86b6392025f826ca283fce9b23425a7a347307
parent 184d3f94
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -939,6 +939,11 @@ static const broadcaster::BroadcastConfiguration vendor_stereo_16_2_1 = {
    .framing = 1,  // Framed
};

TEST_F(BroadcasterTest, SanityTest) {
  ASSERT_EQ(broadcaster::lc3_mono_16_2_1, broadcaster::lc3_mono_16_2_1);
  ASSERT_EQ(vendor_stereo_16_2_1, vendor_stereo_16_2_1);
}

TEST_F(BroadcasterTest, VendorCodecConfig) {
  ConfigCodecManagerMock(types::CodecLocation::HOST);

+7 −6
Original line number Diff line number Diff line
@@ -126,7 +126,7 @@ struct BroadcastSubgroupCodecConfig {

    if (subgroup_vendor_codec_config_.has_value()) {
      if (subgroup_vendor_codec_config_->size() !=
          other.subgroup_vendor_codec_config_->size())
          other.subgroup_vendor_codec_config_->size()) {
        return false;
      }

@@ -135,6 +135,7 @@ struct BroadcastSubgroupCodecConfig {
                      subgroup_vendor_codec_config_->size())) {
        return false;
      }
    }

    return (codec_id_ == other.codec_id_) &&
           (bis_codec_configs_ == other.bis_codec_configs_) &&