diff --git a/pkgs/ffigen/test/native_objc_test/global_native_test.dart b/pkgs/ffigen/test/native_objc_test/global_native_test.dart index 0cb2727fd..5042fe0b7 100644 --- a/pkgs/ffigen/test/native_objc_test/global_native_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_native_test.dart @@ -52,8 +52,7 @@ void main() { globalObject = NSObject(); final obj1raw = globalObject!.ref.pointer; - // TODO(https://github.com/dart-lang/native/issues/1435): Fix flakiness. - // expect(objectRetainCount(obj1raw), greaterThan(0)); + expect(objectRetainCount(obj1raw), greaterThan(0)); return obj1raw; } diff --git a/pkgs/ffigen/test/native_objc_test/global_test.dart b/pkgs/ffigen/test/native_objc_test/global_test.dart index 89a5ffebb..44fc79ca3 100644 --- a/pkgs/ffigen/test/native_objc_test/global_test.dart +++ b/pkgs/ffigen/test/native_objc_test/global_test.dart @@ -54,8 +54,7 @@ void main() { lib.globalObject = NSObject(); final obj1raw = lib.globalObject!.ref.pointer; - // TODO(https://github.com/dart-lang/native/issues/1435): Fix flakiness. - // expect(objectRetainCount(obj1raw), greaterThan(0)); + expect(objectRetainCount(obj1raw), greaterThan(0)); return obj1raw; } diff --git a/pkgs/ffigen/test/native_objc_test/util.dart b/pkgs/ffigen/test/native_objc_test/util.dart index d9f9d64ce..2cb896640 100644 --- a/pkgs/ffigen/test/native_objc_test/util.dart +++ b/pkgs/ffigen/test/native_objc_test/util.dart @@ -98,7 +98,7 @@ int objectRetainCount(Pointer object) { // isValidObject broke due to a runtime update. // These constants are the ISA_MASK macro defined in runtime/objc-private.h. const maskX64 = 0x00007ffffffffff8; - const maskArm = 0x00000001fffffff8; + const maskArm = 0x0000000ffffffff8; final mask = Abi.current() == Abi.macosX64 ? maskX64 : maskArm; final clazz = Pointer.fromAddress(header & mask); diff --git a/pkgs/objective_c/test/autorelease_test.dart b/pkgs/objective_c/test/autorelease_test.dart index 73cfd7da4..db47cae72 100644 --- a/pkgs/objective_c/test/autorelease_test.dart +++ b/pkgs/objective_c/test/autorelease_test.dart @@ -26,6 +26,7 @@ void main() { { final object = NSObject(); pointer = object.ref.retainAndAutorelease(); + expect(objectRetainCount(pointer), greaterThan(0)); } doGC(); expect(objectRetainCount(pointer), greaterThan(0)); @@ -45,6 +46,7 @@ void main() { { final object = NSObject(); pointer = object.ref.retainAndAutorelease(); + expect(objectRetainCount(pointer), greaterThan(0)); } doGC(); expect(objectRetainCount(pointer), greaterThan(0)); diff --git a/pkgs/objective_c/test/util.dart b/pkgs/objective_c/test/util.dart index f4eb35faa..01e360541 100644 --- a/pkgs/objective_c/test/util.dart +++ b/pkgs/objective_c/test/util.dart @@ -59,7 +59,7 @@ int objectRetainCount(Pointer object) { // isValidObject broke due to a runtime update. // These constants are the ISA_MASK macro defined in runtime/objc-private.h. const maskX64 = 0x00007ffffffffff8; - const maskArm = 0x00000001fffffff8; + const maskArm = 0x0000000ffffffff8; final mask = Abi.current() == Abi.macosX64 ? maskX64 : maskArm; final clazz = Pointer.fromAddress(header & mask);