• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

dart-lang / ffigen / 6470767942

10 Oct 2023 02:29PM UTC coverage: 91.966% (-0.6%) from 92.593%
6470767942

push

github

web-flow
Refactor `sameFfiDartAndCType` to not require a `Writer` (#629)

40 of 40 new or added lines in 12 files covered. (100.0%)

3709 of 4033 relevant lines covered (91.97%)

28.07 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

87.5
/lib/src/code_generator/objc_nullable.dart
1
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2
// for details. All rights reserved. Use of this source code is governed by a
3
// BSD-style license that can be found in the LICENSE file.
4

5
import 'package:ffigen/src/code_generator.dart';
6

7
import 'writer.dart';
8

9
/// An ObjC type annotated with nullable. Eg:
10
/// +(nullable NSObject*) methodWithNullableResult;
11
class ObjCNullable extends Type {
12
  Type child;
13

14
  ObjCNullable(this.child) {
2✔
15
    assert(isSupported(child));
4✔
16
  }
17

18
  static bool isSupported(Type type) =>
2✔
19
      type is ObjCInterface ||
2✔
20
      type is ObjCBlock ||
2✔
21
      type is ObjCObjectPointer ||
2✔
22
      type is ObjCInstanceType;
2✔
23

24
  @override
2✔
25
  void addDependencies(Set<Binding> dependencies) {
26
    child.addDependencies(dependencies);
4✔
27
  }
28

29
  @override
2✔
30
  Type get baseType => child.baseType;
4✔
31

32
  @override
2✔
33
  String getCType(Writer w) => child.getCType(w);
4✔
34

35
  @override
2✔
36
  String getFfiDartType(Writer w) => child.getFfiDartType(w);
4✔
37

38
  @override
2✔
39
  String getDartType(Writer w) => '${child.getDartType(w)}?';
6✔
40

41
  @override
×
42
  bool get sameFfiDartAndCType => child.sameFfiDartAndCType;
×
43

44
  @override
×
45
  bool get sameDartAndCType => false;
46

47
  @override
2✔
48
  String toString() => '$child?';
4✔
49

50
  @override
2✔
51
  String cacheKey() => '${child.cacheKey()}?';
6✔
52
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc