tests: drivers: sbs_gauge: Include additional properties

Include tests for Fuel Gauge mode, status, charge current,
charge voltage, design capacity and design voltage.

Signed-off-by: Rajavardhan Gundi <rajavardhan.gundi@intel.com>
This commit is contained in:
Rajavardhan Gundi 2023-02-10 19:46:43 +05:30 committed by Anas Nashif
parent 09d8123d0a
commit c71ab5699a
2 changed files with 22 additions and 0 deletions

View file

@ -72,6 +72,10 @@ static int emul_sbs_gauge_reg_read(const struct emul *target, int reg, int *val)
case SBS_GAUGE_CMD_CYCLE_COUNT:
case SBS_GAUGE_CMD_DESIGN_VOLTAGE:
case SBS_GAUGE_CMD_CURRENT:
case SBS_GAUGE_CMD_BATTERY_MODE:
case SBS_GAUGE_CMD_CHG_CURRENT:
case SBS_GAUGE_CMD_CHG_VOLTAGE:
case SBS_GAUGE_CMD_FLAGS:
/* Arbitrary stub value. */
*val = 1;
break;

View file

@ -199,6 +199,24 @@ ZTEST_F(sbs_gauge_new_api, test_get_props__returns_ok)
{
.property_type = FUEL_GAUGE_SBS_MFR_ACCESS,
},
{
.property_type = FUEL_GAUGE_MODE,
},
{
.property_type = FUEL_GAUGE_CHARGE_CURRENT,
},
{
.property_type = FUEL_GAUGE_CHARGE_VOLTAGE,
},
{
.property_type = FUEL_GAUGE_STATUS,
},
{
.property_type = FUEL_GAUGE_DESIGN_CAPACITY,
},
{
.property_type = FUEL_GAUGE_DESIGN_VOLTAGE,
},
};
int ret = fixture->api->get_property(fixture->dev, props, ARRAY_SIZE(props));