Skip to content

Commit 9cf0585

Browse files
committed
Update smoke tests for type alias support in Dart
See: #907 Signed-off-by: Daniel Kamkha <[email protected]>
1 parent 8c5ac64 commit 9cf0585

File tree

35 files changed

+299
-226
lines changed

35 files changed

+299
-226
lines changed

gluecodium/src/test/resources/smoke/comments/output/dart/lib/src/smoke/comments.dart

Lines changed: 24 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -7,29 +7,29 @@ import 'package:meta/meta.dart';
77
/// This is some very useful interface.
88
abstract class Comments {
99
/// This is some very useful constant.
10-
static final bool veryUseful = true;
10+
static final Comments_Usefulness veryUseful = true;
1111
/// This is some very useful method that measures the usefulness of its input.
1212
///
1313
/// [inputParameter] Very useful input parameter
1414
///
15-
/// Returns [bool]. Usefulness of the input
15+
/// Returns [Comments_Usefulness]. Usefulness of the input
1616
///
1717
/// Throws [Comments_SomethingWrongException]. Sometimes it happens.
1818
///
19-
bool someMethodWithAllComments(String inputParameter);
19+
Comments_Usefulness someMethodWithAllComments(String inputParameter);
2020
/// This is some very useful method that measures the usefulness of its input.
2121
///
2222
/// [input] Very useful input parameter
2323
///
24-
bool someMethodWithInputComments(String input);
24+
Comments_Usefulness someMethodWithInputComments(String input);
2525
/// This is some very useful method that measures the usefulness of its input.
2626
///
27-
/// Returns [bool]. Usefulness of the input
27+
/// Returns [Comments_Usefulness]. Usefulness of the input
2828
///
29-
bool someMethodWithOutputComments(String input);
29+
Comments_Usefulness someMethodWithOutputComments(String input);
3030
/// This is some very useful method that measures the usefulness of its input.
3131
///
32-
bool someMethodWithNoComments(String input);
32+
Comments_Usefulness someMethodWithNoComments(String input);
3333
/// This is some very useful method that does not measure the usefulness of its input.
3434
///
3535
/// [input] Very useful input parameter
@@ -40,12 +40,12 @@ abstract class Comments {
4040
void someMethodWithoutReturnTypeWithNoComments(String input);
4141
/// This is some very useful method that measures the usefulness of something.
4242
///
43-
/// Returns [bool]. Usefulness of the input
43+
/// Returns [Comments_Usefulness]. Usefulness of the input
4444
///
45-
bool someMethodWithoutInputParametersWithAllComments();
45+
Comments_Usefulness someMethodWithoutInputParametersWithAllComments();
4646
/// This is some very useful method that measures the usefulness of something.
4747
///
48-
bool someMethodWithoutInputParametersWithNoComments();
48+
Comments_Usefulness someMethodWithoutInputParametersWithNoComments();
4949
void someMethodWithNothing();
5050
/// This is some very useful method that does nothing.
5151
///
@@ -57,10 +57,12 @@ abstract class Comments {
5757
///
5858
String returnCommentOnly(String undocumented);
5959
/// Gets some very useful property.
60-
bool get isSomeProperty;
60+
Comments_Usefulness get isSomeProperty;
6161
/// Sets some very useful property.
62-
set isSomeProperty(bool value);
62+
set isSomeProperty(Comments_Usefulness value);
6363
}
64+
/// This is some very useful typedef.
65+
typedef Comments_Usefulness = bool;
6466
/// This is some very useful enum.
6567
enum Comments_SomeEnum {
6668
/// Not quite useful
@@ -128,15 +130,15 @@ class Comments_SomethingWrongException implements Exception {
128130
class Comments_SomeStruct {
129131
/// How useful this struct is
130132
/// remains to be seen
131-
bool someField;
133+
Comments_Usefulness someField;
132134
/// Can be `null`
133135
String? nullableField;
134136
/// This is how easy it is to construct.
135137
/// [someField] How useful this struct is
136138
/// remains to be seen
137139
/// [nullableField] Can be `null`
138140
Comments_SomeStruct._(this.someField, this.nullableField);
139-
Comments_SomeStruct(bool someField)
141+
Comments_SomeStruct(Comments_Usefulness someField)
140142
: someField = someField, nullableField = null;
141143
/// This is some struct method that does nothing.
142144
///
@@ -354,7 +356,7 @@ final _someMethodWithAllCommentsReturnHasError = __lib.catchArgumentError(() =>
354356
class Comments$Impl extends __lib.NativeBase implements Comments {
355357
Comments$Impl(Pointer<Void> handle) : super(handle);
356358
@override
357-
bool someMethodWithAllComments(String inputParameter) {
359+
Comments_Usefulness someMethodWithAllComments(String inputParameter) {
358360
final _someMethodWithAllCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Pointer<Void> Function(Pointer<Void>, Int32, Pointer<Void>), Pointer<Void> Function(Pointer<Void>, int, Pointer<Void>)>('library_smoke_Comments_someMethodWithAllComments__String'));
359361
final _inputParameterHandle = stringToFfi(inputParameter);
360362
final _handle = this.handle;
@@ -378,7 +380,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
378380
}
379381
}
380382
@override
381-
bool someMethodWithInputComments(String input) {
383+
Comments_Usefulness someMethodWithInputComments(String input) {
382384
final _someMethodWithInputCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32, Pointer<Void>), int Function(Pointer<Void>, int, Pointer<Void>)>('library_smoke_Comments_someMethodWithInputComments__String'));
383385
final _inputHandle = stringToFfi(input);
384386
final _handle = this.handle;
@@ -391,7 +393,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
391393
}
392394
}
393395
@override
394-
bool someMethodWithOutputComments(String input) {
396+
Comments_Usefulness someMethodWithOutputComments(String input) {
395397
final _someMethodWithOutputCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32, Pointer<Void>), int Function(Pointer<Void>, int, Pointer<Void>)>('library_smoke_Comments_someMethodWithOutputComments__String'));
396398
final _inputHandle = stringToFfi(input);
397399
final _handle = this.handle;
@@ -404,7 +406,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
404406
}
405407
}
406408
@override
407-
bool someMethodWithNoComments(String input) {
409+
Comments_Usefulness someMethodWithNoComments(String input) {
408410
final _someMethodWithNoCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32, Pointer<Void>), int Function(Pointer<Void>, int, Pointer<Void>)>('library_smoke_Comments_someMethodWithNoComments__String'));
409411
final _inputHandle = stringToFfi(input);
410412
final _handle = this.handle;
@@ -433,7 +435,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
433435
stringReleaseFfiHandle(_inputHandle);
434436
}
435437
@override
436-
bool someMethodWithoutInputParametersWithAllComments() {
438+
Comments_Usefulness someMethodWithoutInputParametersWithAllComments() {
437439
final _someMethodWithoutInputParametersWithAllCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_someMethodWithoutInputParametersWithAllComments'));
438440
final _handle = this.handle;
439441
final __resultHandle = _someMethodWithoutInputParametersWithAllCommentsFfi(_handle, __lib.LibraryContext.isolateId);
@@ -444,7 +446,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
444446
}
445447
}
446448
@override
447-
bool someMethodWithoutInputParametersWithNoComments() {
449+
Comments_Usefulness someMethodWithoutInputParametersWithNoComments() {
448450
final _someMethodWithoutInputParametersWithNoCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_someMethodWithoutInputParametersWithNoComments'));
449451
final _handle = this.handle;
450452
final __resultHandle = _someMethodWithoutInputParametersWithNoCommentsFfi(_handle, __lib.LibraryContext.isolateId);
@@ -495,7 +497,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
495497
}
496498
}
497499
@override
498-
bool get isSomeProperty {
500+
Comments_Usefulness get isSomeProperty {
499501
final _getFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_isSomeProperty_get'));
500502
final _handle = this.handle;
501503
final __resultHandle = _getFfi(_handle, __lib.LibraryContext.isolateId);
@@ -506,7 +508,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
506508
}
507509
}
508510
@override
509-
set isSomeProperty(bool value) {
511+
set isSomeProperty(Comments_Usefulness value) {
510512
final _setFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Void Function(Pointer<Void>, Int32, Uint8), void Function(Pointer<Void>, int, int)>('library_smoke_Comments_isSomeProperty_set__Boolean'));
511513
final _valueHandle = booleanToFfi(value);
512514
final _handle = this.handle;

0 commit comments

Comments
 (0)