fix: add light HDI interface

Signed-off-by: mn_manan <manan19@huawei.com>
This commit is contained in:
mn_manan 2022-09-07 10:57:17 +08:00
parent 62302f956e
commit 6c500734f5
3 changed files with 28 additions and 13 deletions

View File

@ -132,13 +132,14 @@ HWTEST_F(HdfLightTest, SUB_DriverSystem_LightHdi_0120, Function | MediumTest | L
int32_t i;
int32_t ret;
struct LightEffect effect;
effect.lightBrightness = 0x00800000;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = LIGHT_FLASH_NONE;
effect.flashEffect.onTime = 0;
effect.flashEffect.offTime = 0;
for (i = 0; i < g_count; ++i) {
ret = g_lightDev->TurnOnLight(g_lightInfo[i].lightId, &effect);
EXPECT_EQ(0, ret);
@ -159,8 +160,10 @@ HWTEST_F(HdfLightTest, SUB_DriverSystem_LightHdi_0130, Function | MediumTest | L
int32_t i;
int32_t ret;
struct LightEffect effect;
effect.lightBrightness = 0x00800000;
effect.flashEffect.flashMode = LIGHT_FLASH_TIMED;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = LIGHT_FLASH_BLINK;
effect.flashEffect.onTime = g_onTime;
effect.flashEffect.offTime = g_offTime;
@ -191,7 +194,9 @@ HWTEST_F(HdfLightTest, SUB_DriverSystem_LightHdi_0140, Function | MediumTest | L
EXPECT_EQ(LIGHT_NOT_SUPPORT, ret);
for (i = 0; i < g_count; ++i) {
effect.lightBrightness = 0x00800000;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = LIGHT_FLASH_BUTT;
effect.flashEffect.onTime = g_onTime;
effect.flashEffect.offTime = g_offTime;
@ -199,7 +204,7 @@ HWTEST_F(HdfLightTest, SUB_DriverSystem_LightHdi_0140, Function | MediumTest | L
ret = g_lightDev->TurnOnLight(g_lightInfo[i].lightId, &effect);
EXPECT_EQ(LIGHT_NOT_FLASH, ret);
effect.flashEffect.flashMode = LIGHT_FLASH_TIMED;
effect.flashEffect.flashMode = LIGHT_FLASH_BLINK;
effect.flashEffect.onTime = 0;
ret = g_lightDev->TurnOnLight(g_lightInfo[i].lightId, &effect);
EXPECT_EQ(LIGHT_NOT_FLASH, ret);

View File

@ -110,7 +110,9 @@ HWTEST_F(HdfLightHdiServiceTest, SUB_DriverSystem_LightHdi_0030, Function | Medi
EXPECT_LE(iter.lightId, g_maxLightId);
HdfLightEffect effect;
effect.lightBrightness = 0x00800000;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_NONE;
int32_t ret = g_lightInterface->TurnOnLight(iter.lightId, effect);
EXPECT_EQ(HDF_SUCCESS, ret);
@ -140,7 +142,9 @@ HWTEST_F(HdfLightHdiServiceTest, SUB_DriverSystem_LightHdi_0040, Function | Medi
EXPECT_LE(iter.lightId, g_maxLightId);
HdfLightEffect effect;
effect.lightBrightness = 0x00800000;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_BUTT;
int32_t ret = g_lightInterface->TurnOnLight(iter.lightId, effect);
EXPECT_EQ(LIGHT_NOT_FLASH, ret);
@ -167,8 +171,10 @@ HWTEST_F(HdfLightHdiServiceTest, SUB_DriverSystem_LightHdi_0050, Function | Medi
EXPECT_LE(iter.lightId, g_maxLightId);
HdfLightEffect effect;
effect.lightBrightness = 0x00800000;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_TIMED;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_BLINK;
effect.flashEffect.onTime = g_onTime;
effect.flashEffect.offTime = g_offTime;
int32_t ret = g_lightInterface->TurnOnLight(iter.lightId, effect);

View File

@ -98,7 +98,9 @@ BENCHMARK_F(lightBenchmarkTest, SUB_DriverSystem_LightBenchmark_0020)(benchmark:
EXPECT_LE(iter.lightId, g_maxLightId);
HdfLightEffect effect;
effect.lightBrightness = 0x00800000;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_NONE;
int32_t ret;
for (auto _ : st) {
@ -134,8 +136,10 @@ BENCHMARK_F(lightBenchmarkTest, SUB_DriverSystem_LightBenchmark_0030)(benchmark:
EXPECT_LE(iter.lightId, g_maxLightId);
HdfLightEffect effect;
effect.lightBrightness = 0x00800000;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_TIMED;
effect.lightColor.colorValue.rgbColor.r = 255;
effect.lightColor.colorValue.rgbColor.g = 0;
effect.lightColor.colorValue.rgbColor.b = 0;
effect.flashEffect.flashMode = HDF_LIGHT_FLASH_BLINK;
effect.flashEffect.onTime = g_onTime;
effect.flashEffect.offTime = g_offTime;
int32_t ret = g_lightInterface->TurnOnLight(iter.lightId, effect);