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

Commit 7c690b96 authored by Yu Shan's avatar Yu Shan Committed by Android (Google) Code Review
Browse files

Merge changes from topic "getminmaxvalue" into main

* changes:
  Add VTS test for getMinMaxSupportedValue.
  Generate cpp header file for supported enums.
parents 8dd21e5d 8dd34855
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ cc_test {
    srcs: ["VehiclePropertyAnnotationCppTest.cpp"],
    header_libs: ["IVehicleGeneratedHeaders-V4"],
    static_libs: [
        "VehicleHalUtils",
        "libgtest",
        "libgmock",
    ],
+15 −0
Original line number Diff line number Diff line
@@ -17,6 +17,8 @@
#include <AccessForVehicleProperty.h>
#include <AnnotationsForVehicleProperty.h>
#include <ChangeModeForVehicleProperty.h>
#include <EnumForVehicleProperty.h>
#include <VehicleHalTypes.h>

#include <aidl/android/hardware/automotive/vehicle/VehicleProperty.h>
#include <gmock/gmock.h>
@@ -73,3 +75,16 @@ TEST(VehiclePropertyAnnotationCppTest, testAnnotations) {
                << " must not be empty";
    }
}

TEST(VehiclePropertyAnnotationCppTest, testSupportedEnums) {
    auto supportedEnums =
            aidl_vehicle::getSupportedEnumValuesForProperty(VehicleProperty::INFO_FUEL_TYPE);
    // We only listed part of the fuel type values here. This is enough to verify that the
    // generated code is correct.
    ASSERT_THAT(supportedEnums,
                ::testing::IsSupersetOf(
                        {static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_UNLEADED),
                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_LEADED),
                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_1),
                         static_cast<int64_t>(aidl_vehicle::FuelType::FUEL_TYPE_DIESEL_2)}));
}
+1 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
+1 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
+1 −1
Original line number Diff line number Diff line
/*
 * Copyright (C) 2023 The Android Open Source Project
 * Copyright (C) 2025 The Android Open Source Project
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
Loading