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

Commit 459ea444 authored by Catherine Vlasov's avatar Catherine Vlasov
Browse files

Add test cases for Android 16 versions.

Although the logic in the functions hasn't changed, it's helpful
to add these additional test cases to make the expected behaviour
crystal clear.

Bug: 384021501
Test: atest libvendorsupport-tests
Change-Id: I091639fd818a4180ed0978e9058f0b2246179df7
parent 1fa1ad35
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -24,12 +24,20 @@ namespace {
TEST(VendorSupport, GetCorrespondingVendorApiLevel) {
    ASSERT_EQ(__ANDROID_API_U__, AVendorSupport_getVendorApiLevelOf(__ANDROID_API_U__));
    ASSERT_EQ(202404, AVendorSupport_getVendorApiLevelOf(__ANDROID_API_V__));
    // No more __ANDROID_API_FOO__ constants are defined after V since numeric API levels
    // are preferred, so add more tests (to make the helper function behaviour crystal
    // clear) using numeric API levels.
    ASSERT_EQ(202504, AVendorSupport_getVendorApiLevelOf(36));
    ASSERT_EQ(__INVALID_API_LEVEL, AVendorSupport_getVendorApiLevelOf(__ANDROID_API_FUTURE__));
}

TEST(VendorSupport, GetCorrespondingSdkApiLevel) {
    ASSERT_EQ(__ANDROID_API_U__, AVendorSupport_getSdkApiLevelOf(__ANDROID_API_U__));
    ASSERT_EQ(__ANDROID_API_V__, AVendorSupport_getSdkApiLevelOf(202404));
    // No more __ANDROID_API_FOO__ constants are defined after V since numeric API levels
    // are preferred, so add more tests (to make the helper function behaviour crystal
    // clear) using numeric API levels.
    ASSERT_EQ(36, AVendorSupport_getSdkApiLevelOf(202504));
    ASSERT_EQ(__INVALID_API_LEVEL, AVendorSupport_getSdkApiLevelOf(__ANDROID_VENDOR_API_MAX__));
    ASSERT_EQ(__INVALID_API_LEVEL, AVendorSupport_getSdkApiLevelOf(35));
}