@@ -161,11 +161,20 @@ TEST_F(PortDirectionTest, PowerSingleton) {
161161 EXPECT_TRUE (dir->isPower ());
162162}
163163
164+ TEST_F (PortDirectionTest, BiasSingleton)
165+ {
166+ PortDirection *dir = PortDirection::bias ();
167+ EXPECT_NE (dir, nullptr );
168+ EXPECT_EQ (dir->name (), " bias" );
169+ EXPECT_EQ (dir->index (), 7 );
170+ EXPECT_TRUE (dir->isBias ());
171+ }
172+
164173TEST_F (PortDirectionTest, UnknownSingleton) {
165174 PortDirection *dir = PortDirection::unknown ();
166175 EXPECT_NE (dir, nullptr );
167176 EXPECT_EQ (dir->name (), " unknown" );
168- EXPECT_EQ (dir->index (), 7 );
177+ EXPECT_EQ (dir->index (), 8 );
169178 EXPECT_TRUE (dir->isUnknown ());
170179}
171180
@@ -177,6 +186,7 @@ TEST_F(PortDirectionTest, FindByName) {
177186 EXPECT_EQ (PortDirection::find (" internal" ), PortDirection::internal ());
178187 EXPECT_EQ (PortDirection::find (" ground" ), PortDirection::ground ());
179188 EXPECT_EQ (PortDirection::find (" power" ), PortDirection::power ());
189+ EXPECT_EQ (PortDirection::find (" bias" ), PortDirection::bias ());
180190 EXPECT_EQ (PortDirection::find (" nonexistent" ), nullptr );
181191}
182192
@@ -188,6 +198,7 @@ TEST_F(PortDirectionTest, IsAnyInput) {
188198 EXPECT_FALSE (PortDirection::internal ()->isAnyInput ());
189199 EXPECT_FALSE (PortDirection::ground ()->isAnyInput ());
190200 EXPECT_FALSE (PortDirection::power ()->isAnyInput ());
201+ EXPECT_FALSE (PortDirection::bias ()->isAnyInput ());
191202 EXPECT_FALSE (PortDirection::unknown ()->isAnyInput ());
192203}
193204
@@ -199,6 +210,7 @@ TEST_F(PortDirectionTest, IsAnyOutput) {
199210 EXPECT_FALSE (PortDirection::internal ()->isAnyOutput ());
200211 EXPECT_FALSE (PortDirection::ground ()->isAnyOutput ());
201212 EXPECT_FALSE (PortDirection::power ()->isAnyOutput ());
213+ EXPECT_FALSE (PortDirection::bias ()->isAnyOutput ());
202214 EXPECT_FALSE (PortDirection::unknown ()->isAnyOutput ());
203215}
204216
@@ -210,12 +222,14 @@ TEST_F(PortDirectionTest, IsAnyTristate) {
210222 EXPECT_FALSE (PortDirection::internal ()->isAnyTristate ());
211223 EXPECT_FALSE (PortDirection::ground ()->isAnyTristate ());
212224 EXPECT_FALSE (PortDirection::power ()->isAnyTristate ());
225+ EXPECT_FALSE (PortDirection::bias ()->isAnyTristate ());
213226 EXPECT_FALSE (PortDirection::unknown ()->isAnyTristate ());
214227}
215228
216229TEST_F (PortDirectionTest, IsPowerGround) {
217230 EXPECT_TRUE (PortDirection::power ()->isPowerGround ());
218231 EXPECT_TRUE (PortDirection::ground ()->isPowerGround ());
232+ EXPECT_TRUE (PortDirection::bias ()->isPowerGround ());
219233 EXPECT_FALSE (PortDirection::input ()->isPowerGround ());
220234 EXPECT_FALSE (PortDirection::output ()->isPowerGround ());
221235 EXPECT_FALSE (PortDirection::tristate ()->isPowerGround ());
@@ -851,6 +865,7 @@ TEST(PortDirectionExtraTest, AllDirections) {
851865 EXPECT_NE (PortDirection::internal (), nullptr );
852866 EXPECT_NE (PortDirection::ground (), nullptr );
853867 EXPECT_NE (PortDirection::power (), nullptr );
868+ EXPECT_NE (PortDirection::bias (), nullptr );
854869 EXPECT_NE (PortDirection::unknown (), nullptr );
855870}
856871
@@ -873,6 +888,7 @@ TEST(PortDirectionExtraTest, DirectionProperties) {
873888
874889 EXPECT_TRUE (PortDirection::ground ()->isPowerGround ());
875890 EXPECT_TRUE (PortDirection::power ()->isPowerGround ());
891+ EXPECT_TRUE (PortDirection::bias ()->isPowerGround ());
876892}
877893
878894TEST (PortDirectionExtraTest, DirectionNames) {
@@ -886,6 +902,7 @@ TEST(PortDirectionExtraTest, DirectionNames) {
886902 EXPECT_EQ (PortDirection::internal ()->name (), " internal" );
887903 EXPECT_EQ (PortDirection::ground ()->name (), " ground" );
888904 EXPECT_EQ (PortDirection::power ()->name (), " power" );
905+ EXPECT_EQ (PortDirection::bias ()->name (), " bias" );
889906 EXPECT_EQ (PortDirection::unknown ()->name (), " unknown" );
890907}
891908
@@ -900,6 +917,7 @@ TEST(PortDirectionExtraTest, FindAllByName) {
900917 EXPECT_EQ (PortDirection::find (" internal" ), PortDirection::internal ());
901918 EXPECT_EQ (PortDirection::find (" ground" ), PortDirection::ground ());
902919 EXPECT_EQ (PortDirection::find (" power" ), PortDirection::power ());
920+ EXPECT_EQ (PortDirection::find (" bias" ), PortDirection::bias ());
903921 // "unknown" is not findable by name, returns nullptr
904922 EXPECT_EQ (PortDirection::find (" nonexistent" ), nullptr );
905923}
0 commit comments