[tests] Be explicit about parameters when looking for the Class.FindType method. (#15431)

This makes sure that adding FindType overloads won't break the tests.
This commit is contained in:
Rolf Bjarne Kvinge 2022-07-13 10:59:54 +02:00 коммит произвёл GitHub
Родитель 4acb844e5c
Коммит 423002bc95
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
1 изменённых файлов: 6 добавлений и 1 удалений

Просмотреть файл

@ -29,7 +29,12 @@ namespace XamarinTests.ObjCRuntime {
public static Registrars CurrentRegistrar {
get {
var find_type = typeof (Class).GetMethod ("FindType", BindingFlags.Static | BindingFlags.NonPublic);
#if NET
var types = new Type [] { typeof (NativeHandle), typeof (bool).MakeByRefType () };
#else
var types = new Type [] { typeof (IntPtr), typeof (bool).MakeByRefType () };
#endif
var find_type = typeof (Class).GetMethod ("FindType", BindingFlags.Static | BindingFlags.NonPublic, null, types, null);
var type_to_find = typeof (RegistrationTestClass);
var type = (Type) find_type.Invoke (null, new object [] { Class.GetHandle (type_to_find), false });
var is_static = type_to_find == type;