@@ -3074,6 +3074,33 @@ TEST_F(HdmiCecSink_L2Test, InjectGetCECVersionFrame)
3074
3074
}
3075
3075
}
3076
3076
3077
+ TEST_F (HdmiCecSink_L2Test, InjectGetCECVersionFrameroadcastIgnoreTest)
3078
+ {
3079
+ // No event is fired, plugin should send CECVersion in response
3080
+ uint8_t buffer[] = { 0x4F , 0x9F }; // From device 4 to broadcast
3081
+ CECFrame frame (buffer, sizeof (buffer));
3082
+ for (auto * listener : listeners) {
3083
+ if (listener)
3084
+ listener->notify (frame);
3085
+ }
3086
+ }
3087
+
3088
+ TEST_F (HdmiCecSink_L2Test, InjectGetCECVersionFrameException)
3089
+ {
3090
+ EXPECT_CALL (*p_connectionMock, sendToAsync (::testing::_, ::testing::_))
3091
+ .WillRepeatedly (::testing::Invoke (
3092
+ [&](const LogicalAddress& to, const CECFrame& frame) {
3093
+ throw Exception ();
3094
+ }));
3095
+ // No event is fired, plugin should send CECVersion in response
3096
+ uint8_t buffer[] = { 0x40 , 0x9F }; // From device 4 to TV (0)
3097
+ CECFrame frame (buffer, sizeof (buffer));
3098
+ for (auto * listener : listeners) {
3099
+ if (listener)
3100
+ listener->notify (frame);
3101
+ }
3102
+ }
3103
+
3077
3104
// GiveOSDName (0x46)
3078
3105
TEST_F (HdmiCecSink_L2Test, InjectGiveOSDNameFrame)
3079
3106
{
@@ -3123,6 +3150,23 @@ TEST_F(HdmiCecSink_L2Test, InjectGivePhysicalAddressFrame)
3123
3150
}
3124
3151
}
3125
3152
3153
+ TEST_F (HdmiCecSink_L2Test, InjectGivePhysicalAddressFrameException)
3154
+ {
3155
+ EXPECT_CALL (*p_connectionMock, sendTo (::testing::_, ::testing::_))
3156
+ .WillRepeatedly (::testing::Invoke (
3157
+ [&](const LogicalAddress& to, const CECFrame& frame) {
3158
+ throw Exception ();
3159
+ }));
3160
+
3161
+ uint8_t buffer[] = { 0x40 , 0x83 }; // From device 4 to TV (0)
3162
+ CECFrame frame (buffer, sizeof (buffer));
3163
+ for (auto * listener : listeners) {
3164
+ if (listener)
3165
+ listener->notify (frame);
3166
+ }
3167
+ }
3168
+
3169
+
3126
3170
// GiveDeviceVendorID (0x8C)
3127
3171
TEST_F (HdmiCecSink_L2Test, InjectGiveDeviceVendorIDFrame)
3128
3172
{
@@ -3373,11 +3417,6 @@ TEST_F(HdmiCecSink_L2Test, InjectGiveFeaturesFrame)
3373
3417
3374
3418
TEST_F (HdmiCecSink_L2Test, InjectGiveFeaturesFrameBroadcastIgnoreTest)
3375
3419
{
3376
- EXPECT_CALL (*p_connectionMock, sendToAsync (::testing::_, ::testing::_))
3377
- .WillRepeatedly (::testing::Invoke (
3378
- [&](const LogicalAddress& to, const CECFrame& frame) {
3379
- throw Exception ();
3380
- }));
3381
3420
3382
3421
// Simulate a CECVersion message from logical address 4 to us (0)
3383
3422
uint8_t buffer1[] = { 0x40 , 0x9E , 0x06 }; // 0x06 = Version 2.0
@@ -3387,6 +3426,12 @@ TEST_F(HdmiCecSink_L2Test, InjectGiveFeaturesFrameBroadcastIgnoreTest)
3387
3426
listener->notify (frame1);
3388
3427
}
3389
3428
3429
+ EXPECT_CALL (*p_connectionMock, sendToAsync (::testing::_, ::testing::_))
3430
+ .WillRepeatedly (::testing::Invoke (
3431
+ [&](const LogicalAddress& to, const CECFrame& frame) {
3432
+ throw Exception ();
3433
+ }));
3434
+
3390
3435
uint8_t buffer2[] = { 0x4F , 0xA5 }; // From device 4 to TV (0)
3391
3436
CECFrame frame2 (buffer2, sizeof (buffer2));
3392
3437
for (auto * listener : listeners) {
0 commit comments