32TEST(UltraPython, setBrightness_absolute_ok) {
36 helper.setStepPeriod(100);
38 struct v4l2_control control1;
39 control1.id = V4L2_CID_BRIGHTNESS;
41 EXPECT_CALL(*interface, ioctl_query_c(_, _, _))
44 EXPECT_CALL(*interface, ioctl_control_c(_, VIDIOC_S_CTRL, control1)).Times(2);
47 bool res = helper.setControl(V4L2_CID_BRIGHTNESS, 20,
true);
55TEST(UltraPython, setBrightness_relative_ok) {
59 helper.setStepPeriod(100);
64 struct v4l2_control control1;
65 control1.id = V4L2_CID_BRIGHTNESS;
67 EXPECT_CALL(*interface, ioctl_query_c(_, VIDIOC_QUERYCTRL, _))
68 .WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1)))
69 .WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1)));
70 EXPECT_CALL(*interface, ioctl_control_c(_, VIDIOC_S_CTRL, control1)).Times(2);
73 bool res = helper.setControl(V4L2_CID_BRIGHTNESS, 0.50,
false);
82TEST(UltraPython, getBrithness_relative_ok)
87 helper.setStepPeriod(100);
93 struct v4l2_control control1;
94 control1.id = V4L2_CID_BRIGHTNESS;
97 EXPECT_CALL(*interface, ioctl_query_c(_, VIDIOC_QUERYCTRL, _)).
98 WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1))).
99 WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1)));
100 EXPECT_CALL(*interface, ioctl_control_c(_, VIDIOC_G_CTRL, _)).
101 WillOnce(DoAll(SetArgReferee<2>(control1), Return(1))).
102 WillOnce(DoAll(SetArgReferee<2>(control1), Return(1)));
105 double res = helper.getControl(V4L2_CID_BRIGHTNESS,
false);
114TEST(UltraPython, getBrithness_absolute_ok)
119 helper.setStepPeriod(100);
125 struct v4l2_control control1;
126 control1.id = V4L2_CID_BRIGHTNESS;
129 EXPECT_CALL(*interface, ioctl_query_c(_, VIDIOC_QUERYCTRL, _)).
130 WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1))).
131 WillOnce(DoAll(SetArgReferee<2>(
queryctrl), Return(1)));
132 EXPECT_CALL(*interface, ioctl_control_c(_, VIDIOC_G_CTRL, _)).
133 WillOnce(DoAll(SetArgReferee<2>(control1), Return(1))).
134 WillOnce(DoAll(SetArgReferee<2>(control1), Return(1)));
137 double res = helper.getControl(V4L2_CID_BRIGHTNESS,
true);