Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions pkgs/ffigen/test/native_objc_test/global_native_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
3 changes: 1 addition & 2 deletions pkgs/ffigen/test/native_objc_test/global_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
2 changes: 1 addition & 1 deletion pkgs/ffigen/test/native_objc_test/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ int objectRetainCount(Pointer<ObjCObject> 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<ObjCObject>.fromAddress(header & mask);

Expand Down
2 changes: 2 additions & 0 deletions pkgs/objective_c/test/autorelease_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ void main() {
{
final object = NSObject();
pointer = object.ref.retainAndAutorelease();
expect(objectRetainCount(pointer), greaterThan(0));
}
doGC();
expect(objectRetainCount(pointer), greaterThan(0));
Expand All @@ -45,6 +46,7 @@ void main() {
{
final object = NSObject();
pointer = object.ref.retainAndAutorelease();
expect(objectRetainCount(pointer), greaterThan(0));
}
doGC();
expect(objectRetainCount(pointer), greaterThan(0));
Expand Down
2 changes: 1 addition & 1 deletion pkgs/objective_c/test/util.dart
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ int objectRetainCount(Pointer<ObjCObject> 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<ObjCObject>.fromAddress(header & mask);

Expand Down
Loading