Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4d924977 authored by Steven Moreland's avatar Steven Moreland
Browse files

boot 'Hidl' test is actually 'Aidl'

Confusing names.

Bug: N/A
Test: N/A
Change-Id: Iaace7aa33dbbda1f390fa6506d76ba5a76a6f377
parent 1d11ba4c
Loading
Loading
Loading
Loading
+11 −11
Original line number Original line Diff line number Diff line
@@ -33,7 +33,7 @@ using std::string;
using std::unordered_set;
using std::unordered_set;


// The main test class for the Boot HIDL HAL.
// The main test class for the Boot HIDL HAL.
class BootHidlTest : public ::testing::TestWithParam<std::string> {
class BootAidlTest : public ::testing::TestWithParam<std::string> {
  public:
  public:
    virtual void SetUp() override {
    virtual void SetUp() override {
        const auto instance_name = GetParam();
        const auto instance_name = GetParam();
@@ -48,14 +48,14 @@ class BootHidlTest : public ::testing::TestWithParam<std::string> {
};
};


// validity check Boot::getNumberSlots().
// validity check Boot::getNumberSlots().
TEST_P(BootHidlTest, GetNumberSlots) {
TEST_P(BootAidlTest, GetNumberSlots) {
    int32_t slots{};
    int32_t slots{};
    boot->getNumberSlots(&slots);
    boot->getNumberSlots(&slots);
    ASSERT_LE(2, slots);
    ASSERT_LE(2, slots);
}
}


// validity check Boot::getCurrentSlot().
// validity check Boot::getCurrentSlot().
TEST_P(BootHidlTest, GetCurrentSlot) {
TEST_P(BootAidlTest, GetCurrentSlot) {
    int curSlot = -1;
    int curSlot = -1;
    boot->getCurrentSlot(&curSlot);
    boot->getCurrentSlot(&curSlot);
    int slots = 0;
    int slots = 0;
@@ -64,7 +64,7 @@ TEST_P(BootHidlTest, GetCurrentSlot) {
}
}


// validity check Boot::markBootSuccessful().
// validity check Boot::markBootSuccessful().
TEST_P(BootHidlTest, MarkBootSuccessful) {
TEST_P(BootAidlTest, MarkBootSuccessful) {
    const auto result = boot->markBootSuccessful();
    const auto result = boot->markBootSuccessful();
    ASSERT_TRUE(result.isOk());
    ASSERT_TRUE(result.isOk());
    int curSlot = 0;
    int curSlot = 0;
@@ -74,7 +74,7 @@ TEST_P(BootHidlTest, MarkBootSuccessful) {
    ASSERT_TRUE(ret);
    ASSERT_TRUE(ret);
}
}


TEST_P(BootHidlTest, SetActiveBootSlot) {
TEST_P(BootAidlTest, SetActiveBootSlot) {
    int curSlot = -1;
    int curSlot = -1;
    boot->getCurrentSlot(&curSlot);
    boot->getCurrentSlot(&curSlot);
    ASSERT_GE(curSlot, 0);
    ASSERT_GE(curSlot, 0);
@@ -107,7 +107,7 @@ TEST_P(BootHidlTest, SetActiveBootSlot) {
    }
    }
}
}


TEST_P(BootHidlTest, SetSlotAsUnbootable) {
TEST_P(BootAidlTest, SetSlotAsUnbootable) {
    int curSlot = -1;
    int curSlot = -1;
    boot->getCurrentSlot(&curSlot);
    boot->getCurrentSlot(&curSlot);
    ASSERT_GE(curSlot, 0);
    ASSERT_GE(curSlot, 0);
@@ -139,7 +139,7 @@ TEST_P(BootHidlTest, SetSlotAsUnbootable) {
}
}


// validity check Boot::isSlotBootable() on good and bad inputs.
// validity check Boot::isSlotBootable() on good and bad inputs.
TEST_P(BootHidlTest, IsSlotBootable) {
TEST_P(BootAidlTest, IsSlotBootable) {
    for (int s = 0; s < 2; s++) {
    for (int s = 0; s < 2; s++) {
        bool bootable = false;
        bool bootable = false;
        const auto res = boot->isSlotBootable(s, &bootable);
        const auto res = boot->isSlotBootable(s, &bootable);
@@ -153,7 +153,7 @@ TEST_P(BootHidlTest, IsSlotBootable) {
}
}


// validity check Boot::isSlotMarkedSuccessful() on good and bad inputs.
// validity check Boot::isSlotMarkedSuccessful() on good and bad inputs.
TEST_P(BootHidlTest, IsSlotMarkedSuccessful) {
TEST_P(BootAidlTest, IsSlotMarkedSuccessful) {
    for (int32_t s = 0; s < 2; s++) {
    for (int32_t s = 0; s < 2; s++) {
        bool isSuccess = false;
        bool isSuccess = false;
        const auto res = boot->isSlotMarkedSuccessful(s, &isSuccess);
        const auto res = boot->isSlotMarkedSuccessful(s, &isSuccess);
@@ -166,7 +166,7 @@ TEST_P(BootHidlTest, IsSlotMarkedSuccessful) {
}
}


// validity check Boot::getSuffix() on good and bad inputs.
// validity check Boot::getSuffix() on good and bad inputs.
TEST_P(BootHidlTest, GetSuffix) {
TEST_P(BootAidlTest, GetSuffix) {
    string suffixStr;
    string suffixStr;
    unordered_set<string> suffixes;
    unordered_set<string> suffixes;
    int numSlots = 0;
    int numSlots = 0;
@@ -190,6 +190,6 @@ TEST_P(BootHidlTest, GetSuffix) {
}
}


INSTANTIATE_TEST_SUITE_P(
INSTANTIATE_TEST_SUITE_P(
        PerInstance, BootHidlTest,
        PerInstance, BootAidlTest,
        testing::ValuesIn(android::getAidlHalInstanceNames(IBootControl::descriptor)));
        testing::ValuesIn(android::getAidlHalInstanceNames(IBootControl::descriptor)));
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BootHidlTest);
GTEST_ALLOW_UNINSTANTIATED_PARAMETERIZED_TEST(BootAidlTest);