This repository has been archived by the owner on Jan 28, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 55
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
65a2ca7
commit 15ebe89
Showing
1 changed file
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file | ||
// for details. All rights reserved. Use of this source code is governed by a | ||
// BSD-style license that can be found in the LICENSE file. | ||
|
||
// Objective C support is only available on mac. | ||
|
||
@TestOn('mac-os') | ||
|
||
import 'dart:ffi'; | ||
import 'dart:io'; | ||
|
||
import 'package:test/test.dart'; | ||
import '../test_utils.dart'; | ||
import 'typedef_bindings.dart'; | ||
import 'util.dart'; | ||
|
||
void main() { | ||
late TypedefTestObjCLibrary lib; | ||
|
||
group('typedef', () { | ||
setUpAll(() { | ||
logWarnings(); | ||
final dylib = File('test/native_objc_test/typedef_test.dylib'); | ||
verifySetupFile(dylib); | ||
lib = TypedefTestObjCLibrary(DynamicLibrary.open(dylib.absolute.path)); | ||
generateBindingsForCoverage('typedef'); | ||
}); | ||
|
||
test('Regression test for #386', () { | ||
// https://github.com/dart-lang/ffigen/issues/386 | ||
// Make sure that the typedef SomeClassPtr_dart is for SomeClass. | ||
final SomeClassPtr_dart instance = SomeClass.new1(lib); | ||
expect(instance.pointer, isNot(nullptr)); | ||
}); | ||
}); | ||
} |