[link sdk] Update test to work on macOS as well.

This commit is contained in:
Rolf Bjarne Kvinge 2021-12-09 16:08:47 +01:00
Родитель 52072f02e7
Коммит 169b851e63
1 изменённых файлов: 5 добавлений и 0 удалений

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

@ -830,8 +830,13 @@ namespace LinkSdk {
{
// ref: https://bugzilla.xamarin.com/show_bug.cgi?id=21882
#if NET
#if __MACOS__
var mem = System.Diagnostics.Process.GetCurrentProcess ().PrivateMemorySize64;
Assert.That (mem, Is.EqualTo (0), "PrivateMemorySize64");
#else
// It's not entirely clear, but it appears this is not implemented, and won't be, for mobile platforms: https://github.com/dotnet/runtime/issues/28990
Assert.Throws<PlatformNotSupportedException> (() => { var mem = System.Diagnostics.Process.GetCurrentProcess ().PrivateMemorySize64; }, "PrivateMemorySize64");
#endif // __MACOS__
#else
var mem = System.Diagnostics.Process.GetCurrentProcess ().PrivateMemorySize64;
// the above used a mach call that iOS samdbox did *not* allow (sandbox) on device