-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[monotouch-test] Use TestRuntime.RunAsync instead of AppDelegate.RunAsync so that the system sound tests work on macOS as well. #11770
[monotouch-test] Use TestRuntime.RunAsync instead of AppDelegate.RunAsync so that the system sound tests work on macOS as well. #11770
Conversation
…sync so that the system sound tests work on macOS as well.
… doesn't support it. Fixes these test failures: [FAIL] FromFile : System.Runtime.InteropServices.MarshalDirectiveException : Cannot marshal 'parameter #4': Non-blittable generic types cannot be marshaled. at AudioToolbox.SystemSound.AudioServicesAddSystemSoundCompletion(UInt32 soundId, IntPtr runLoop, IntPtr runLoopMode, Action`2 completionRoutine, IntPtr clientData) at AudioToolbox.SystemSound.AddSystemSoundCompletion(Action routine, CFRunLoop runLoop) in Xamarin.Mac.dll:token 0x600bfd4+0x2b at MonoTouchFixtures.AudioToolbox.SystemSoundTest.FromFile() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 40 [FAIL] TestCallbackPlayAlert : System.ArgumentException : The specified Type must not be a generic type. (Parameter 'delegate') at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d) at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d) in System.Private.CoreLib.dll:token 0x6004586+0xe at ObjCRuntime.BlockLiteral.SetupBlockImpl(Delegate trampoline, Delegate userDelegate, Boolean safe, String signature) in Xamarin.Mac.dll:token 0x6001306+0xb at ObjCRuntime.BlockLiteral.SetupBlock(Delegate trampoline, Delegate userDelegate, Boolean safe) in Xamarin.Mac.dll:token 0x6001305+0x5e at ObjCRuntime.BlockLiteral.SetupBlockUnsafe(Delegate trampoline, Delegate userDelegate) in Xamarin.Mac.dll:token 0x6001307+0x0 at AudioToolbox.SystemSound.PlayAlertSound(Action onCompletion) in Xamarin.Mac.dll:token 0x600bfc8+0x20 at MonoTouchFixtures.AudioToolbox.SystemSoundTest.<>c__DisplayClass3_1.<<TestCallbackPlayAlert>b__0>d.MoveNext() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 93 --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state) in System.Private.CoreLib.dll:token 0x6002d4d+0x0 at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in Xamarin.Mac.dll:token 0x6016560+0x0 --- End of stack trace from previous location --- at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x274 at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0 at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26 at ObjCRuntime.Messaging.void_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1) at TestRuntime.RunAsync(DateTime timeout, Action action, Func`1 check_completed, NSImage imageToShow) in xamarin-macios/tests/common/mac/TestRuntime.macos.cs:line 18 at MonoTouchFixtures.AudioToolbox.SystemSoundTest.TestCallbackPlayAlert() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 92 [FAIL] TestCallbackPlaySystem : System.ArgumentException : The specified Type must not be a generic type. (Parameter 'delegate') at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegateInternal(Delegate d) at System.Runtime.InteropServices.Marshal.GetFunctionPointerForDelegate(Delegate d) in System.Private.CoreLib.dll:token 0x6004586+0xe at ObjCRuntime.BlockLiteral.SetupBlockImpl(Delegate trampoline, Delegate userDelegate, Boolean safe, String signature) in Xamarin.Mac.dll:token 0x6001306+0xb at ObjCRuntime.BlockLiteral.SetupBlock(Delegate trampoline, Delegate userDelegate, Boolean safe) in Xamarin.Mac.dll:token 0x6001305+0x5e at ObjCRuntime.BlockLiteral.SetupBlockUnsafe(Delegate trampoline, Delegate userDelegate) in Xamarin.Mac.dll:token 0x6001307+0x0 at AudioToolbox.SystemSound.PlaySystemSound(Action onCompletion) in Xamarin.Mac.dll:token 0x600bfca+0x20 at MonoTouchFixtures.AudioToolbox.SystemSoundTest.<>c__DisplayClass2_1.<<TestCallbackPlaySystem>b__0>d.MoveNext() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 74 --- End of stack trace from previous location --- at System.Threading.Tasks.Task.<>c.<ThrowAsync>b__140_0(Object state) in System.Private.CoreLib.dll:token 0x6002d4d+0x0 at Foundation.NSAsyncSynchronizationContextDispatcher.Apply() in Xamarin.Mac.dll:token 0x6016560+0x0 --- End of stack trace from previous location --- at ObjCRuntime.Runtime.InvokeMethod(MethodBase method, Object instance, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d1+0x274 at ObjCRuntime.Runtime.InvokeMethod(MonoObject* methodobj, MonoObject* instanceobj, IntPtr native_parameters) in Xamarin.Mac.dll:token 0x60011d0+0x0 at ObjCRuntime.Runtime.bridge_runtime_invoke_method(MonoObject* method, MonoObject* instance, IntPtr parameters, IntPtr& exception_gchandle) in Xamarin.Mac.dll:token 0x6001124+0x26 at ObjCRuntime.Messaging.void_objc_msgSend_IntPtr(IntPtr receiver, IntPtr selector, IntPtr arg1) at TestRuntime.RunAsync(DateTime timeout, Action action, Func`1 check_completed, NSImage imageToShow) in xamarin-macios/tests/common/mac/TestRuntime.macos.cs:line 18 at MonoTouchFixtures.AudioToolbox.SystemSoundTest.TestCallbackPlaySystem() in xamarin-macios/tests/monotouch-test/AudioToolbox/SystemSoundTest.cs:line 73
✅ [PR Build] Tests passed on Build. ✅Tests passed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): 🎉 All 83 tests passed 🎉Pipeline on Agent XAMBOT-1105.BigSur' |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
✅ [PR Build] Tests passed on Build. ✅Tests passed on Build. API diff✅ API Diff from stable View API diffAPI & Generator diff✅ API Diff (from PR only) (no change) GitHub pagesResults can be found in the following github pages (it might take some time to publish): 🎉 All 109 tests passed 🎉Pipeline on Agent XAMBOT-1104.BigSur' |
This revealed an issue with the system sound bindings on CoreCLR (delegates to
P/Invokes can't be generic), which has also been fixed.