-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🚚 (drivers): Rename remove LK prefix from LKCoreBattery driver
Rename LKCoreBattery to CoreBattery
- Loading branch information
Showing
9 changed files
with
59 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// Leka - LekaOS | ||
// Copyright 2021 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#include "CoreBattery.h" | ||
|
||
#include "gtest/gtest.h" | ||
#include "stubs/mbed/AnalogIn.h" | ||
|
||
using namespace leka; | ||
|
||
CoreBattery corebattery(PinName::BATTERY_VOLTAGE); | ||
|
||
float test_set_Voltage(float value) | ||
{ | ||
spy_AnalogIn_setValue(value); | ||
return value; | ||
} | ||
|
||
TEST(CoreBatteryTest, initialization) | ||
{ | ||
ASSERT_NE(&corebattery, nullptr); | ||
} | ||
|
||
TEST(CoreBatteryTest, readMinVoltage) | ||
{ | ||
auto expected = test_set_Voltage(0.0f); | ||
|
||
ASSERT_EQ(expected, corebattery.readVoltage()); | ||
} | ||
|
||
TEST(CoreBatteryTest, readMiddleVoltage) | ||
{ | ||
auto expected = test_set_Voltage(0.25f); | ||
|
||
ASSERT_EQ(expected, corebattery.readVoltage()); | ||
} | ||
|
||
TEST(CoreBatteryTest, readMaxVoltage) | ||
{ | ||
auto expected = test_set_Voltage(1.0f); | ||
|
||
ASSERT_EQ(expected, corebattery.readVoltage()); | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters