• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright 2024 The Pigweed Authors
2 //
3 // Licensed under the Apache License, Version 2.0 (the "License"); you may not
4 // use this file except in compliance with the License. You may obtain a copy of
5 // the License at
6 //
7 //     https://www.apache.org/licenses/LICENSE-2.0
8 //
9 // Unless required by applicable law or agreed to in writing, software
10 // distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
11 // WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
12 // License for the specific language governing permissions and limitations under
13 // the License.
14 
15 #include "pw_bluetooth_sapphire/internal/host/iso/iso_common.h"
16 
17 #include "pw_unit_test/framework.h"
18 
19 namespace bt::iso {
20 
TEST(IsoCommonTest,CigCisIdentifier)21 TEST(IsoCommonTest, CigCisIdentifier) {
22   CigCisIdentifier id1(0x10, 0x11);
23   CigCisIdentifier id2(0x10, 0x12);
24   CigCisIdentifier id3(0x11, 0x10);
25   CigCisIdentifier id4(0x10, 0x10);
26   CigCisIdentifier id5(0x10, 0x11);
27 
28   EXPECT_FALSE(id1 == id2);
29   EXPECT_FALSE(id2 == id4);
30   EXPECT_FALSE(id3 == id4);
31   EXPECT_TRUE(id5 == id1);
32   EXPECT_TRUE(id1 == id5);
33   EXPECT_EQ(id1.cig_id(), 0x10);
34   EXPECT_EQ(id1.cis_id(), 0x11);
35 }
36 
37 }  // namespace bt::iso
38