1 /*
2  * Copyright 2023 Google LLC
3  *
4  * SPDX-License-Identifier: Apache-2.0
5  */
6 
7 #include <stdbool.h>
8 #include <zephyr/device.h>
9 #include <zephyr/drivers/fuel_gauge.h>
10 #include <zephyr/drivers/emul_fuel_gauge.h>
11 #include <zephyr/ztest.h>
12 #include <zephyr/ztest_assert.h>
13 
14 #include "test_sbs_gauge.h"
15 
ZTEST_F(sbs_gauge_new_api,test_cutoff_disabled)16 ZTEST_F(sbs_gauge_new_api, test_cutoff_disabled)
17 {
18 	bool is_cutoff;
19 
20 	/* Initially there should be no cutoff */
21 	zassert_ok(emul_fuel_gauge_is_battery_cutoff(fixture->sbs_fuel_gauge, &is_cutoff));
22 	zassert_false(is_cutoff);
23 
24 	zassert_not_equal(fuel_gauge_battery_cutoff(fixture->dev), 0);
25 
26 	/* We confirm there was no cutoff */
27 	zassert_ok(emul_fuel_gauge_is_battery_cutoff(fixture->sbs_fuel_gauge, &is_cutoff));
28 	zassert_false(is_cutoff);
29 }
30