[tests] Cover virtual callbacks during construction - #12566
Open
simonrozsival wants to merge 2 commits into
Open
[tests] Cover virtual callbacks during construction#12566simonrozsival wants to merge 2 commits into
simonrozsival wants to merge 2 commits into
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
27 tasks
Contributor
There was a problem hiding this comment.
Copilot review overview
Review tier: Lite
Findings: 1
New issues introduced by this change (1)
| Severity | Finding |
|---|---|
tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/VirtualCallbackConstructorTests.cs — 💡 suggestion — javaClass is declared with using var but never used, which generates CS0219… |
What changed in this PR
This PR expands the trimmable typemap runtime coverage test suite by adding a new fixture that validates virtual managed callbacks invoked from Java base constructors during object construction. It targets constructor-time peer identity stability, re-entrant/concurrent lookup behavior, and exception propagation in both managed-first and Java-first activation paths.
Changes:
- Added a new Java base type whose constructor calls an overridable method to trigger virtual callbacks during construction.
- Added a new managed test fixture covering managed-first vs Java-first construction, peer identity invariants, bounded concurrency, and callback exception behavior.
- Wired the new test into the
Mono.Android.NET-Testsproject compilation list.
| File | Description |
|---|---|
| tests/Mono.Android-Tests/Mono.Android-Tests/Mono.Android.NET-Tests.csproj | Includes the new virtual-callback constructor parity tests in the on-device test project. |
| tests/Mono.Android-Tests/Mono.Android-Tests/java/net/dot/android/test/VirtualCallbackConstructorBase.java | Introduces the Java base constructor callback trigger used by the new parity fixture. |
| tests/Mono.Android-Tests/Mono.Android-Tests/Java.Interop/VirtualCallbackConstructorTests.cs | Implements NUnit coverage for constructor-time virtual callbacks, identity invariants, bounded concurrency, and exception propagation. |
| VirtualCallbackConstructorDerived.Reset (); | ||
| VirtualCallbackConstructorDerived.RunConcurrentLookup = true; | ||
|
|
||
| using var javaClass = VirtualCallbackConstructorDerived.GetJavaClass (); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Summary
Matrix
The unchanged fixture passes under llvm-ir/MonoVM, trimmable/CoreCLR, and trimmable/NativeAOT (3/3 each). No production change was required.
Part of #12561