Skip to content

Commit

Permalink
Update smoke tests for type alias support in Dart
Browse files Browse the repository at this point in the history
See: #907
Signed-off-by: Daniel Kamkha <[email protected]>
  • Loading branch information
DanielKamkha committed Aug 18, 2022
1 parent 8c5ac64 commit 9cf0585
Show file tree
Hide file tree
Showing 35 changed files with 299 additions and 226 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,29 +7,29 @@ import 'package:meta/meta.dart';
/// This is some very useful interface.
abstract class Comments {
/// This is some very useful constant.
static final bool veryUseful = true;
static final Comments_Usefulness veryUseful = true;
/// This is some very useful method that measures the usefulness of its input.
///
/// [inputParameter] Very useful input parameter
///
/// Returns [bool]. Usefulness of the input
/// Returns [Comments_Usefulness]. Usefulness of the input
///
/// Throws [Comments_SomethingWrongException]. Sometimes it happens.
///
bool someMethodWithAllComments(String inputParameter);
Comments_Usefulness someMethodWithAllComments(String inputParameter);
/// This is some very useful method that measures the usefulness of its input.
///
/// [input] Very useful input parameter
///
bool someMethodWithInputComments(String input);
Comments_Usefulness someMethodWithInputComments(String input);
/// This is some very useful method that measures the usefulness of its input.
///
/// Returns [bool]. Usefulness of the input
/// Returns [Comments_Usefulness]. Usefulness of the input
///
bool someMethodWithOutputComments(String input);
Comments_Usefulness someMethodWithOutputComments(String input);
/// This is some very useful method that measures the usefulness of its input.
///
bool someMethodWithNoComments(String input);
Comments_Usefulness someMethodWithNoComments(String input);
/// This is some very useful method that does not measure the usefulness of its input.
///
/// [input] Very useful input parameter
Expand All @@ -40,12 +40,12 @@ abstract class Comments {
void someMethodWithoutReturnTypeWithNoComments(String input);
/// This is some very useful method that measures the usefulness of something.
///
/// Returns [bool]. Usefulness of the input
/// Returns [Comments_Usefulness]. Usefulness of the input
///
bool someMethodWithoutInputParametersWithAllComments();
Comments_Usefulness someMethodWithoutInputParametersWithAllComments();
/// This is some very useful method that measures the usefulness of something.
///
bool someMethodWithoutInputParametersWithNoComments();
Comments_Usefulness someMethodWithoutInputParametersWithNoComments();
void someMethodWithNothing();
/// This is some very useful method that does nothing.
///
Expand All @@ -57,10 +57,12 @@ abstract class Comments {
///
String returnCommentOnly(String undocumented);
/// Gets some very useful property.
bool get isSomeProperty;
Comments_Usefulness get isSomeProperty;
/// Sets some very useful property.
set isSomeProperty(bool value);
set isSomeProperty(Comments_Usefulness value);
}
/// This is some very useful typedef.
typedef Comments_Usefulness = bool;
/// This is some very useful enum.
enum Comments_SomeEnum {
/// Not quite useful
Expand Down Expand Up @@ -128,15 +130,15 @@ class Comments_SomethingWrongException implements Exception {
class Comments_SomeStruct {
/// How useful this struct is
/// remains to be seen
bool someField;
Comments_Usefulness someField;
/// Can be `null`
String? nullableField;
/// This is how easy it is to construct.
/// [someField] How useful this struct is
/// remains to be seen
/// [nullableField] Can be `null`
Comments_SomeStruct._(this.someField, this.nullableField);
Comments_SomeStruct(bool someField)
Comments_SomeStruct(Comments_Usefulness someField)
: someField = someField, nullableField = null;
/// This is some struct method that does nothing.
///
Expand Down Expand Up @@ -354,7 +356,7 @@ final _someMethodWithAllCommentsReturnHasError = __lib.catchArgumentError(() =>
class Comments$Impl extends __lib.NativeBase implements Comments {
Comments$Impl(Pointer<Void> handle) : super(handle);
@override
bool someMethodWithAllComments(String inputParameter) {
Comments_Usefulness someMethodWithAllComments(String inputParameter) {
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'));
final _inputParameterHandle = stringToFfi(inputParameter);
final _handle = this.handle;
Expand All @@ -378,7 +380,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
bool someMethodWithInputComments(String input) {
Comments_Usefulness someMethodWithInputComments(String input) {
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'));
final _inputHandle = stringToFfi(input);
final _handle = this.handle;
Expand All @@ -391,7 +393,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
bool someMethodWithOutputComments(String input) {
Comments_Usefulness someMethodWithOutputComments(String input) {
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'));
final _inputHandle = stringToFfi(input);
final _handle = this.handle;
Expand All @@ -404,7 +406,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
bool someMethodWithNoComments(String input) {
Comments_Usefulness someMethodWithNoComments(String input) {
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'));
final _inputHandle = stringToFfi(input);
final _handle = this.handle;
Expand Down Expand Up @@ -433,7 +435,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
stringReleaseFfiHandle(_inputHandle);
}
@override
bool someMethodWithoutInputParametersWithAllComments() {
Comments_Usefulness someMethodWithoutInputParametersWithAllComments() {
final _someMethodWithoutInputParametersWithAllCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_someMethodWithoutInputParametersWithAllComments'));
final _handle = this.handle;
final __resultHandle = _someMethodWithoutInputParametersWithAllCommentsFfi(_handle, __lib.LibraryContext.isolateId);
Expand All @@ -444,7 +446,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
bool someMethodWithoutInputParametersWithNoComments() {
Comments_Usefulness someMethodWithoutInputParametersWithNoComments() {
final _someMethodWithoutInputParametersWithNoCommentsFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_someMethodWithoutInputParametersWithNoComments'));
final _handle = this.handle;
final __resultHandle = _someMethodWithoutInputParametersWithNoCommentsFfi(_handle, __lib.LibraryContext.isolateId);
Expand Down Expand Up @@ -495,7 +497,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
bool get isSomeProperty {
Comments_Usefulness get isSomeProperty {
final _getFfi = __lib.catchArgumentError(() => __lib.nativeLibrary.lookupFunction<Uint8 Function(Pointer<Void>, Int32), int Function(Pointer<Void>, int)>('library_smoke_Comments_isSomeProperty_get'));
final _handle = this.handle;
final __resultHandle = _getFfi(_handle, __lib.LibraryContext.isolateId);
Expand All @@ -506,7 +508,7 @@ class Comments$Impl extends __lib.NativeBase implements Comments {
}
}
@override
set isSomeProperty(bool value) {
set isSomeProperty(Comments_Usefulness value) {
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'));
final _valueHandle = booleanToFfi(value);
final _handle = this.handle;
Expand Down
Loading

0 comments on commit 9cf0585

Please sign in to comment.