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

dart-lang / ffigen / 5305585135

18 Jun 2023 08:33PM CUT coverage: 85.041% (-6.8%) from 91.879%
5305585135

Pull #586

github

web-flow
Merge 27e2ea8df into 9030eb512
Pull Request #586: Add ffigen schema and refer them in example config yaml using modeline

603 of 603 new or added lines in 3 files covered. (100.0%)

3462 of 4071 relevant lines covered (85.04%)

25.74 hits per line

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

77.78
/lib/src/code_generator/pointer.dart
1
// Copyright (c) 2022, 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
/// Represents a pointer.
10
class PointerType extends Type {
11
  final Type child;
12
  PointerType(this.child);
25✔
13

14
  @override
24✔
15
  void addDependencies(Set<Binding> dependencies) {
16
    child.addDependencies(dependencies);
48✔
17
  }
18

19
  @override
23✔
20
  Type get baseType => child.baseType;
46✔
21

22
  @override
24✔
23
  String getCType(Writer w) =>
24
      '${w.ffiLibraryPrefix}.Pointer<${child.getCType(w)}>';
96✔
25

26
  @override
2✔
27
  String toString() => '$child*';
4✔
28

29
  @override
2✔
30
  String cacheKey() => '${child.cacheKey()}*';
6✔
31
}
32

33
/// Represents a constant array, which has a fixed size.
34
class ConstantArray extends PointerType {
35
  final int length;
36
  ConstantArray(this.length, Type child) : super(child);
18✔
37

38
  @override
8✔
39
  Type get baseArrayType => child.baseArrayType;
16✔
40

41
  @override
8✔
42
  bool get isIncompleteCompound => baseArrayType.isIncompleteCompound;
16✔
43

44
  @override
2✔
45
  String toString() => '$child[$length]';
6✔
46

47
  @override
2✔
48
  String cacheKey() => '${child.cacheKey()}[$length]';
8✔
49
}
50

51
/// Represents an incomplete array, which has an unknown size.
52
class IncompleteArray extends PointerType {
53
  IncompleteArray(Type child) : super(child);
6✔
54

55
  @override
×
56
  Type get baseArrayType => child.baseArrayType;
×
57

58
  @override
×
59
  String toString() => '$child[]';
×
60

61
  @override
×
62
  String cacheKey() => '${child.cacheKey()}[]';
×
63
}
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