Replace ApiStrToNum uses with ApiLevel.

Test: treehugger
Bug: http://b/154667674
Change-Id: I2954bb21c1cfdeb305f25cfb6c8711c930f6ed50
This commit is contained in:
Dan Albert
2020-07-22 22:32:17 -07:00
parent af6073f78d
commit c8060536e8
17 changed files with 134 additions and 125 deletions

View File

@@ -195,7 +195,7 @@ func TestStubsVersions(t *testing.T) {
name: "libfoo",
srcs: ["foo.c"],
stubs: {
versions: ["29", "R", "10000"],
versions: ["29", "R", "current"],
},
}
`
@@ -204,7 +204,7 @@ func TestStubsVersions(t *testing.T) {
ctx := testCcWithConfig(t, config)
variants := ctx.ModuleVariantsForTests("libfoo")
for _, expectedVer := range []string{"29", "9000", "10000"} {
for _, expectedVer := range []string{"29", "R", "current"} {
expectedVariant := "android_arm_armv7-a-neon_shared_" + expectedVer
if !inList(expectedVariant, variants) {
t.Errorf("missing expected variant: %q", expectedVariant)
@@ -218,7 +218,7 @@ func TestStubsVersions_NotSorted(t *testing.T) {
name: "libfoo",
srcs: ["foo.c"],
stubs: {
versions: ["29", "10000", "R"],
versions: ["29", "current", "R"],
},
}
`
@@ -233,10 +233,10 @@ func TestStubsVersions_ParseError(t *testing.T) {
name: "libfoo",
srcs: ["foo.c"],
stubs: {
versions: ["29", "10000", "X"],
versions: ["29", "current", "X"],
},
}
`
testCcError(t, `"libfoo" .*: versions: SDK version should be`, bp)
testCcError(t, `"libfoo" .*: versions: "X" could not be parsed as an integer and is not a recognized codename`, bp)
}