Skip to content

Commit 68aafbe

Browse files
Fix test: TypeMapAssociationAttribute is generic (TypeMapAssociationAttribute`1)
The attribute emitter uses the generic TypeRef name 'TypeMapAssociationAttribute`1', so the assertion must check for the generic name. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 3b191bc commit 68aafbe

4 files changed

Lines changed: 16 additions & 2 deletions

File tree

src/native/clr/host/host-jni.cc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,9 @@ JNICALL Java_mono_android_Runtime_notifyTimeZoneChanged ([[maybe_unused]] JNIEnv
5757
{
5858
// TODO: implement or remove
5959
}
60+
61+
JNIEXPORT void
62+
JNICALL Java_mono_android_Runtime_registerNatives (JNIEnv *env, jclass klass)
63+
{
64+
Host::Java_mono_android_Runtime_registerNatives (env, klass);
65+
}

src/native/clr/include/host/host-jni.hh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,4 +45,11 @@ extern "C" {
4545
*/
4646
JNIEXPORT void JNICALL Java_mono_android_Runtime_register (JNIEnv *, jclass, jstring, jclass, jstring);
4747

48+
/*
49+
* Class: mono_android_Runtime
50+
* Method: registerNatives
51+
* Signature: (Ljava/lang/Class;)V
52+
*/
53+
JNIEXPORT void JNICALL Java_mono_android_Runtime_registerNatives (JNIEnv *, jclass);
54+
4855
}

src/native/clr/libnet-android.map.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ LIBNET_ANDROID {
66
Java_mono_android_Runtime_notifyTimeZoneChanged;
77
Java_mono_android_Runtime_propagateUncaughtException;
88
Java_mono_android_Runtime_register;
9+
Java_mono_android_Runtime_registerNatives;
910

1011
local:
1112
*;

tests/Microsoft.Android.Sdk.TrimmableTypeMap.Tests/Generator/TypeMapAssemblyGeneratorTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,9 +1064,9 @@ public void Generate_AliasGroup_ProducesCorrectIndexedEntries ()
10641064
Assert.Contains ("test/AliasTarget[1]", jniNames);
10651065
Assert.Contains ("test/AliasTarget[2]", jniNames);
10661066

1067-
// Verify TypeMapAssociationAttribute is referenced
1067+
// Verify TypeMapAssociationAttribute is referenced (generic version)
10681068
var typeNames = GetTypeRefNames (reader);
1069-
Assert.Contains ("TypeMapAssociationAttribute", typeNames);
1069+
Assert.Contains ("TypeMapAssociationAttribute`1", typeNames);
10701070

10711071
// Verify 3 proxy types + 1 alias holder were emitted
10721072
var proxyTypes = reader.TypeDefinitions

0 commit comments

Comments
 (0)