From 313aa5475f50024da74e709a55f840eb7b263153 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 13 Dec 2023 13:47:44 -0800 Subject: 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 --- apex/classpath_element_test.go | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) (limited to 'apex/classpath_element_test.go') 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. -- cgit v1.2.3-59-g8ed1b