diff options
author | 2023-12-13 13:47:44 -0800 | |
---|---|---|
committer | 2023-12-14 16:12:22 -0800 | |
commit | 313aa5475f50024da74e709a55f840eb7b263153 (patch) | |
tree | fe4d43b20d557f151641b323eeae292474478427 /apex/classpath_element_test.go | |
parent | ff694a8c88c632559c72653edf99f21c3d761dee (diff) |
Convert OtherModuleProvider to generic providers API
Convert all of the callers of OtherModuleProvider/OtherModuleHasProvider
to use the type-safe android.OtherModuleProvider API.
Bug: 316410648
Test: builds
Change-Id: Id77f514d68761a262d9ea830a601dbed804bbbe5
Diffstat (limited to 'apex/classpath_element_test.go')
-rw-r--r-- | apex/classpath_element_test.go | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/apex/classpath_element_test.go b/apex/classpath_element_test.go index 1ce60ced9..b9a91982a 100644 --- a/apex/classpath_element_test.go +++ b/apex/classpath_element_test.go @@ -20,7 +20,6 @@ import ( "android/soong/android" "android/soong/java" - "github.com/google/blueprint" ) // Contains tests for java.CreateClasspathElements logic from java/classpath_element.go that @@ -28,19 +27,12 @@ import ( // testClasspathElementContext is a ClasspathElementContext suitable for use in tests. type testClasspathElementContext struct { + android.OtherModuleProviderContext testContext *android.TestContext module android.Module errs []error } -func (t *testClasspathElementContext) OtherModuleHasProvider(module blueprint.Module, provider blueprint.AnyProviderKey) bool { - return t.testContext.ModuleHasProvider(module, provider) -} - -func (t *testClasspathElementContext) OtherModuleProvider(module blueprint.Module, provider blueprint.AnyProviderKey) interface{} { - return t.testContext.ModuleProvider(module, provider) -} - func (t *testClasspathElementContext) ModuleErrorf(fmt string, args ...interface{}) { t.errs = append(t.errs, t.testContext.ModuleErrorf(t.module, fmt, args...)) } @@ -238,7 +230,11 @@ func TestCreateClasspathElements(t *testing.T) { } newCtx := func() *testClasspathElementContext { - return &testClasspathElementContext{testContext: result.TestContext, module: bootclasspath} + return &testClasspathElementContext{ + OtherModuleProviderContext: result.TestContext.OtherModuleProviderAdaptor(), + testContext: result.TestContext, + module: bootclasspath, + } } // Verify that CreateClasspathElements works when given valid input. |