diff --git a/packages/pigeon/CHANGELOG.md b/packages/pigeon/CHANGELOG.md index c5281a3469a..c5a3c3e04cc 100644 --- a/packages/pigeon/CHANGELOG.md +++ b/packages/pigeon/CHANGELOG.md @@ -1,3 +1,9 @@ +## 22.0.0 + +* [dart] Changes codec to send int64 instead of int32. +* **Breaking Change** [swift] Changes generic `map` to nullable keys of `AnyHashable` to conform to other platforms. +* Adds tests to validate collections of ints. + ## 21.2.0 * Removes restriction on number of custom types. diff --git a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java index 7e5e839dd73..8d9256c3795 100644 --- a/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java +++ b/packages/pigeon/example/app/android/app/src/main/java/io/flutter/plugins/Messages.java @@ -232,7 +232,7 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 129: { Object value = readValue(buffer); - return value == null ? null : Code.values()[(int) value]; + return value == null ? null : Code.values()[((Long) value).intValue()]; } case (byte) 130: return MessageData.fromList((ArrayList) readValue(buffer)); @@ -339,13 +339,10 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aArg = (Number) args.get(0); - Number bArg = (Number) args.get(1); + Long aArg = (Long) args.get(0); + Long bArg = (Long) args.get(1); try { - Long output = - api.add( - (aArg == null) ? null : aArg.longValue(), - (bArg == null) ? null : bArg.longValue()); + Long output = api.add(aArg, bArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); diff --git a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt index d96ca417a45..ec916c5292c 100644 --- a/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt +++ b/packages/pigeon/example/app/android/app/src/main/kotlin/dev/flutter/pigeon_example_app/Messages.g.kt @@ -88,7 +88,7 @@ private object MessagesPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { Code.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { Code.ofRaw(it.toInt()) } } 130.toByte() -> { return (readValue(buffer) as? List)?.let { MessageData.fromList(it) } @@ -161,8 +161,8 @@ interface ExampleHostApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } - val bArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long } + val aArg = args[0] as Long + val bArg = args[1] as Long val wrapped: List = try { listOf(api.add(aArg, bArg)) diff --git a/packages/pigeon/example/app/lib/src/messages.g.dart b/packages/pigeon/example/app/lib/src/messages.g.dart index 4eaf6bccecd..0a95e8bf5f1 100644 --- a/packages/pigeon/example/app/lib/src/messages.g.dart +++ b/packages/pigeon/example/app/lib/src/messages.g.dart @@ -74,7 +74,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is Code) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is Code) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageData) { diff --git a/packages/pigeon/lib/cpp_generator.dart b/packages/pigeon/lib/cpp_generator.dart index 425c5a29768..96579cc23f9 100644 --- a/packages/pigeon/lib/cpp_generator.dart +++ b/packages/pigeon/lib/cpp_generator.dart @@ -867,9 +867,7 @@ class CppSourceGenerator extends StructuredGenerator { // Returns the expression to convert the given EncodableValue to a field // value. String getValueExpression(NamedType field, String encodable) { - if (field.type.baseName == 'int') { - return '$encodable.LongValue()'; - } else if (field.type.baseName == 'Object') { + if (field.type.baseName == 'Object') { return encodable; } else { final HostDatatype hostDatatype = @@ -1636,17 +1634,7 @@ ${prefix}reply(EncodableValue(std::move(wrapped)));'''; if (hostType.isNullable) { // Nullable arguments are always pointers, with nullptr corresponding to // null. - if (hostType.datatype == 'int64_t') { - // The EncodableValue will either be an int32_t or an int64_t depending - // on the value, but the generated API requires an int64_t so that it can - // handle any case. Create a local variable for the 64-bit value... - final String valueVarName = '${argName}_value'; - indent.writeln( - 'const int64_t $valueVarName = $encodableArgName.IsNull() ? 0 : $encodableArgName.LongValue();'); - // ... then declare the arg as a reference to that local. - indent.writeln( - 'const auto* $argName = $encodableArgName.IsNull() ? nullptr : &$valueVarName;'); - } else if (hostType.datatype == 'EncodableValue') { + if (hostType.datatype == 'EncodableValue') { // Generic objects just pass the EncodableValue through directly. indent.writeln('const auto* $argName = &$encodableArgName;'); } else if (hostType.isBuiltin) { diff --git a/packages/pigeon/lib/dart_generator.dart b/packages/pigeon/lib/dart_generator.dart index df9f3175929..e2d745657ea 100644 --- a/packages/pigeon/lib/dart_generator.dart +++ b/packages/pigeon/lib/dart_generator.dart @@ -286,7 +286,7 @@ class DartGenerator extends StructuredGenerator { required String dartPackageName, }) { void writeEncodeLogic(EnumeratedType customType) { - indent.writeScoped('if (value is ${customType.name}) {', '} else ', () { + indent.writeScoped('else if (value is ${customType.name}) {', '}', () { if (customType.enumeration < maximumCodecFieldKey) { indent.writeln('buffer.putUint8(${customType.enumeration});'); if (customType.type == CustomTypes.customClass) { @@ -343,11 +343,16 @@ class DartGenerator extends StructuredGenerator { indent.writeln('@override'); indent.write('void writeValue(WriteBuffer buffer, Object? value) '); indent.addScoped('{', '}', () { + indent.writeScoped('if (value is int) {', '}', () { + indent.writeln('buffer.putUint8(4);'); + indent.writeln('buffer.putInt64(value);'); + }, addTrailingNewline: false); + enumerate(enumeratedTypes, (int index, final EnumeratedType customType) { writeEncodeLogic(customType); }); - indent.addScoped('{', '}', () { + indent.addScoped(' else {', '}', () { indent.writeln('super.writeValue(buffer, value);'); }); }); diff --git a/packages/pigeon/lib/generator_tools.dart b/packages/pigeon/lib/generator_tools.dart index 0f02dd980d7..2bd72d076c1 100644 --- a/packages/pigeon/lib/generator_tools.dart +++ b/packages/pigeon/lib/generator_tools.dart @@ -13,7 +13,7 @@ import 'ast.dart'; /// The current version of pigeon. /// /// This must match the version in pubspec.yaml. -const String pigeonVersion = '21.2.0'; +const String pigeonVersion = '22.0.0'; /// Read all the content from [stdin] to a String. String readStdin() { diff --git a/packages/pigeon/lib/java_generator.dart b/packages/pigeon/lib/java_generator.dart index 1d4c83d6003..27a1a5915e7 100644 --- a/packages/pigeon/lib/java_generator.dart +++ b/packages/pigeon/lib/java_generator.dart @@ -30,9 +30,6 @@ const String _codecName = 'PigeonCodec'; const String _overflowClassName = '${classNamePrefix}CodecOverflow'; -// Used to create classes with type Int rather than long. -const String _forceInt = '${varNamePrefix}forceInt'; - /// Options that control how Java code will be generated. class JavaOptions { /// Creates a [JavaOptions] object @@ -253,18 +250,11 @@ class JavaGenerator extends StructuredGenerator { } void _writeClassField( - JavaOptions generatorOptions, - Indent indent, - NamedType field, { - bool isPrimitive = false, - }) { + JavaOptions generatorOptions, Indent indent, NamedType field) { final HostDatatype hostDatatype = getFieldHostDatatype( field, (TypeDeclaration x) => _javaTypeForBuiltinDartType(x)); - final String nullability = isPrimitive - ? '' - : field.type.isNullable - ? '@Nullable ' - : '@NonNull '; + final String nullability = + field.type.isNullable ? '@Nullable ' : '@NonNull '; addDocumentationComments( indent, field.documentationComments, _docCommentSpec); @@ -280,7 +270,7 @@ class JavaGenerator extends StructuredGenerator { indent.writeScoped( 'public void ${_makeSetter(field)}($nullability${hostDatatype.datatype} setterArg) {', '}', () { - if (!field.type.isNullable && !isPrimitive) { + if (!field.type.isNullable) { indent.writeScoped('if (setterArg == null) {', '}', () { indent.writeln( 'throw new IllegalStateException("Nonnull field \\"${field.name}\\" is null.");'); @@ -306,7 +296,6 @@ class JavaGenerator extends StructuredGenerator { generatorOptions, indent, field, - isPrimitive: field.type.baseName == _forceInt, ); indent.newln(); } @@ -490,7 +479,7 @@ class JavaGenerator extends StructuredGenerator { indent .writeln('$_overflowClassName wrap = new $_overflowClassName();'); indent.writeln( - 'wrap.setType(${customType.enumeration - maximumCodecFieldKey});'); + 'wrap.setType(${customType.enumeration - maximumCodecFieldKey}L);'); indent.writeln( 'wrap.setWrapped($nullCheck((${customType.name}) value).$encodeString);'); } @@ -580,7 +569,7 @@ class JavaGenerator extends StructuredGenerator { }) { final NamedType overflowInteration = NamedType( name: 'type', - type: const TypeDeclaration(baseName: _forceInt, isNullable: false)); + type: const TypeDeclaration(baseName: 'int', isNullable: false)); final NamedType overflowObject = NamedType( name: 'wrapped', type: const TypeDeclaration(baseName: 'Object', isNullable: true)); @@ -607,7 +596,7 @@ class JavaGenerator extends StructuredGenerator { indent.format(''' static @Nullable Object fromList(@NonNull ArrayList ${varNamePrefix}list) { $_overflowClassName wrapper = new $_overflowClassName(); - wrapper.setType((int) ${varNamePrefix}list.get(0)); + wrapper.setType((Long) ${varNamePrefix}list.get(0)); wrapper.setWrapped(${varNamePrefix}list.get(1)); return wrapper.unwrap(); } @@ -619,7 +608,7 @@ if (wrapped == null) { return null; } '''); - indent.writeScoped('switch (type) {', '}', () { + indent.writeScoped('switch (type.intValue()) {', '}', () { for (int i = totalCustomCodecKeysAllowed; i < types.length; i++) { indent.writeln('case ${i - totalCustomCodecKeysAllowed}:'); indent.nest(1, () { @@ -628,7 +617,7 @@ if (wrapped == null) { 'return ${types[i].name}.fromList((ArrayList) wrapped);'); } else if (types[i].type == CustomTypes.customEnum) { indent.writeln( - 'return ${types[i].name}.values()[(int) wrapped];'); + 'return ${_intToEnum('wrapped', types[i].name, false)};'); } }); } @@ -766,13 +755,8 @@ if (wrapped == null) { const String output = 'output'; final String outputExpression; indent.writeln('@SuppressWarnings("ConstantConditions")'); - if (func.returnType.baseName == 'int') { - outputExpression = - 'listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue();'; - } else { - outputExpression = - '${_cast('listReply.get(0)', javaType: returnType)};'; - } + outputExpression = + '${_cast('listReply.get(0)', javaType: returnType)};'; indent.writeln('$returnType $output = $outputExpression'); indent.writeln('result.success($output);'); } @@ -951,16 +935,9 @@ if (wrapped == null) { indent.writeln( 'ArrayList args = (ArrayList) message;'); enumerate(method.parameters, (int index, NamedType arg) { - // The StandardMessageCodec can give us [Integer, Long] for - // a Dart 'int'. To keep things simple we just use 64bit - // longs in Pigeon with Java. - final bool isInt = arg.type.baseName == 'int'; - final String argType = - isInt ? 'Number' : _javaTypeForDartType(arg.type); + final String argType = _javaTypeForDartType(arg.type); final String argName = _getSafeArgumentName(index, arg); - final String argExpression = isInt - ? '($argName == null) ? null : $argName.longValue()' - : argName; + final String argExpression = argName; String accessor = 'args.get($index)'; if (argType != 'Object') { accessor = _cast(accessor, javaType: argType); @@ -1176,9 +1153,10 @@ protected static ArrayList wrapError(@NonNull Throwable exception) { /// Converts an expression that evaluates to an nullable int to an expression /// that evaluates to a nullable enum. -String _intToEnum(String expression, String enumName, bool nullable) => nullable - ? '$expression == null ? null : $enumName.values()[(int) $expression]' - : '$enumName.values()[(int) $expression]'; +String _intToEnum(String expression, String enumName, bool nullable) { + final String toEnum = '$enumName.values()[((Long) $expression).intValue()]'; + return nullable ? '$expression == null ? null : $toEnum' : toEnum; +} String _getArgumentName(int count, NamedType argument) => argument.name.isEmpty ? 'arg$count' : argument.name; @@ -1231,8 +1209,6 @@ String? _javaTypeForBuiltinDartType(TypeDeclaration type) { 'Int64List': 'long[]', 'Float64List': 'double[]', 'Object': 'Object', - // This is used to allow the creation of true `int`s for the codec overflow class. - _forceInt: 'int', }; if (javaTypeForDartTypeMap.containsKey(type.baseName)) { return javaTypeForDartTypeMap[type.baseName]; @@ -1271,11 +1247,7 @@ String _cast(String variable, {required String javaType}) { String _castObject(NamedType field, String varName) { final HostDatatype hostDatatype = getFieldHostDatatype( field, (TypeDeclaration x) => _javaTypeForBuiltinDartType(x)); - if (field.type.baseName == 'int') { - return '($varName == null) ? null : (($varName instanceof Integer) ? (Integer) $varName : (${hostDatatype.datatype}) $varName)'; - } else { - return _cast(varName, javaType: hostDatatype.datatype); - } + return _cast(varName, javaType: hostDatatype.datatype); } /// Returns string of Result class type for method based on [TypeDeclaration]. diff --git a/packages/pigeon/lib/kotlin_generator.dart b/packages/pigeon/lib/kotlin_generator.dart index 4656f2bc16a..1e3444ce34c 100644 --- a/packages/pigeon/lib/kotlin_generator.dart +++ b/packages/pigeon/lib/kotlin_generator.dart @@ -344,9 +344,9 @@ class KotlinGenerator extends StructuredGenerator { indent.writeln('${customType.name}.fromList(it)'); }); } else if (customType.type == CustomTypes.customEnum) { - indent.write('return (readValue(buffer) as Int?)?.let '); + indent.write('return (readValue(buffer) as Long?)?.let '); indent.addScoped('{', '}', () { - indent.writeln('${customType.name}.ofRaw(it)'); + indent.writeln('${customType.name}.ofRaw(it.toInt())'); }); } }); @@ -418,7 +418,7 @@ class KotlinGenerator extends StructuredGenerator { }) { final NamedType overflowInt = NamedType( name: 'type', - type: const TypeDeclaration(baseName: 'Int', isNullable: false)); + type: const TypeDeclaration(baseName: 'int', isNullable: false)); final NamedType overflowObject = NamedType( name: 'wrapped', type: const TypeDeclaration(baseName: 'Object', isNullable: true)); @@ -445,7 +445,7 @@ class KotlinGenerator extends StructuredGenerator { companion object { fun fromList(${varNamePrefix}list: List): Any? { val wrapper = ${generatorOptions.fileSpecificClassNameComponent}$_overflowClassName( - type = ${varNamePrefix}list[0] as Int, + type = ${varNamePrefix}list[0] as Long, wrapped = ${varNamePrefix}list[1], ); return wrapper.unwrap() @@ -459,14 +459,15 @@ if (wrapped == null) { return null } '''); - indent.writeScoped('when (type) {', '}', () { + indent.writeScoped('when (type.toInt()) {', '}', () { for (int i = totalCustomCodecKeysAllowed; i < types.length; i++) { indent.writeScoped('${i - totalCustomCodecKeysAllowed} ->', '', () { if (types[i].type == CustomTypes.customClass) { indent.writeln( 'return ${types[i].name}.fromList(wrapped as List)'); } else if (types[i].type == CustomTypes.customEnum) { - indent.writeln('return ${types[i].name}.ofRaw(wrapped as Int)'); + indent.writeln( + 'return ${types[i].name}.ofRaw((wrapped as Long).toInt())'); } }); } @@ -1009,13 +1010,5 @@ String _cast(Indent indent, String variable, {required TypeDeclaration type}) { if (type.isNullable && typeString == 'Any') { return variable; } - if (typeString == 'Int' || typeString == 'Long') { - return '$variable${_castInt(type.isNullable)}'; - } return '$variable as ${_nullSafeKotlinTypeForDartType(type)}'; } - -String _castInt(bool isNullable) { - final String nullability = isNullable ? '?' : ''; - return '.let { num -> if (num is Int) num.toLong() else num as Long$nullability }'; -} diff --git a/packages/pigeon/lib/objc_generator.dart b/packages/pigeon/lib/objc_generator.dart index 6489b5d4e0e..cb93354c677 100644 --- a/packages/pigeon/lib/objc_generator.dart +++ b/packages/pigeon/lib/objc_generator.dart @@ -1440,7 +1440,6 @@ String? _nsnumberExtractionMethod( /// Example: ('FOO', ['Foo', 'Bar']) -> 'FOOFoo *, FOOBar *'). String _flattenTypeArguments(String? classPrefix, List args) { final String result = args.map((TypeDeclaration e) { - // print(e); if (e.isEnum) { return _enumName(e.baseName, prefix: classPrefix, box: true, suffix: ' *'); diff --git a/packages/pigeon/lib/swift_generator.dart b/packages/pigeon/lib/swift_generator.dart index f1c49353484..82ac6c6dda6 100644 --- a/packages/pigeon/lib/swift_generator.dart +++ b/packages/pigeon/lib/swift_generator.dart @@ -1016,7 +1016,7 @@ String _swiftTypeForBuiltinGenericDartType(TypeDeclaration type) { if (type.baseName == 'List') { return '[Any?]'; } else if (type.baseName == 'Map') { - return '[AnyHashable: Any?]'; + return '[AnyHashable?: Any?]'; } else { return 'Any'; } diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index 626992c0a65..e10034c8888 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -46,15 +46,18 @@ class AllTypes { // Lists // This name is in a different format than the others to ensure that name - // collision with the work 'list' doesn't occur in the generated files. + // collision with the word 'list' doesn't occur in the generated files. required this.list, required this.stringList, required this.intList, required this.doubleList, required this.boolList, + required this.listList, // Maps required this.map, + required this.stringMap, + required this.intMap, }); bool aBool; @@ -77,10 +80,13 @@ class AllTypes { List intList; List doubleList; List boolList; + List?> listList; // Maps // ignore: strict_raw_type, always_specify_types Map map; + Map stringMap; + Map intMap; } /// A class containing all supported nullable types. @@ -95,9 +101,6 @@ class AllNullableTypes { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -105,15 +108,19 @@ class AllNullableTypes { this.allNullableTypes, // Lists + // This name is in a different format than the others to ensure that name + // collision with the word 'list' doesn't occur in the generated files. this.list, this.stringList, this.intList, this.doubleList, this.boolList, - this.nestedClassList, + this.listList, - //Maps + // Maps this.map, + this.stringMap, + this.intMap, ); bool? aNullableBool; @@ -124,9 +131,6 @@ class AllNullableTypes { Int32List? aNullable4ByteArray; Int64List? aNullable8ByteArray; Float64List? aNullableFloatArray; - List?>? nullableNestedList; - Map? nullableMapWithAnnotations; - Map? nullableMapWithObject; AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; String? aNullableString; @@ -140,11 +144,13 @@ class AllNullableTypes { List? intList; List? doubleList; List? boolList; - List? nestedClassList; + List?>? listList; // Maps // ignore: strict_raw_type, always_specify_types Map? map; + Map? stringMap; + Map? intMap; } /// The primary purpose for this class is to ensure coverage of Swift structs @@ -160,23 +166,25 @@ class AllNullableTypesWithoutRecursion { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, this.aNullableObject, // Lists + // This name is in a different format than the others to ensure that name + // collision with the word 'list' doesn't occur in the generated files. this.list, this.stringList, this.intList, this.doubleList, this.boolList, + this.listList, - //Maps + // Maps this.map, + this.stringMap, + this.intMap, ); bool? aNullableBool; @@ -187,9 +195,6 @@ class AllNullableTypesWithoutRecursion { Int32List? aNullable4ByteArray; Int64List? aNullable8ByteArray; Float64List? aNullableFloatArray; - List?>? nullableNestedList; - Map? nullableMapWithAnnotations; - Map? nullableMapWithObject; AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; String? aNullableString; @@ -202,10 +207,13 @@ class AllNullableTypesWithoutRecursion { List? intList; List? doubleList; List? boolList; + List?>? listList; // Maps // ignore: strict_raw_type, always_specify_types Map? map; + Map? stringMap; + Map? intMap; } /// A class for testing nested class handling. @@ -283,9 +291,19 @@ abstract class HostIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoMap:') @SwiftFunction('echo(_:)') - Map echoMap(Map aMap); + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoStringMap:') + @SwiftFunction('echo(stringMap:)') + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoIntMap:') + @SwiftFunction('echo(intMap:)') + Map echoIntMap(Map intMap); - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed class to test nested class serialization and deserialization. @ObjCSelector('echoClassWrapper:') @SwiftFunction('echo(_:)') AllClassesWrapper echoClassWrapper(AllClassesWrapper wrapper); @@ -391,7 +409,18 @@ abstract class HostIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoNullableMap:') @SwiftFunction('echoNullable(_:)') - Map? echoNullableMap(Map? aNullableMap); + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableStringMap:') + @SwiftFunction('echoNullable(stringMap:)') + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableIntMap:') + @SwiftFunction('echoNullable(intMap:)') + Map? echoNullableIntMap(Map? intMap); @ObjCSelector('echoNullableEnum:') @SwiftFunction('echoNullable(_:)') @@ -464,7 +493,19 @@ abstract class HostIntegrationCoreApi { @async @ObjCSelector('echoAsyncMap:') @SwiftFunction('echoAsync(_:)') - Map echoAsyncMap(Map aMap); + Map echoAsyncMap(Map map); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncStringMap:') + @SwiftFunction('echoAsync(stringMap:)') + Map echoAsyncStringMap(Map stringMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncIntMap:') + @SwiftFunction('echoAsync(intMap:)') + Map echoAsyncIntMap(Map intMap); /// Returns the passed enum, to test asynchronous serialization and deserialization. @async @@ -557,7 +598,20 @@ abstract class HostIntegrationCoreApi { @async @ObjCSelector('echoAsyncNullableMap:') @SwiftFunction('echoAsyncNullable(_:)') - Map? echoAsyncNullableMap(Map? aMap); + Map? echoAsyncNullableMap(Map? map); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableStringMap:') + @SwiftFunction('echoAsyncNullable(stringMap:)') + Map? echoAsyncNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test asynchronous serialization and deserialization. + @async + @ObjCSelector('echoAsyncNullableIntMap:') + @SwiftFunction('echoAsyncNullable(intMap:)') + Map? echoAsyncNullableIntMap(Map? intMap); /// Returns the passed enum, to test asynchronous serialization and deserialization. @async @@ -648,7 +702,18 @@ abstract class HostIntegrationCoreApi { @async @ObjCSelector('callFlutterEchoMap:') @SwiftFunction('callFlutterEcho(_:)') - Map callFlutterEchoMap(Map aMap); + Map callFlutterEchoMap(Map map); + + @async + @ObjCSelector('callFlutterEchoStringMap:') + @SwiftFunction('callFlutterEcho(stringMap:)') + Map callFlutterEchoStringMap( + Map stringMap); + + @async + @ObjCSelector('callFlutterEchoIntMap:') + @SwiftFunction('callFlutterEcho(intMap:)') + Map callFlutterEchoIntMap(Map intMap); @async @ObjCSelector('callFlutterEchoEnum:') @@ -693,8 +758,18 @@ abstract class HostIntegrationCoreApi { @async @ObjCSelector('callFlutterEchoNullableMap:') @SwiftFunction('callFlutterEchoNullable(_:)') - Map? callFlutterEchoNullableMap( - Map? aMap); + Map? callFlutterEchoNullableMap(Map? map); + + @async + @ObjCSelector('callFlutterEchoNullableStringMap:') + @SwiftFunction('callFlutterEchoNullable(stringMap:)') + Map? callFlutterEchoNullableStringMap( + Map? stringMap); + + @async + @ObjCSelector('callFlutterEchoNullableIntMap:') + @SwiftFunction('callFlutterEchoNullable(intMap:)') + Map? callFlutterEchoNullableIntMap(Map? intMap); @async @ObjCSelector('callFlutterEchoNullableEnum:') @@ -794,7 +869,17 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoMap:') @SwiftFunction('echo(_:)') - Map echoMap(Map aMap); + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoStringMap:') + @SwiftFunction('echo(stringMap:)') + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoIntMap:') + @SwiftFunction('echo(intMap:)') + Map echoIntMap(Map intMap); /// Returns the passed enum to test serialization and deserialization. @ObjCSelector('echoEnum:') @@ -841,7 +926,18 @@ abstract class FlutterIntegrationCoreApi { /// Returns the passed map, to test serialization and deserialization. @ObjCSelector('echoNullableMap:') @SwiftFunction('echoNullable(_:)') - Map? echoNullableMap(Map? aMap); + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableStringMap:') + @SwiftFunction('echoNullable(stringMap:)') + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + @ObjCSelector('echoNullableIntMap:') + @SwiftFunction('echoNullable(intMap:)') + Map? echoNullableIntMap(Map? intMap); /// Returns the passed enum to test serialization and deserialization. @ObjCSelector('echoNullableEnum:') diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java index 9f5b079fa33..201a1febf58 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/AlternateLanguageTestPlugin.java @@ -115,8 +115,18 @@ public void throwErrorFromVoid() { } @Override - public @NonNull Map echoMap(@NonNull Map aMap) { - return aMap; + public @NonNull Map echoMap(@NonNull Map map) { + return map; + } + + @Override + public @NonNull Map echoStringMap(@NonNull Map stringMap) { + return stringMap; + } + + @Override + public @NonNull Map echoIntMap(@NonNull Map intMap) { + return intMap; } @Override @@ -221,8 +231,19 @@ public void throwErrorFromVoid() { } @Override - public @Nullable Map echoNullableMap(@Nullable Map aNullableMap) { - return aNullableMap; + public @Nullable Map echoNullableMap(@Nullable Map map) { + return map; + } + + @Override + public @Nullable Map echoNullableStringMap( + @Nullable Map stringMap) { + return stringMap; + } + + @Override + public @Nullable Map echoNullableIntMap(@Nullable Map intMap) { + return intMap; } @Override @@ -320,8 +341,20 @@ public void echoAsyncList(@NonNull List list, @NonNull Result aMap, @NonNull Result> result) { - result.success(aMap); + @NonNull Map map, @NonNull Result> result) { + result.success(map); + } + + @Override + public void echoAsyncStringMap( + @NonNull Map stringMap, @NonNull Result> result) { + result.success(stringMap); + } + + @Override + public void echoAsyncIntMap( + @NonNull Map intMap, @NonNull Result> result) { + result.success(intMap); } @Override @@ -378,8 +411,21 @@ public void echoAsyncNullableList( @Override public void echoAsyncNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result) { - result.success(aMap); + @Nullable Map map, @NonNull NullableResult> result) { + result.success(map); + } + + @Override + public void echoAsyncNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result) { + result.success(stringMap); + } + + @Override + public void echoAsyncNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result) { + result.success(intMap); } @Override @@ -494,9 +540,23 @@ public void callFlutterEchoList( @Override public void callFlutterEchoMap( - @NonNull Map aMap, @NonNull Result> result) { + @NonNull Map map, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoMap(map, result); + } + + @Override + public void callFlutterEchoStringMap( + @NonNull Map stringMap, @NonNull Result> result) { + assert flutterApi != null; + flutterApi.echoStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoIntMap( + @NonNull Map intMap, @NonNull Result> result) { assert flutterApi != null; - flutterApi.echoMap(aMap, result); + flutterApi.echoIntMap(intMap, result); } @Override @@ -556,9 +616,24 @@ public void callFlutterEchoNullableList( @Override public void callFlutterEchoNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result) { + @Nullable Map map, @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableMap(map, result); + } + + @Override + public void callFlutterEchoNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result) { + assert flutterApi != null; + flutterApi.echoNullableStringMap(stringMap, result); + } + + @Override + public void callFlutterEchoNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result) { assert flutterApi != null; - flutterApi.echoNullableMap(aMap, result); + flutterApi.echoNullableIntMap(intMap, result); } @Override diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java index 3f2ae2af2c6..6dab082bb7c 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/main/java/com/example/alternate_language_test_plugin/CoreTests.java @@ -326,6 +326,19 @@ public void setBoolList(@NonNull List setterArg) { this.boolList = setterArg; } + private @NonNull List> listList; + + public @NonNull List> getListList() { + return listList; + } + + public void setListList(@NonNull List> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"listList\" is null."); + } + this.listList = setterArg; + } + private @NonNull Map map; public @NonNull Map getMap() { @@ -339,6 +352,32 @@ public void setMap(@NonNull Map setterArg) { this.map = setterArg; } + private @NonNull Map stringMap; + + public @NonNull Map getStringMap() { + return stringMap; + } + + public void setStringMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"stringMap\" is null."); + } + this.stringMap = setterArg; + } + + private @NonNull Map intMap; + + public @NonNull Map getIntMap() { + return intMap; + } + + public void setIntMap(@NonNull Map setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"intMap\" is null."); + } + this.intMap = setterArg; + } + /** Constructor is non-public to enforce null safety; use Builder. */ AllTypes() {} @@ -368,7 +407,10 @@ public boolean equals(Object o) { && intList.equals(that.intList) && doubleList.equals(that.doubleList) && boolList.equals(that.boolList) - && map.equals(that.map); + && listList.equals(that.listList) + && map.equals(that.map) + && stringMap.equals(that.stringMap) + && intMap.equals(that.intMap); } @Override @@ -388,7 +430,10 @@ public int hashCode() { intList, doubleList, boolList, - map); + listList, + map, + stringMap, + intMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a8ByteArray); @@ -534,6 +579,14 @@ public static final class Builder { return this; } + private @Nullable List> listList; + + @CanIgnoreReturnValue + public @NonNull Builder setListList(@NonNull List> setterArg) { + this.listList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -542,6 +595,22 @@ public static final class Builder { return this; } + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@NonNull Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@NonNull Map setterArg) { + this.intMap = setterArg; + return this; + } + public @NonNull AllTypes build() { AllTypes pigeonReturn = new AllTypes(); pigeonReturn.setABool(aBool); @@ -561,14 +630,17 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); + pigeonReturn.setListList(listList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(18); + ArrayList toListResult = new ArrayList<>(21); toListResult.add(aBool); toListResult.add(anInt); toListResult.add(anInt64); @@ -586,7 +658,10 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); + toListResult.add(listList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); return toListResult; } @@ -595,13 +670,9 @@ ArrayList toList() { Object aBool = pigeonVar_list.get(0); pigeonResult.setABool((Boolean) aBool); Object anInt = pigeonVar_list.get(1); - pigeonResult.setAnInt( - (anInt == null) ? null : ((anInt instanceof Integer) ? (Integer) anInt : (Long) anInt)); + pigeonResult.setAnInt((Long) anInt); Object anInt64 = pigeonVar_list.get(2); - pigeonResult.setAnInt64( - (anInt64 == null) - ? null - : ((anInt64 instanceof Integer) ? (Integer) anInt64 : (Long) anInt64)); + pigeonResult.setAnInt64((Long) anInt64); Object aDouble = pigeonVar_list.get(3); pigeonResult.setADouble((Double) aDouble); Object aByteArray = pigeonVar_list.get(4); @@ -630,8 +701,14 @@ ArrayList toList() { pigeonResult.setDoubleList((List) doubleList); Object boolList = pigeonVar_list.get(16); pigeonResult.setBoolList((List) boolList); - Object map = pigeonVar_list.get(17); + Object listList = pigeonVar_list.get(17); + pigeonResult.setListList((List>) listList); + Object map = pigeonVar_list.get(18); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(19); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(20); + pigeonResult.setIntMap((Map) intMap); return pigeonResult; } } @@ -722,36 +799,6 @@ public void setANullableFloatArray(@Nullable double[] setterArg) { this.aNullableFloatArray = setterArg; } - private @Nullable List> nullableNestedList; - - public @Nullable List> getNullableNestedList() { - return nullableNestedList; - } - - public void setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - } - - private @Nullable Map nullableMapWithAnnotations; - - public @Nullable Map getNullableMapWithAnnotations() { - return nullableMapWithAnnotations; - } - - public void setNullableMapWithAnnotations(@Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - } - - private @Nullable Map nullableMapWithObject; - - public @Nullable Map getNullableMapWithObject() { - return nullableMapWithObject; - } - - public void setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - } - private @Nullable AnEnum aNullableEnum; public @Nullable AnEnum getANullableEnum() { @@ -852,14 +899,14 @@ public void setBoolList(@Nullable List setterArg) { this.boolList = setterArg; } - private @Nullable List nestedClassList; + private @Nullable List> listList; - public @Nullable List getNestedClassList() { - return nestedClassList; + public @Nullable List> getListList() { + return listList; } - public void setNestedClassList(@Nullable List setterArg) { - this.nestedClassList = setterArg; + public void setListList(@Nullable List> setterArg) { + this.listList = setterArg; } private @Nullable Map map; @@ -872,6 +919,26 @@ public void setMap(@Nullable Map setterArg) { this.map = setterArg; } + private @Nullable Map stringMap; + + public @Nullable Map getStringMap() { + return stringMap; + } + + public void setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + } + + private @Nullable Map intMap; + + public @Nullable Map getIntMap() { + return intMap; + } + + public void setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -889,9 +956,6 @@ public boolean equals(Object o) { && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(anotherNullableEnum, that.anotherNullableEnum) && Objects.equals(aNullableString, that.aNullableString) @@ -902,8 +966,10 @@ public boolean equals(Object o) { && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) - && Objects.equals(nestedClassList, that.nestedClassList) - && Objects.equals(map, that.map); + && Objects.equals(listList, that.listList) + && Objects.equals(map, that.map) + && Objects.equals(stringMap, that.stringMap) + && Objects.equals(intMap, that.intMap); } @Override @@ -914,9 +980,6 @@ public int hashCode() { aNullableInt, aNullableInt64, aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -927,8 +990,10 @@ public int hashCode() { intList, doubleList, boolList, - nestedClassList, - map); + listList, + map, + stringMap, + intMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable8ByteArray); @@ -1002,31 +1067,6 @@ public static final class Builder { return this; } - private @Nullable List> nullableNestedList; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - return this; - } - - private @Nullable Map nullableMapWithAnnotations; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - return this; - } - - private @Nullable Map nullableMapWithObject; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - return this; - } - private @Nullable AnEnum aNullableEnum; @CanIgnoreReturnValue @@ -1107,11 +1147,11 @@ public static final class Builder { return this; } - private @Nullable List nestedClassList; + private @Nullable List> listList; @CanIgnoreReturnValue - public @NonNull Builder setNestedClassList(@Nullable List setterArg) { - this.nestedClassList = setterArg; + public @NonNull Builder setListList(@Nullable List> setterArg) { + this.listList = setterArg; return this; } @@ -1123,6 +1163,22 @@ public static final class Builder { return this; } + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + return this; + } + public @NonNull AllNullableTypes build() { AllNullableTypes pigeonReturn = new AllNullableTypes(); pigeonReturn.setANullableBool(aNullableBool); @@ -1133,9 +1189,6 @@ public static final class Builder { pigeonReturn.setANullable4ByteArray(aNullable4ByteArray); pigeonReturn.setANullable8ByteArray(aNullable8ByteArray); pigeonReturn.setANullableFloatArray(aNullableFloatArray); - pigeonReturn.setNullableNestedList(nullableNestedList); - pigeonReturn.setNullableMapWithAnnotations(nullableMapWithAnnotations); - pigeonReturn.setNullableMapWithObject(nullableMapWithObject); pigeonReturn.setANullableEnum(aNullableEnum); pigeonReturn.setAnotherNullableEnum(anotherNullableEnum); pigeonReturn.setANullableString(aNullableString); @@ -1146,15 +1199,17 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); - pigeonReturn.setNestedClassList(nestedClassList); + pigeonReturn.setListList(listList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(23); + ArrayList toListResult = new ArrayList<>(22); toListResult.add(aNullableBool); toListResult.add(aNullableInt); toListResult.add(aNullableInt64); @@ -1163,9 +1218,6 @@ ArrayList toList() { toListResult.add(aNullable4ByteArray); toListResult.add(aNullable8ByteArray); toListResult.add(aNullableFloatArray); - toListResult.add(nullableNestedList); - toListResult.add(nullableMapWithAnnotations); - toListResult.add(nullableMapWithObject); toListResult.add(aNullableEnum); toListResult.add(anotherNullableEnum); toListResult.add(aNullableString); @@ -1176,8 +1228,10 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); - toListResult.add(nestedClassList); + toListResult.add(listList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); return toListResult; } @@ -1186,17 +1240,9 @@ ArrayList toList() { Object aNullableBool = pigeonVar_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = pigeonVar_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((Long) aNullableInt); Object aNullableInt64 = pigeonVar_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((Long) aNullableInt64); Object aNullableDouble = pigeonVar_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = pigeonVar_list.get(4); @@ -1207,36 +1253,34 @@ ArrayList toList() { pigeonResult.setANullable8ByteArray((long[]) aNullable8ByteArray); Object aNullableFloatArray = pigeonVar_list.get(7); pigeonResult.setANullableFloatArray((double[]) aNullableFloatArray); - Object nullableNestedList = pigeonVar_list.get(8); - pigeonResult.setNullableNestedList((List>) nullableNestedList); - Object nullableMapWithAnnotations = pigeonVar_list.get(9); - pigeonResult.setNullableMapWithAnnotations((Map) nullableMapWithAnnotations); - Object nullableMapWithObject = pigeonVar_list.get(10); - pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); - Object aNullableEnum = pigeonVar_list.get(11); + Object aNullableEnum = pigeonVar_list.get(8); pigeonResult.setANullableEnum((AnEnum) aNullableEnum); - Object anotherNullableEnum = pigeonVar_list.get(12); + Object anotherNullableEnum = pigeonVar_list.get(9); pigeonResult.setAnotherNullableEnum((AnotherEnum) anotherNullableEnum); - Object aNullableString = pigeonVar_list.get(13); + Object aNullableString = pigeonVar_list.get(10); pigeonResult.setANullableString((String) aNullableString); - Object aNullableObject = pigeonVar_list.get(14); + Object aNullableObject = pigeonVar_list.get(11); pigeonResult.setANullableObject(aNullableObject); - Object allNullableTypes = pigeonVar_list.get(15); + Object allNullableTypes = pigeonVar_list.get(12); pigeonResult.setAllNullableTypes((AllNullableTypes) allNullableTypes); - Object list = pigeonVar_list.get(16); + Object list = pigeonVar_list.get(13); pigeonResult.setList((List) list); - Object stringList = pigeonVar_list.get(17); + Object stringList = pigeonVar_list.get(14); pigeonResult.setStringList((List) stringList); - Object intList = pigeonVar_list.get(18); + Object intList = pigeonVar_list.get(15); pigeonResult.setIntList((List) intList); - Object doubleList = pigeonVar_list.get(19); + Object doubleList = pigeonVar_list.get(16); pigeonResult.setDoubleList((List) doubleList); - Object boolList = pigeonVar_list.get(20); + Object boolList = pigeonVar_list.get(17); pigeonResult.setBoolList((List) boolList); - Object nestedClassList = pigeonVar_list.get(21); - pigeonResult.setNestedClassList((List) nestedClassList); - Object map = pigeonVar_list.get(22); + Object listList = pigeonVar_list.get(18); + pigeonResult.setListList((List>) listList); + Object map = pigeonVar_list.get(19); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(20); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(21); + pigeonResult.setIntMap((Map) intMap); return pigeonResult; } } @@ -1328,36 +1372,6 @@ public void setANullableFloatArray(@Nullable double[] setterArg) { this.aNullableFloatArray = setterArg; } - private @Nullable List> nullableNestedList; - - public @Nullable List> getNullableNestedList() { - return nullableNestedList; - } - - public void setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - } - - private @Nullable Map nullableMapWithAnnotations; - - public @Nullable Map getNullableMapWithAnnotations() { - return nullableMapWithAnnotations; - } - - public void setNullableMapWithAnnotations(@Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - } - - private @Nullable Map nullableMapWithObject; - - public @Nullable Map getNullableMapWithObject() { - return nullableMapWithObject; - } - - public void setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - } - private @Nullable AnEnum aNullableEnum; public @Nullable AnEnum getANullableEnum() { @@ -1448,6 +1462,16 @@ public void setBoolList(@Nullable List setterArg) { this.boolList = setterArg; } + private @Nullable List> listList; + + public @Nullable List> getListList() { + return listList; + } + + public void setListList(@Nullable List> setterArg) { + this.listList = setterArg; + } + private @Nullable Map map; public @Nullable Map getMap() { @@ -1458,6 +1482,26 @@ public void setMap(@Nullable Map setterArg) { this.map = setterArg; } + private @Nullable Map stringMap; + + public @Nullable Map getStringMap() { + return stringMap; + } + + public void setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + } + + private @Nullable Map intMap; + + public @Nullable Map getIntMap() { + return intMap; + } + + public void setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1475,9 +1519,6 @@ public boolean equals(Object o) { && Arrays.equals(aNullable4ByteArray, that.aNullable4ByteArray) && Arrays.equals(aNullable8ByteArray, that.aNullable8ByteArray) && Arrays.equals(aNullableFloatArray, that.aNullableFloatArray) - && Objects.equals(nullableNestedList, that.nullableNestedList) - && Objects.equals(nullableMapWithAnnotations, that.nullableMapWithAnnotations) - && Objects.equals(nullableMapWithObject, that.nullableMapWithObject) && Objects.equals(aNullableEnum, that.aNullableEnum) && Objects.equals(anotherNullableEnum, that.anotherNullableEnum) && Objects.equals(aNullableString, that.aNullableString) @@ -1487,7 +1528,10 @@ public boolean equals(Object o) { && Objects.equals(intList, that.intList) && Objects.equals(doubleList, that.doubleList) && Objects.equals(boolList, that.boolList) - && Objects.equals(map, that.map); + && Objects.equals(listList, that.listList) + && Objects.equals(map, that.map) + && Objects.equals(stringMap, that.stringMap) + && Objects.equals(intMap, that.intMap); } @Override @@ -1498,9 +1542,6 @@ public int hashCode() { aNullableInt, aNullableInt64, aNullableDouble, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -1510,7 +1551,10 @@ public int hashCode() { intList, doubleList, boolList, - map); + listList, + map, + stringMap, + intMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable8ByteArray); @@ -1584,31 +1628,6 @@ public static final class Builder { return this; } - private @Nullable List> nullableNestedList; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableNestedList(@Nullable List> setterArg) { - this.nullableNestedList = setterArg; - return this; - } - - private @Nullable Map nullableMapWithAnnotations; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithAnnotations( - @Nullable Map setterArg) { - this.nullableMapWithAnnotations = setterArg; - return this; - } - - private @Nullable Map nullableMapWithObject; - - @CanIgnoreReturnValue - public @NonNull Builder setNullableMapWithObject(@Nullable Map setterArg) { - this.nullableMapWithObject = setterArg; - return this; - } - private @Nullable AnEnum aNullableEnum; @CanIgnoreReturnValue @@ -1681,6 +1700,14 @@ public static final class Builder { return this; } + private @Nullable List> listList; + + @CanIgnoreReturnValue + public @NonNull Builder setListList(@Nullable List> setterArg) { + this.listList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -1689,6 +1716,22 @@ public static final class Builder { return this; } + private @Nullable Map stringMap; + + @CanIgnoreReturnValue + public @NonNull Builder setStringMap(@Nullable Map setterArg) { + this.stringMap = setterArg; + return this; + } + + private @Nullable Map intMap; + + @CanIgnoreReturnValue + public @NonNull Builder setIntMap(@Nullable Map setterArg) { + this.intMap = setterArg; + return this; + } + public @NonNull AllNullableTypesWithoutRecursion build() { AllNullableTypesWithoutRecursion pigeonReturn = new AllNullableTypesWithoutRecursion(); pigeonReturn.setANullableBool(aNullableBool); @@ -1699,9 +1742,6 @@ public static final class Builder { pigeonReturn.setANullable4ByteArray(aNullable4ByteArray); pigeonReturn.setANullable8ByteArray(aNullable8ByteArray); pigeonReturn.setANullableFloatArray(aNullableFloatArray); - pigeonReturn.setNullableNestedList(nullableNestedList); - pigeonReturn.setNullableMapWithAnnotations(nullableMapWithAnnotations); - pigeonReturn.setNullableMapWithObject(nullableMapWithObject); pigeonReturn.setANullableEnum(aNullableEnum); pigeonReturn.setAnotherNullableEnum(anotherNullableEnum); pigeonReturn.setANullableString(aNullableString); @@ -1711,7 +1751,10 @@ public static final class Builder { pigeonReturn.setIntList(intList); pigeonReturn.setDoubleList(doubleList); pigeonReturn.setBoolList(boolList); + pigeonReturn.setListList(listList); pigeonReturn.setMap(map); + pigeonReturn.setStringMap(stringMap); + pigeonReturn.setIntMap(intMap); return pigeonReturn; } } @@ -1727,9 +1770,6 @@ ArrayList toList() { toListResult.add(aNullable4ByteArray); toListResult.add(aNullable8ByteArray); toListResult.add(aNullableFloatArray); - toListResult.add(nullableNestedList); - toListResult.add(nullableMapWithAnnotations); - toListResult.add(nullableMapWithObject); toListResult.add(aNullableEnum); toListResult.add(anotherNullableEnum); toListResult.add(aNullableString); @@ -1739,7 +1779,10 @@ ArrayList toList() { toListResult.add(intList); toListResult.add(doubleList); toListResult.add(boolList); + toListResult.add(listList); toListResult.add(map); + toListResult.add(stringMap); + toListResult.add(intMap); return toListResult; } @@ -1749,17 +1792,9 @@ ArrayList toList() { Object aNullableBool = pigeonVar_list.get(0); pigeonResult.setANullableBool((Boolean) aNullableBool); Object aNullableInt = pigeonVar_list.get(1); - pigeonResult.setANullableInt( - (aNullableInt == null) - ? null - : ((aNullableInt instanceof Integer) ? (Integer) aNullableInt : (Long) aNullableInt)); + pigeonResult.setANullableInt((Long) aNullableInt); Object aNullableInt64 = pigeonVar_list.get(2); - pigeonResult.setANullableInt64( - (aNullableInt64 == null) - ? null - : ((aNullableInt64 instanceof Integer) - ? (Integer) aNullableInt64 - : (Long) aNullableInt64)); + pigeonResult.setANullableInt64((Long) aNullableInt64); Object aNullableDouble = pigeonVar_list.get(3); pigeonResult.setANullableDouble((Double) aNullableDouble); Object aNullableByteArray = pigeonVar_list.get(4); @@ -1770,32 +1805,32 @@ ArrayList toList() { pigeonResult.setANullable8ByteArray((long[]) aNullable8ByteArray); Object aNullableFloatArray = pigeonVar_list.get(7); pigeonResult.setANullableFloatArray((double[]) aNullableFloatArray); - Object nullableNestedList = pigeonVar_list.get(8); - pigeonResult.setNullableNestedList((List>) nullableNestedList); - Object nullableMapWithAnnotations = pigeonVar_list.get(9); - pigeonResult.setNullableMapWithAnnotations((Map) nullableMapWithAnnotations); - Object nullableMapWithObject = pigeonVar_list.get(10); - pigeonResult.setNullableMapWithObject((Map) nullableMapWithObject); - Object aNullableEnum = pigeonVar_list.get(11); + Object aNullableEnum = pigeonVar_list.get(8); pigeonResult.setANullableEnum((AnEnum) aNullableEnum); - Object anotherNullableEnum = pigeonVar_list.get(12); + Object anotherNullableEnum = pigeonVar_list.get(9); pigeonResult.setAnotherNullableEnum((AnotherEnum) anotherNullableEnum); - Object aNullableString = pigeonVar_list.get(13); + Object aNullableString = pigeonVar_list.get(10); pigeonResult.setANullableString((String) aNullableString); - Object aNullableObject = pigeonVar_list.get(14); + Object aNullableObject = pigeonVar_list.get(11); pigeonResult.setANullableObject(aNullableObject); - Object list = pigeonVar_list.get(15); + Object list = pigeonVar_list.get(12); pigeonResult.setList((List) list); - Object stringList = pigeonVar_list.get(16); + Object stringList = pigeonVar_list.get(13); pigeonResult.setStringList((List) stringList); - Object intList = pigeonVar_list.get(17); + Object intList = pigeonVar_list.get(14); pigeonResult.setIntList((List) intList); - Object doubleList = pigeonVar_list.get(18); + Object doubleList = pigeonVar_list.get(15); pigeonResult.setDoubleList((List) doubleList); - Object boolList = pigeonVar_list.get(19); + Object boolList = pigeonVar_list.get(16); pigeonResult.setBoolList((List) boolList); - Object map = pigeonVar_list.get(20); + Object listList = pigeonVar_list.get(17); + pigeonResult.setListList((List>) listList); + Object map = pigeonVar_list.get(18); pigeonResult.setMap((Map) map); + Object stringMap = pigeonVar_list.get(19); + pigeonResult.setStringMap((Map) stringMap); + Object intMap = pigeonVar_list.get(20); + pigeonResult.setIntMap((Map) intMap); return pigeonResult; } } @@ -2000,12 +2035,12 @@ protected Object readValueOfType(byte type, @NonNull ByteBuffer buffer) { case (byte) 129: { Object value = readValue(buffer); - return value == null ? null : AnEnum.values()[(int) value]; + return value == null ? null : AnEnum.values()[((Long) value).intValue()]; } case (byte) 130: { Object value = readValue(buffer); - return value == null ? null : AnotherEnum.values()[(int) value]; + return value == null ? null : AnotherEnum.values()[((Long) value).intValue()]; } case (byte) 131: return AllTypes.fromList((ArrayList) readValue(buffer)); @@ -2120,8 +2155,14 @@ public interface HostIntegrationCoreApi { List echoList(@NonNull List list); /** Returns the passed map, to test serialization and deserialization. */ @NonNull - Map echoMap(@NonNull Map aMap); - /** Returns the passed map to test nested class serialization and deserialization. */ + Map echoMap(@NonNull Map map); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoStringMap(@NonNull Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @NonNull + Map echoIntMap(@NonNull Map intMap); + /** Returns the passed class to test nested class serialization and deserialization. */ @NonNull AllClassesWrapper echoClassWrapper(@NonNull AllClassesWrapper wrapper); /** Returns the passed enum to test serialization and deserialization. */ @@ -2191,7 +2232,13 @@ AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( List echoNullableList(@Nullable List aNullableList); /** Returns the passed map, to test serialization and deserialization. */ @Nullable - Map echoNullableMap(@Nullable Map aNullableMap); + Map echoNullableMap(@Nullable Map map); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableStringMap(@Nullable Map stringMap); + /** Returns the passed map, to test serialization and deserialization. */ + @Nullable + Map echoNullableIntMap(@Nullable Map intMap); @Nullable AnEnum echoNullableEnum(@Nullable AnEnum anEnum); @@ -2225,7 +2272,12 @@ AllNullableTypesWithoutRecursion sendMultipleNullableTypesWithoutRecursion( void echoAsyncList(@NonNull List list, @NonNull Result> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncMap( - @NonNull Map aMap, @NonNull Result> result); + @NonNull Map map, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncStringMap( + @NonNull Map stringMap, @NonNull Result> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncIntMap(@NonNull Map intMap, @NonNull Result> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncEnum(@NonNull AnEnum anEnum, @NonNull Result result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -2264,7 +2316,14 @@ void echoAsyncNullableList( @Nullable List list, @NonNull NullableResult> result); /** Returns the passed map, to test asynchronous serialization and deserialization. */ void echoAsyncNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + @Nullable Map map, @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result); + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + void echoAsyncNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ void echoAsyncNullableEnum(@Nullable AnEnum anEnum, @NonNull NullableResult result); /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -2311,7 +2370,13 @@ void callFlutterSendMultipleNullableTypesWithoutRecursion( void callFlutterEchoList(@NonNull List list, @NonNull Result> result); void callFlutterEchoMap( - @NonNull Map aMap, @NonNull Result> result); + @NonNull Map map, @NonNull Result> result); + + void callFlutterEchoStringMap( + @NonNull Map stringMap, @NonNull Result> result); + + void callFlutterEchoIntMap( + @NonNull Map intMap, @NonNull Result> result); void callFlutterEchoEnum(@NonNull AnEnum anEnum, @NonNull Result result); @@ -2336,7 +2401,14 @@ void callFlutterEchoNullableList( @Nullable List list, @NonNull NullableResult> result); void callFlutterEchoNullableMap( - @Nullable Map aMap, @NonNull NullableResult> result); + @Nullable Map map, @NonNull NullableResult> result); + + void callFlutterEchoNullableStringMap( + @Nullable Map stringMap, + @NonNull NullableResult> result); + + void callFlutterEchoNullableIntMap( + @Nullable Map intMap, @NonNull NullableResult> result); void callFlutterEchoNullableEnum( @Nullable AnEnum anEnum, @NonNull NullableResult result); @@ -2493,9 +2565,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); try { - Long output = api.echoInt((anIntArg == null) ? null : anIntArg.longValue()); + Long output = api.echoInt(anIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2668,9 +2740,59 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); + Map mapArg = (Map) args.get(0); + try { + Map output = api.echoMap(mapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + try { + Map output = api.echoStringMap(stringMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); try { - Map output = api.echoMap(aMapArg); + Map output = api.echoIntMap(intMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2818,10 +2940,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); try { - Long output = - api.echoRequiredInt((anIntArg == null) ? null : anIntArg.longValue()); + Long output = api.echoRequiredInt(anIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2947,14 +3068,12 @@ static void setUp( ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); + Long aNullableIntArg = (Long) args.get(1); String aNullableStringArg = (String) args.get(2); try { AllNullableTypes output = api.sendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + aNullableBoolArg, aNullableIntArg, aNullableStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -2978,14 +3097,12 @@ static void setUp( ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); + Long aNullableIntArg = (Long) args.get(1); String aNullableStringArg = (String) args.get(2); try { AllNullableTypesWithoutRecursion output = api.sendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg); + aNullableBoolArg, aNullableIntArg, aNullableStringArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3008,11 +3125,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aNullableIntArg = (Number) args.get(0); + Long aNullableIntArg = (Long) args.get(0); try { - Long output = - api.echoNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = api.echoNullableInt(aNullableIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3185,9 +3300,59 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aNullableMapArg = (Map) args.get(0); + Map mapArg = (Map) args.get(0); + try { + Map output = api.echoNullableMap(mapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + try { + Map output = api.echoNullableStringMap(stringMapArg); + wrapped.add(0, output); + } catch (Throwable exception) { + wrapped = wrapError(exception); + } + reply.reply(wrapped); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); try { - Map output = api.echoNullableMap(aNullableMapArg); + Map output = api.echoNullableIntMap(intMapArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3260,11 +3425,9 @@ static void setUp( (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number aNullableIntArg = (Number) args.get(0); + Long aNullableIntArg = (Long) args.get(0); try { - Long output = - api.echoOptionalNullableInt( - (aNullableIntArg == null) ? null : aNullableIntArg.longValue()); + Long output = api.echoOptionalNullableInt(aNullableIntArg); wrapped.add(0, output); } catch (Throwable exception) { wrapped = wrapError(exception); @@ -3342,7 +3505,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); Result resultCallback = new Result() { public void success(Long result) { @@ -3356,7 +3519,7 @@ public void error(Throwable error) { } }; - api.echoAsyncInt((anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3566,10 +3729,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - Result> resultCallback = - new Result>() { - public void success(Map result) { + Map mapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -3580,7 +3743,71 @@ public void error(Throwable error) { } }; - api.echoAsyncMap(aMapArg, resultCallback); + api.echoAsyncMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncIntMap(intMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -3850,7 +4077,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(Long result) { @@ -3864,8 +4091,7 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.echoAsyncNullableInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4075,10 +4301,42 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(Map result) { + Map mapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4089,7 +4347,39 @@ public void error(Throwable error) { } }; - api.echoAsyncNullableMap(aMapArg, resultCallback); + api.echoAsyncNullableStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.echoAsyncNullableIntMap(intMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4326,7 +4616,7 @@ public void error(Throwable error) { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); + Long aNullableIntArg = (Long) args.get(1); String aNullableStringArg = (String) args.get(2); Result resultCallback = new Result() { @@ -4342,10 +4632,7 @@ public void error(Throwable error) { }; api.callFlutterSendMultipleNullableTypes( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + aNullableBoolArg, aNullableIntArg, aNullableStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4397,7 +4684,7 @@ public void error(Throwable error) { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; Boolean aNullableBoolArg = (Boolean) args.get(0); - Number aNullableIntArg = (Number) args.get(1); + Long aNullableIntArg = (Long) args.get(1); String aNullableStringArg = (String) args.get(2); Result resultCallback = new Result() { @@ -4413,10 +4700,7 @@ public void error(Throwable error) { }; api.callFlutterSendMultipleNullableTypesWithoutRecursion( - aNullableBoolArg, - (aNullableIntArg == null) ? null : aNullableIntArg.longValue(), - aNullableStringArg, - resultCallback); + aNullableBoolArg, aNullableIntArg, aNullableStringArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4466,7 +4750,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); Result resultCallback = new Result() { public void success(Long result) { @@ -4480,8 +4764,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4627,10 +4910,74 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - Result> resultCallback = - new Result>() { - public void success(Map result) { + Map mapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + Result> resultCallback = + new Result>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4641,7 +4988,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoMap(aMapArg, resultCallback); + api.callFlutterEchoIntMap(intMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4755,7 +5102,7 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Number anIntArg = (Number) args.get(0); + Long anIntArg = (Long) args.get(0); NullableResult resultCallback = new NullableResult() { public void success(Long result) { @@ -4769,8 +5116,7 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableInt( - (anIntArg == null) ? null : anIntArg.longValue(), resultCallback); + api.callFlutterEchoNullableInt(anIntArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -4916,10 +5262,10 @@ public void error(Throwable error) { (message, reply) -> { ArrayList wrapped = new ArrayList<>(); ArrayList args = (ArrayList) message; - Map aMapArg = (Map) args.get(0); - NullableResult> resultCallback = - new NullableResult>() { - public void success(Map result) { + Map mapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { wrapped.add(0, result); reply.reply(wrapped); } @@ -4930,7 +5276,71 @@ public void error(Throwable error) { } }; - api.callFlutterEchoNullableMap(aMapArg, resultCallback); + api.callFlutterEchoNullableMap(mapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map stringMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableStringMap(stringMapArg, resultCallback); + }); + } else { + channel.setMessageHandler(null); + } + } + { + BasicMessageChannel channel = + new BasicMessageChannel<>( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap" + + messageChannelSuffix, + getCodec()); + if (api != null) { + channel.setMessageHandler( + (message, reply) -> { + ArrayList wrapped = new ArrayList<>(); + ArrayList args = (ArrayList) message; + Map intMapArg = (Map) args.get(0); + NullableResult> resultCallback = + new NullableResult>() { + public void success(Map result) { + wrapped.add(0, result); + reply.reply(wrapped); + } + + public void error(Throwable error) { + ArrayList wrappedError = wrapError(error); + reply.reply(wrappedError); + } + }; + + api.callFlutterEchoNullableIntMap(intMapArg, resultCallback); }); } else { channel.setMessageHandler(null); @@ -5360,8 +5770,7 @@ public void echoInt(@NonNull Long anIntArg, @NonNull Result result) { "")); } else { @SuppressWarnings("ConstantConditions") - Long output = - listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue(); + Long output = (Long) listReply.get(0); result.success(output); } } else { @@ -5499,14 +5908,47 @@ public void echoList(@NonNull List listArg, @NonNull Result } /** Returns the passed map, to test serialization and deserialization. */ public void echoMap( - @NonNull Map aMapArg, @NonNull Result> result) { + @NonNull Map mapArg, @NonNull Result> result) { final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aMapArg)), + new ArrayList<>(Collections.singletonList(mapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoStringMap( + @NonNull Map stringMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(stringMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5522,7 +5964,40 @@ public void echoMap( "")); } else { @SuppressWarnings("ConstantConditions") - Map output = (Map) listReply.get(0); + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoIntMap( + @NonNull Map intMapArg, @NonNull Result> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(intMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else if (listReply.get(0) == null) { + result.error( + new FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + "")); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); result.success(output); } } else { @@ -5640,8 +6115,7 @@ public void echoNullableInt(@Nullable Long anIntArg, @NonNull NullableResult aMapArg, - @NonNull NullableResult> result) { + @Nullable Map mapArg, @NonNull NullableResult> result) { final String channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap" + messageChannelSuffix; BasicMessageChannel channel = new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); channel.send( - new ArrayList<>(Collections.singletonList(aMapArg)), + new ArrayList<>(Collections.singletonList(mapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableStringMap( + @Nullable Map stringMapArg, + @NonNull NullableResult> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(stringMapArg)), + channelReply -> { + if (channelReply instanceof List) { + List listReply = (List) channelReply; + if (listReply.size() > 1) { + result.error( + new FlutterError( + (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); + } else { + @SuppressWarnings("ConstantConditions") + Map output = (Map) listReply.get(0); + result.success(output); + } + } else { + result.error(createConnectionError(channelName)); + } + }); + } + /** Returns the passed map, to test serialization and deserialization. */ + public void echoNullableIntMap( + @Nullable Map intMapArg, @NonNull NullableResult> result) { + final String channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap" + + messageChannelSuffix; + BasicMessageChannel channel = + new BasicMessageChannel<>(binaryMessenger, channelName, getCodec()); + channel.send( + new ArrayList<>(Collections.singletonList(intMapArg)), channelReply -> { if (channelReply instanceof List) { List listReply = (List) channelReply; @@ -5777,7 +6305,7 @@ public void echoNullableMap( (String) listReply.get(0), (String) listReply.get(1), listReply.get(2))); } else { @SuppressWarnings("ConstantConditions") - Map output = (Map) listReply.get(0); + Map output = (Map) listReply.get(0); result.success(output); } } else { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java index 99bbb49c7ec..670c8492d64 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/AllDatatypesTest.java @@ -15,6 +15,7 @@ import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; +import java.util.List; import org.junit.Test; public class AllDatatypesTest { @@ -67,19 +68,27 @@ void compareAllNullableTypes(AllNullableTypes firstTypes, AllNullableTypes secon assertTrue( floatArraysEqual( firstTypes.getANullableFloatArray(), secondTypes.getANullableFloatArray())); - assertArrayEquals( - firstTypes.getNullableMapWithObject().values().toArray(), - secondTypes.getNullableMapWithObject().values().toArray()); assertEquals(firstTypes.getANullableObject(), secondTypes.getANullableObject()); assertArrayEquals(firstTypes.getList().toArray(), secondTypes.getList().toArray()); assertArrayEquals(firstTypes.getStringList().toArray(), secondTypes.getStringList().toArray()); assertArrayEquals(firstTypes.getBoolList().toArray(), secondTypes.getBoolList().toArray()); assertArrayEquals(firstTypes.getDoubleList().toArray(), secondTypes.getDoubleList().toArray()); assertArrayEquals(firstTypes.getIntList().toArray(), secondTypes.getIntList().toArray()); + assertArrayEquals(firstTypes.getListList().toArray(), secondTypes.getListList().toArray()); assertArrayEquals( firstTypes.getMap().keySet().toArray(), secondTypes.getMap().keySet().toArray()); assertArrayEquals( firstTypes.getMap().values().toArray(), secondTypes.getMap().values().toArray()); + assertArrayEquals( + firstTypes.getStringMap().keySet().toArray(), + secondTypes.getStringMap().keySet().toArray()); + assertArrayEquals( + firstTypes.getStringMap().values().toArray(), + secondTypes.getStringMap().values().toArray()); + assertArrayEquals( + firstTypes.getIntMap().keySet().toArray(), secondTypes.getIntMap().keySet().toArray()); + assertArrayEquals( + firstTypes.getIntMap().values().toArray(), secondTypes.getIntMap().values().toArray()); // Also check that the implementation of equality works. assertEquals(firstTypes, secondTypes); @@ -120,13 +129,15 @@ public void success(AllNullableTypes result) { assertNull(everything.getANullable4ByteArray()); assertNull(everything.getANullable8ByteArray()); assertNull(everything.getANullableFloatArray()); - assertNull(everything.getNullableMapWithObject()); assertNull(everything.getList()); assertNull(everything.getDoubleList()); assertNull(everything.getIntList()); assertNull(everything.getStringList()); assertNull(everything.getBoolList()); + assertNull(everything.getListList()); assertNull(everything.getMap()); + assertNull(everything.getStringMap()); + assertNull(everything.getIntMap()); } public void error(Throwable error) { @@ -142,8 +153,14 @@ private static HashMap makeMap(String key, Integer value) { return result; } - private static HashMap makeStringMap(String key, Integer value) { - HashMap result = new HashMap(); + private static HashMap makeStringMap(String key, String value) { + HashMap result = new HashMap(); + result.put(key, value); + return result; + } + + private static HashMap makeIntMap(Long key, Long value) { + HashMap result = new HashMap(); result.put(key, value); return result; } @@ -163,7 +180,9 @@ private static boolean floatArraysEqual(double[] x, double[] y) { @Test public void hasValues() { // Not inline due to warnings about an ambiguous varargs call when inline. - final Object[] genericList = new Boolean[] {true, false}; + final List genericList = Arrays.asList(new Object[] {"hello", 1, true, false, null}); + final List> listList = new ArrayList<>(Arrays.asList()); + listList.add(genericList); AllTypes allEverything = new AllTypes.Builder() .setABool(false) @@ -178,12 +197,15 @@ public void hasValues() { .setAnEnum(CoreTests.AnEnum.ONE) .setAnotherEnum(CoreTests.AnotherEnum.JUST_IN_CASE) .setAnObject(0) + .setList(genericList) .setBoolList(Arrays.asList(new Boolean[] {true, false})) .setDoubleList(Arrays.asList(new Double[] {0.5, 0.25, 1.5, 1.25})) .setIntList(Arrays.asList(new Long[] {1l, 2l, 3l, 4l})) - .setList(Arrays.asList(genericList)) .setStringList(Arrays.asList(new String[] {"string", "another one"})) + .setListList(listList) .setMap(makeMap("hello", 1234)) + .setIntMap(makeIntMap(1L, 0L)) + .setStringMap(makeStringMap("hello", "you")) .build(); AllNullableTypes everything = @@ -196,14 +218,16 @@ public void hasValues() { .setANullable4ByteArray(new int[] {1, 2, 3, 4}) .setANullable8ByteArray(new long[] {1, 2, 3, 4}) .setANullableFloatArray(new double[] {0.5, 0.25, 1.5, 1.25}) - .setNullableMapWithObject(makeStringMap("hello", 1234)) .setANullableObject(0) + .setList(Arrays.asList(genericList)) .setBoolList(Arrays.asList(new Boolean[] {true, false})) .setDoubleList(Arrays.asList(new Double[] {0.5, 0.25, 1.5, 1.25})) .setIntList(Arrays.asList(new Long[] {1l, 2l, 3l, 4l})) - .setList(Arrays.asList(genericList)) .setStringList(Arrays.asList(new String[] {"string", "another one"})) + .setListList(listList) .setMap(makeMap("hello", 1234)) + .setStringMap(makeStringMap("hello", "you")) + .setIntMap(makeIntMap(2L, -2L)) .build(); BinaryMessenger binaryMessenger = mock(BinaryMessenger.class); @@ -238,17 +262,4 @@ public void error(Throwable error) { }); assertTrue(didCall[0]); } - - @Test - public void integerToLong() { - AllNullableTypes everything = new AllNullableTypes(); - everything.setANullableInt(123L); - ArrayList list = everything.toList(); - assertNotNull(list); - assertNull(list.get(0)); - assertNotNull(list.get(1)); - list.set(1, 123); - AllNullableTypes readEverything = AllNullableTypes.fromList(list); - assertEquals(readEverything.getANullableInt(), everything.getANullableInt()); - } } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java index fc96adc2cb4..8624bced5b1 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/android/src/test/java/com/example/alternate_language_test_plugin/PrimitiveTest.java @@ -32,14 +32,6 @@ private static BinaryMessenger makeMockBinaryMessenger() { ArrayList args = (ArrayList) PrimitiveFlutterApi.getCodec().decodeMessage(message); Object arg = args.get(0); - if (arg instanceof Long) { - Long longArg = (Long) arg; - if (longArg.intValue() == longArg.longValue()) { - // Value fits in the Integer so gets sent as such - // https://docs.flutter.dev/development/platform-integration/platform-channels?tab=type-mappings-java-tab#codec - arg = Integer.valueOf(longArg.intValue()); - } - } ArrayList wrapped = new ArrayList(); wrapped.add(0, arg); ByteBuffer replyData = PrimitiveFlutterApi.getCodec().encodeMessage(wrapped); @@ -106,7 +98,7 @@ public void primitiveIntHostApi() { handler.capture()); MessageCodec codec = PrimitiveHostApi.getCodec(); @SuppressWarnings("unchecked") - ByteBuffer message = codec.encodeMessage(new ArrayList(Arrays.asList((Integer) 1))); + ByteBuffer message = codec.encodeMessage(new ArrayList(Arrays.asList(1L))); message.rewind(); handler .getValue() diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m index a605276d159..1a8bee6e56d 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/example/ios/RunnerTests/AllDatatypesTest.m @@ -58,13 +58,15 @@ - (void)testAllEquals { typedDataWithInt64:[@"12345678" dataUsingEncoding:NSUTF8StringEncoding]]; everything.aNullableFloatArray = [FlutterStandardTypedData typedDataWithFloat64:[@"12345678" dataUsingEncoding:NSUTF8StringEncoding]]; - everything.nullableMapWithObject = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.list = @[ @"string", @1 ]; everything.boolList = @[ @YES, @NO ]; everything.intList = @[ @1, @2 ]; everything.doubleList = @[ @1.1, @2.2 ]; everything.stringList = @[ @"string", @"another one" ]; - everything.list = @[ @"string", @1 ]; + everything.listList = @[ @[ @"string" ], @[ @"another one" ] ]; everything.map = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.stringMap = @{@"hello" : @"you", @"goodbye" : @"world"}; + everything.intMap = @{@(1) : @(0), @(2) : @(-2)}; EchoBinaryMessenger *binaryMessenger = [[EchoBinaryMessenger alloc] initWithCodec:FLTGetCoreTestsCodec()]; FLTFlutterIntegrationCoreApi *api = @@ -84,14 +86,15 @@ - (void)testAllEquals { everything.aNullable8ByteArray.data); XCTAssertEqualObjects(result.aNullableFloatArray.data, everything.aNullableFloatArray.data); - XCTAssertEqualObjects(result.nullableMapWithObject, - everything.nullableMapWithObject); XCTAssertEqualObjects(result.list, everything.list); XCTAssertEqualObjects(result.boolList, everything.boolList); XCTAssertEqualObjects(result.intList, everything.intList); XCTAssertEqualObjects(result.doubleList, everything.doubleList); XCTAssertEqualObjects(result.stringList, everything.stringList); + XCTAssertEqualObjects(result.listList, everything.listList); XCTAssertEqualObjects(result.map, everything.map); + XCTAssertEqualObjects(result.stringMap, everything.stringMap); + XCTAssertEqualObjects(result.intMap, everything.intMap); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:1.0]; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m index ef45caaf12e..94fd5056277 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/AlternateLanguageTestPlugin.m @@ -95,9 +95,21 @@ - (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull) return list; } -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aMap; +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; } - (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper @@ -208,10 +220,21 @@ - (nullable id)echoNullableObject:(nullable id)aNullableObject return aNullableList; } -- (nullable NSDictionary *) - echoNullableMap:(nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableMap; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; } - (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed @@ -309,10 +332,22 @@ - (void)echoAsyncList:(NSArray *)list completion(list, nil); } -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(aMap, nil); +- (void)echoAsyncMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + completion(map, nil); +} + +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); } - (void)echoAsyncEnum:(FLTAnEnum)anEnum @@ -363,10 +398,22 @@ - (void)echoAsyncNullableList:(nullable NSArray *)list completion(list, nil); } -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - completion(aMap, nil); + completion(map, nil); +} + +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); } - (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed @@ -491,15 +538,34 @@ - (void)callFlutterEchoList:(NSArray *)list }]; } -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoEnum:anEnum @@ -594,15 +660,35 @@ - (void)callFlutterEchoNullableList:(nullable NSArray *)list }]; } -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { + [self.flutterAPI echoNullableMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)AnEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h index f3fa20aa6a4..c081e6524b5 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.h @@ -65,7 +65,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map; + listList:(NSArray *> *)listList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -83,7 +86,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy) NSArray *intList; @property(nonatomic, copy) NSArray *doubleList; @property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSArray *> *listList; @property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSDictionary *stringMap; +@property(nonatomic, copy) NSDictionary *intMap; @end /// A class containing all supported nullable types. @@ -96,10 +102,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -110,8 +112,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -120,10 +124,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -134,8 +134,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSArray *> *listList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -150,10 +152,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -163,7 +161,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -172,10 +173,6 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) FLTAnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) FLTAnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -185,7 +182,10 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *> *listList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; @end /// A class for testing nested class handling. @@ -266,9 +266,21 @@ NSObject *FLTGetCoreTestsCodec(void); /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map to test nested class serialization and deserialization. +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed class to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. - (nullable FLTAllClassesWrapper *)echoClassWrapper:(FLTAllClassesWrapper *)wrapper @@ -355,9 +367,16 @@ NSObject *FLTGetCoreTestsCodec(void); - (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; - (FLTAnEnumBox *_Nullable)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; - (FLTAnotherEnumBox *_Nullable)echoAnotherNullableEnum: @@ -395,9 +414,16 @@ NSObject *FLTGetCoreTestsCodec(void); - (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -449,9 +475,17 @@ NSObject *FLTGetCoreTestsCodec(void); - (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion: @@ -503,9 +537,15 @@ NSObject *FLTGetCoreTestsCodec(void); FlutterError *_Nullable))completion; - (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterEchoAnotherEnum:(FLTAnotherEnum)anotherEnum @@ -529,9 +569,15 @@ NSObject *FLTGetCoreTestsCodec(void); - (void)callFlutterEchoNullableList:(nullable NSArray *)list completion: (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion: (void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -613,9 +659,16 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix( - (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoEnum:(FLTAnEnum)anEnum completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -642,9 +695,17 @@ extern void SetUpFLTHostIntegrationCoreApiWithSuffix( - (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoNullableEnum:(nullable FLTAnEnumBox *)anEnumBoxed completion:(void (^)(FLTAnEnumBox *_Nullable, FlutterError *_Nullable))completion; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m index 3d4d841ef15..2a685862200 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/ios/Classes/CoreTests.gen.m @@ -108,7 +108,10 @@ + (instancetype)makeWithABool:(BOOL)aBool intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map { + listList:(NSArray *> *)listList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap { FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; @@ -127,7 +130,10 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (FLTAllTypes *)fromList:(NSArray *)list { @@ -151,7 +157,10 @@ + (FLTAllTypes *)fromList:(NSArray *)list { pigeonResult.intList = GetNullableObjectAtIndex(list, 14); pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.map = GetNullableObjectAtIndex(list, 17); + pigeonResult.listList = GetNullableObjectAtIndex(list, 17); + pigeonResult.map = GetNullableObjectAtIndex(list, 18); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 19); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 20); return pigeonResult; } + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @@ -176,7 +185,10 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -190,10 +202,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -204,8 +212,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap { FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; @@ -215,9 +225,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -228,8 +235,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; - pigeonResult.nestedClassList = nestedClassList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (FLTAllNullableTypes *)fromList:(NSArray *)list { @@ -242,21 +251,20 @@ + (FLTAllNullableTypes *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 15); - pigeonResult.list = GetNullableObjectAtIndex(list, 16); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 17); - pigeonResult.intList = GetNullableObjectAtIndex(list, 18); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 19); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 20); - pigeonResult.nestedClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 12); + pigeonResult.list = GetNullableObjectAtIndex(list, 13); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 14); + pigeonResult.intList = GetNullableObjectAtIndex(list, 15); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 16); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 17); + pigeonResult.listList = GetNullableObjectAtIndex(list, 18); + pigeonResult.map = GetNullableObjectAtIndex(list, 19); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 20); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 21); return pigeonResult; } + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @@ -272,9 +280,6 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -285,8 +290,10 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], - self.nestedClassList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -300,10 +307,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -313,7 +316,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap { FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; @@ -324,9 +330,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -336,7 +339,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { @@ -350,19 +356,19 @@ + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.list = GetNullableObjectAtIndex(list, 15); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 16); - pigeonResult.intList = GetNullableObjectAtIndex(list, 17); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 18); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.list = GetNullableObjectAtIndex(list, 12); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); + pigeonResult.intList = GetNullableObjectAtIndex(list, 14); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); + pigeonResult.listList = GetNullableObjectAtIndex(list, 17); + pigeonResult.map = GetNullableObjectAtIndex(list, 18); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 19); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 20); return pigeonResult; } + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { @@ -378,9 +384,6 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -390,7 +393,10 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -847,16 +853,67 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoMap:arg_map error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoStringMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoMap:arg_aMap error:&error]; + NSDictionary *output = [api echoStringMap:arg_stringMap + error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to @selector(echoIntMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoIntMap:arg_intMap error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed class to test nested class serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @@ -1374,9 +1431,61 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoNullableMap:arg_aNullableMap error:&error]; + NSDictionary *output = [api echoNullableMap:arg_map error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableStringMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableStringMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableStringMap:arg_stringMap + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableIntMap:error:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableIntMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableIntMap:arg_intMap + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1707,10 +1816,9 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1718,6 +1826,60 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] @@ -2132,9 +2294,9 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2143,6 +2305,62 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] @@ -2588,9 +2806,9 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2599,6 +2817,59 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @@ -2831,9 +3102,9 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2842,6 +3113,61 @@ void SetUpFLTHostIntegrationCoreApiWithSuffix(id binaryM [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableStringMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:FLTGetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableIntMap:completion:)], + @"FLTHostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString @@ -3338,9 +3664,8 @@ - (void)echoList:(NSArray *)arg_list } }]; } -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { +- (void)echoMap:(NSDictionary *)arg_map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", @@ -3349,7 +3674,35 @@ - (void)echoMap:(NSDictionary *)arg_aMap [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_map ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3357,7 +3710,36 @@ - (void)echoMap:(NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3585,9 +3967,9 @@ - (void)echoNullableList:(nullable NSArray *)arg_list } }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { +- (void)echoNullableMap:(nullable NSDictionary *)arg_map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @@ -3597,7 +3979,64 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:FLTGetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_map ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableStringMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:FLTGetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3605,7 +4044,7 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m index 25324dab809..48f3d76f75d 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/AlternateLanguageTestPlugin.m @@ -93,9 +93,21 @@ - (nullable id)echoObject:(id)anObject error:(FlutterError *_Nullable *_Nonnull) return list; } -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aMap; +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; } - (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper @@ -204,10 +216,21 @@ - (nullable id)echoNullableObject:(nullable id)aNullableObject return aNullableList; } -- (nullable NSDictionary *) - echoNullableMap:(nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error { - return aNullableMap; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error { + return map; +} + +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error { + return stringMap; +} + +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error { + return intMap; } - (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)AnEnumBoxed @@ -303,10 +326,22 @@ - (void)echoAsyncList:(NSArray *)list completion(list, nil); } -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - completion(aMap, nil); +- (void)echoAsyncMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + completion(map, nil); +} + +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); } - (void)echoAsyncEnum:(AnEnum)anEnum @@ -357,10 +392,22 @@ - (void)echoAsyncNullableList:(nullable NSArray *)list completion(list, nil); } -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - completion(aMap, nil); + completion(map, nil); +} + +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(stringMap, nil); +} + +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + completion(intMap, nil); } - (void)echoAsyncNullableEnum:(nullable AnEnumBox *)AnEnumBoxed @@ -482,15 +529,34 @@ - (void)callFlutterEchoList:(NSArray *)list }]; } -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { - [self.flutterAPI echoMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { + [self.flutterAPI echoMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI echoIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { [self.flutterAPI echoEnum:anEnum @@ -584,15 +650,35 @@ - (void)callFlutterEchoNullableList:(nullable NSArray *)list }]; } -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { - [self.flutterAPI echoNullableMap:aMap - completion:^(NSDictionary *value, FlutterError *error) { + [self.flutterAPI echoNullableMap:map + completion:^(NSDictionary *value, FlutterError *error) { completion(value, error); }]; } +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableStringMap:stringMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + [self.flutterAPI + echoNullableIntMap:intMap + completion:^(NSDictionary *value, FlutterError *error) { + completion(value, error); + }]; +} + - (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)AnEnumBoxed completion: (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion { diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h index 4a2239f9656..8aeabad0014 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.h @@ -65,7 +65,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map; + listList:(NSArray *> *)listList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -83,7 +86,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, copy) NSArray *intList; @property(nonatomic, copy) NSArray *doubleList; @property(nonatomic, copy) NSArray *boolList; +@property(nonatomic, copy) NSArray *> *listList; @property(nonatomic, copy) NSDictionary *map; +@property(nonatomic, copy) NSDictionary *stringMap; +@property(nonatomic, copy) NSDictionary *intMap; @end /// A class containing all supported nullable types. @@ -96,10 +102,6 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable AnEnumBox *)aNullableEnum anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -110,8 +112,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map; + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -120,10 +124,6 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) AnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -134,8 +134,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; -@property(nonatomic, copy, nullable) NSArray *nestedClassList; +@property(nonatomic, copy, nullable) NSArray *> *listList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; @end /// The primary purpose for this class is to ensure coverage of Swift structs @@ -150,10 +152,6 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable AnEnumBox *)aNullableEnum anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -163,7 +161,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map; + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -172,10 +173,6 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable4ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullable8ByteArray; @property(nonatomic, strong, nullable) FlutterStandardTypedData *aNullableFloatArray; -@property(nonatomic, copy, nullable) NSArray *> *nullableNestedList; -@property(nonatomic, copy, nullable) - NSDictionary *nullableMapWithAnnotations; -@property(nonatomic, copy, nullable) NSDictionary *nullableMapWithObject; @property(nonatomic, strong, nullable) AnEnumBox *aNullableEnum; @property(nonatomic, strong, nullable) AnotherEnumBox *anotherNullableEnum; @property(nonatomic, copy, nullable) NSString *aNullableString; @@ -185,7 +182,10 @@ typedef NS_ENUM(NSUInteger, AnotherEnum) { @property(nonatomic, copy, nullable) NSArray *intList; @property(nonatomic, copy, nullable) NSArray *doubleList; @property(nonatomic, copy, nullable) NSArray *boolList; +@property(nonatomic, copy, nullable) NSArray *> *listList; @property(nonatomic, copy, nullable) NSDictionary *map; +@property(nonatomic, copy, nullable) NSDictionary *stringMap; +@property(nonatomic, copy, nullable) NSDictionary *intMap; @end /// A class for testing nested class handling. @@ -266,9 +266,21 @@ NSObject *GetCoreTestsCodec(void); /// Returns the passed map, to test serialization and deserialization. /// /// @return `nil` only when `error != nil`. -- (nullable NSDictionary *)echoMap:(NSDictionary *)aMap - error:(FlutterError *_Nullable *_Nonnull)error; -/// Returns the passed map to test nested class serialization and deserialization. +- (nullable NSDictionary *)echoMap:(NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoStringMap:(NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +/// +/// @return `nil` only when `error != nil`. +- (nullable NSDictionary *) + echoIntMap:(NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed class to test nested class serialization and deserialization. /// /// @return `nil` only when `error != nil`. - (nullable AllClassesWrapper *)echoClassWrapper:(AllClassesWrapper *)wrapper @@ -354,9 +366,16 @@ NSObject *GetCoreTestsCodec(void); - (nullable NSArray *)echoNullableList:(nullable NSArray *)aNullableList error:(FlutterError *_Nullable *_Nonnull)error; /// Returns the passed map, to test serialization and deserialization. -- (nullable NSDictionary *)echoNullableMap: - (nullable NSDictionary *)aNullableMap - error:(FlutterError *_Nullable *_Nonnull)error; +- (nullable NSDictionary *)echoNullableMap:(nullable NSDictionary *)map + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableStringMap:(nullable NSDictionary *)stringMap + error:(FlutterError *_Nullable *_Nonnull)error; +/// Returns the passed map, to test serialization and deserialization. +- (nullable NSDictionary *) + echoNullableIntMap:(nullable NSDictionary *)intMap + error:(FlutterError *_Nullable *_Nonnull)error; - (AnEnumBox *_Nullable)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed error:(FlutterError *_Nullable *_Nonnull)error; - (AnotherEnumBox *_Nullable)echoAnotherNullableEnum:(nullable AnotherEnumBox *)anotherEnumBoxed @@ -393,9 +412,16 @@ NSObject *GetCoreTestsCodec(void); - (void)echoAsyncList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoAsyncMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -447,9 +473,17 @@ NSObject *GetCoreTestsCodec(void); - (void)echoAsyncNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test asynchronous serialization and deserialization. -- (void)echoAsyncNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)echoAsyncNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test asynchronous serialization and deserialization. +- (void)echoAsyncNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum, to test asynchronous serialization and deserialization. - (void)echoAsyncNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -499,9 +533,15 @@ NSObject *GetCoreTestsCodec(void); FlutterError *_Nullable))completion; - (void)callFlutterEchoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoMap:(NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)callFlutterEchoMap:(NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; - (void)callFlutterEchoAnotherEnum:(AnotherEnum)anotherEnum @@ -525,9 +565,15 @@ NSObject *GetCoreTestsCodec(void); - (void)callFlutterEchoNullableList:(nullable NSArray *)list completion: (void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; -- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, +- (void)callFlutterEchoNullableMap:(nullable NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +- (void)callFlutterEchoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; - (void)callFlutterEchoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion: (void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -608,9 +654,16 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin - (void)echoList:(NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoMap:(NSDictionary *)aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +- (void)echoMap:(NSDictionary *)map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoStringMap:(NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoIntMap:(NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoEnum:(AnEnum)anEnum completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; @@ -637,9 +690,17 @@ extern void SetUpHostIntegrationCoreApiWithSuffix(id bin - (void)echoNullableList:(nullable NSArray *)list completion:(void (^)(NSArray *_Nullable, FlutterError *_Nullable))completion; /// Returns the passed map, to test serialization and deserialization. -- (void)echoNullableMap:(nullable NSDictionary *)aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion; +- (void)echoNullableMap:(nullable NSDictionary *)map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableStringMap:(nullable NSDictionary *)stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; +/// Returns the passed map, to test serialization and deserialization. +- (void)echoNullableIntMap:(nullable NSDictionary *)intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion; /// Returns the passed enum to test serialization and deserialization. - (void)echoNullableEnum:(nullable AnEnumBox *)anEnumBoxed completion:(void (^)(AnEnumBox *_Nullable, FlutterError *_Nullable))completion; diff --git a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m index 78b333c21a9..747705da6e5 100644 --- a/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m +++ b/packages/pigeon/platform_tests/alternate_language_test_plugin/macos/Classes/CoreTests.gen.m @@ -108,7 +108,10 @@ + (instancetype)makeWithABool:(BOOL)aBool intList:(NSArray *)intList doubleList:(NSArray *)doubleList boolList:(NSArray *)boolList - map:(NSDictionary *)map { + listList:(NSArray *> *)listList + map:(NSDictionary *)map + stringMap:(NSDictionary *)stringMap + intMap:(NSDictionary *)intMap { AllTypes *pigeonResult = [[AllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; @@ -127,7 +130,10 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (AllTypes *)fromList:(NSArray *)list { @@ -151,7 +157,10 @@ + (AllTypes *)fromList:(NSArray *)list { pigeonResult.intList = GetNullableObjectAtIndex(list, 14); pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); - pigeonResult.map = GetNullableObjectAtIndex(list, 17); + pigeonResult.listList = GetNullableObjectAtIndex(list, 17); + pigeonResult.map = GetNullableObjectAtIndex(list, 18); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 19); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 20); return pigeonResult; } + (nullable AllTypes *)nullableFromList:(NSArray *)list { @@ -176,7 +185,10 @@ + (nullable AllTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -190,10 +202,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable AnEnumBox *)aNullableEnum anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -204,8 +212,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - nestedClassList:(nullable NSArray *)nestedClassList - map:(nullable NSDictionary *)map { + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap { AllNullableTypes *pigeonResult = [[AllNullableTypes alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; @@ -215,9 +225,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -228,8 +235,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; - pigeonResult.nestedClassList = nestedClassList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (AllNullableTypes *)fromList:(NSArray *)list { @@ -242,21 +251,20 @@ + (AllNullableTypes *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 15); - pigeonResult.list = GetNullableObjectAtIndex(list, 16); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 17); - pigeonResult.intList = GetNullableObjectAtIndex(list, 18); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 19); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 20); - pigeonResult.nestedClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.allNullableTypes = GetNullableObjectAtIndex(list, 12); + pigeonResult.list = GetNullableObjectAtIndex(list, 13); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 14); + pigeonResult.intList = GetNullableObjectAtIndex(list, 15); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 16); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 17); + pigeonResult.listList = GetNullableObjectAtIndex(list, 18); + pigeonResult.map = GetNullableObjectAtIndex(list, 19); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 20); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 21); return pigeonResult; } + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { @@ -272,9 +280,6 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -285,8 +290,10 @@ + (nullable AllNullableTypes *)nullableFromList:(NSArray *)list { self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], - self.nestedClassList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -300,10 +307,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - nullableNestedList:(nullable NSArray *> *)nullableNestedList - nullableMapWithAnnotations: - (nullable NSDictionary *)nullableMapWithAnnotations - nullableMapWithObject:(nullable NSDictionary *)nullableMapWithObject aNullableEnum:(nullable AnEnumBox *)aNullableEnum anotherNullableEnum:(nullable AnotherEnumBox *)anotherNullableEnum aNullableString:(nullable NSString *)aNullableString @@ -313,7 +316,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool intList:(nullable NSArray *)intList doubleList:(nullable NSArray *)doubleList boolList:(nullable NSArray *)boolList - map:(nullable NSDictionary *)map { + listList:(nullable NSArray *> *)listList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap { AllNullableTypesWithoutRecursion *pigeonResult = [[AllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; pigeonResult.aNullableInt = aNullableInt; @@ -323,9 +329,6 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.aNullable4ByteArray = aNullable4ByteArray; pigeonResult.aNullable8ByteArray = aNullable8ByteArray; pigeonResult.aNullableFloatArray = aNullableFloatArray; - pigeonResult.nullableNestedList = nullableNestedList; - pigeonResult.nullableMapWithAnnotations = nullableMapWithAnnotations; - pigeonResult.nullableMapWithObject = nullableMapWithObject; pigeonResult.aNullableEnum = aNullableEnum; pigeonResult.anotherNullableEnum = anotherNullableEnum; pigeonResult.aNullableString = aNullableString; @@ -335,7 +338,10 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.intList = intList; pigeonResult.doubleList = doubleList; pigeonResult.boolList = boolList; + pigeonResult.listList = listList; pigeonResult.map = map; + pigeonResult.stringMap = stringMap; + pigeonResult.intMap = intMap; return pigeonResult; } + (AllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { @@ -348,19 +354,19 @@ + (AllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.aNullable4ByteArray = GetNullableObjectAtIndex(list, 5); pigeonResult.aNullable8ByteArray = GetNullableObjectAtIndex(list, 6); pigeonResult.aNullableFloatArray = GetNullableObjectAtIndex(list, 7); - pigeonResult.nullableNestedList = GetNullableObjectAtIndex(list, 8); - pigeonResult.nullableMapWithAnnotations = GetNullableObjectAtIndex(list, 9); - pigeonResult.nullableMapWithObject = GetNullableObjectAtIndex(list, 10); - pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 11); - pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 12); - pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 13); - pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 14); - pigeonResult.list = GetNullableObjectAtIndex(list, 15); - pigeonResult.stringList = GetNullableObjectAtIndex(list, 16); - pigeonResult.intList = GetNullableObjectAtIndex(list, 17); - pigeonResult.doubleList = GetNullableObjectAtIndex(list, 18); - pigeonResult.boolList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); + pigeonResult.aNullableEnum = GetNullableObjectAtIndex(list, 8); + pigeonResult.anotherNullableEnum = GetNullableObjectAtIndex(list, 9); + pigeonResult.aNullableString = GetNullableObjectAtIndex(list, 10); + pigeonResult.aNullableObject = GetNullableObjectAtIndex(list, 11); + pigeonResult.list = GetNullableObjectAtIndex(list, 12); + pigeonResult.stringList = GetNullableObjectAtIndex(list, 13); + pigeonResult.intList = GetNullableObjectAtIndex(list, 14); + pigeonResult.doubleList = GetNullableObjectAtIndex(list, 15); + pigeonResult.boolList = GetNullableObjectAtIndex(list, 16); + pigeonResult.listList = GetNullableObjectAtIndex(list, 17); + pigeonResult.map = GetNullableObjectAtIndex(list, 18); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 19); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 20); return pigeonResult; } + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { @@ -376,9 +382,6 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l self.aNullable4ByteArray ?: [NSNull null], self.aNullable8ByteArray ?: [NSNull null], self.aNullableFloatArray ?: [NSNull null], - self.nullableNestedList ?: [NSNull null], - self.nullableMapWithAnnotations ?: [NSNull null], - self.nullableMapWithObject ?: [NSNull null], self.aNullableEnum ?: [NSNull null], self.anotherNullableEnum ?: [NSNull null], self.aNullableString ?: [NSNull null], @@ -388,7 +391,10 @@ + (nullable AllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)l self.intList ?: [NSNull null], self.doubleList ?: [NSNull null], self.boolList ?: [NSNull null], + self.listList ?: [NSNull null], self.map ?: [NSNull null], + self.stringMap ?: [NSNull null], + self.intMap ?: [NSNull null], ]; } @end @@ -842,16 +848,66 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoMap:arg_aMap error:&error]; + NSDictionary *output = [api echoMap:arg_map error:&error]; callback(wrapResult(output, error)); }]; } else { [channel setMessageHandler:nil]; } } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert( + [api respondsToSelector:@selector(echoStringMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoStringMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoStringMap:arg_stringMap + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoIntMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to @selector(echoIntMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoIntMap:arg_intMap error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed class to test nested class serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @@ -1369,9 +1425,61 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aNullableMap = GetNullableObjectAtIndex(args, 0); + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableMap:arg_map error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableStringMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableStringMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); FlutterError *error; - NSDictionary *output = [api echoNullableMap:arg_aNullableMap error:&error]; + NSDictionary *output = [api echoNullableStringMap:arg_stringMap + error:&error]; + callback(wrapResult(output, error)); + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoNullableIntMap:error:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoNullableIntMap:error:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + FlutterError *error; + NSDictionary *output = [api echoNullableIntMap:arg_intMap + error:&error]; callback(wrapResult(output, error)); }]; } else { @@ -1702,10 +1810,9 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncMap:arg_aMap - completion:^(NSDictionary *_Nullable output, - FlutterError *_Nullable error) { + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; }]; @@ -1713,6 +1820,60 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncStringMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncIntMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] @@ -2127,9 +2288,9 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api echoAsyncNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2138,6 +2299,62 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableStringMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.echoAsyncNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(echoAsyncNullableIntMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(echoAsyncNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api echoAsyncNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } /// Returns the passed enum, to test asynchronous serialization and deserialization. { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] @@ -2581,9 +2798,9 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2592,6 +2809,59 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString + stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoStringMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoStringMap:arg_stringMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoIntMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString stringWithFormat:@"%@%@", @@ -2824,9 +3094,9 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess api); [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { NSArray *args = message; - NSDictionary *arg_aMap = GetNullableObjectAtIndex(args, 0); - [api callFlutterEchoNullableMap:arg_aMap - completion:^(NSDictionary *_Nullable output, + NSDictionary *arg_map = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableMap:arg_map + completion:^(NSDictionary *_Nullable output, FlutterError *_Nullable error) { callback(wrapResult(output, error)); }]; @@ -2835,6 +3105,61 @@ void SetUpHostIntegrationCoreApiWithSuffix(id binaryMess [channel setMessageHandler:nil]; } } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName:[NSString stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableStringMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableStringMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableStringMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_stringMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableStringMap:arg_stringMap + completion:^( + NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } + { + FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] + initWithName: + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"HostIntegrationCoreApi.callFlutterEchoNullableIntMap", + messageChannelSuffix] + binaryMessenger:binaryMessenger + codec:GetCoreTestsCodec()]; + if (api) { + NSCAssert([api respondsToSelector:@selector(callFlutterEchoNullableIntMap:completion:)], + @"HostIntegrationCoreApi api (%@) doesn't respond to " + @"@selector(callFlutterEchoNullableIntMap:completion:)", + api); + [channel setMessageHandler:^(id _Nullable message, FlutterReply callback) { + NSArray *args = message; + NSDictionary *arg_intMap = GetNullableObjectAtIndex(args, 0); + [api callFlutterEchoNullableIntMap:arg_intMap + completion:^(NSDictionary *_Nullable output, + FlutterError *_Nullable error) { + callback(wrapResult(output, error)); + }]; + }]; + } else { + [channel setMessageHandler:nil]; + } + } { FlutterBasicMessageChannel *channel = [[FlutterBasicMessageChannel alloc] initWithName:[NSString @@ -3330,9 +3655,8 @@ - (void)echoList:(NSArray *)arg_list } }]; } -- (void)echoMap:(NSDictionary *)arg_aMap - completion: - (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { +- (void)echoMap:(NSDictionary *)arg_map + completion:(void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap", @@ -3341,7 +3665,35 @@ - (void)echoMap:(NSDictionary *)arg_aMap [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_map ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoStringMap:(NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3349,7 +3701,36 @@ - (void)echoMap:(NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoIntMap:(NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = [NSString + stringWithFormat: + @"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } @@ -3576,9 +3957,9 @@ - (void)echoNullableList:(nullable NSArray *)arg_list } }]; } -- (void)echoNullableMap:(nullable NSDictionary *)arg_aMap - completion:(void (^)(NSDictionary *_Nullable, - FlutterError *_Nullable))completion { +- (void)echoNullableMap:(nullable NSDictionary *)arg_map + completion: + (void (^)(NSDictionary *_Nullable, FlutterError *_Nullable))completion { NSString *channelName = [NSString stringWithFormat: @"%@%@", @@ -3588,7 +3969,64 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap [FlutterBasicMessageChannel messageChannelWithName:channelName binaryMessenger:self.binaryMessenger codec:GetCoreTestsCodec()]; - [channel sendMessage:@[ arg_aMap ?: [NSNull null] ] + [channel sendMessage:@[ arg_map ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableStringMap:(nullable NSDictionary *)arg_stringMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableStringMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_stringMap ?: [NSNull null] ] + reply:^(NSArray *reply) { + if (reply != nil) { + if (reply.count > 1) { + completion(nil, [FlutterError errorWithCode:reply[0] + message:reply[1] + details:reply[2]]); + } else { + NSDictionary *output = + reply[0] == [NSNull null] ? nil : reply[0]; + completion(output, nil); + } + } else { + completion(nil, createConnectionError(channelName)); + } + }]; +} +- (void)echoNullableIntMap:(nullable NSDictionary *)arg_intMap + completion:(void (^)(NSDictionary *_Nullable, + FlutterError *_Nullable))completion { + NSString *channelName = + [NSString stringWithFormat:@"%@%@", + @"dev.flutter.pigeon.pigeon_integration_tests." + @"FlutterIntegrationCoreApi.echoNullableIntMap", + _messageChannelSuffix]; + FlutterBasicMessageChannel *channel = + [FlutterBasicMessageChannel messageChannelWithName:channelName + binaryMessenger:self.binaryMessenger + codec:GetCoreTestsCodec()]; + [channel sendMessage:@[ arg_intMap ?: [NSNull null] ] reply:^(NSArray *reply) { if (reply != nil) { if (reply.count > 1) { @@ -3596,7 +4034,7 @@ - (void)echoNullableMap:(nullable NSDictionary *)arg_aMap message:reply[1] details:reply[2]]); } else { - NSDictionary *output = + NSDictionary *output = reply[0] == [NSNull null] ? nil : reply[0]; completion(output, nil); } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml b/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml new file mode 100644 index 00000000000..91ec220b8e2 --- /dev/null +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/dart_test.yaml @@ -0,0 +1 @@ +test_on: vm diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart index 40221efda70..1414638023b 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/integration_tests.dart @@ -35,333 +35,348 @@ enum TargetGenerator { swift, } -void _compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { - expect(allTypesOne == null, allTypesTwo == null); - if (allTypesOne == null || allTypesTwo == null) { - return; - } - expect(allTypesOne.aBool, allTypesTwo.aBool); - expect(allTypesOne.anInt, allTypesTwo.anInt); - expect(allTypesOne.anInt64, allTypesTwo.anInt64); - expect(allTypesOne.aDouble, allTypesTwo.aDouble); - expect(allTypesOne.aString, allTypesTwo.aString); - expect(allTypesOne.aByteArray, allTypesTwo.aByteArray); - expect(allTypesOne.a4ByteArray, allTypesTwo.a4ByteArray); - expect(allTypesOne.a8ByteArray, allTypesTwo.a8ByteArray); - expect(allTypesOne.aFloatArray, allTypesTwo.aFloatArray); - expect(allTypesOne.anEnum, allTypesTwo.anEnum); - expect(allTypesOne.anObject, allTypesTwo.anObject); - expect(listEquals(allTypesOne.list, allTypesTwo.list), true); - expect(listEquals(allTypesOne.stringList, allTypesTwo.stringList), true); - expect(listEquals(allTypesOne.boolList, allTypesTwo.boolList), true); - expect(listEquals(allTypesOne.doubleList, allTypesTwo.doubleList), true); - expect(listEquals(allTypesOne.intList, allTypesTwo.intList), true); - expect(mapEquals(allTypesOne.map, allTypesTwo.map), true); -} +/// Sets up and runs the integration tests. +void runPigeonIntegrationTests(TargetGenerator targetGenerator) { + IntegrationTestWidgetsFlutterBinding.ensureInitialized(); -void _compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, - AllNullableTypes? allNullableTypesTwo) { - expect(allNullableTypesOne == null, allNullableTypesTwo == null); - if (allNullableTypesOne == null || allNullableTypesTwo == null) { - return; + void compareAllNullableTypesWithoutRecursion( + AllNullableTypesWithoutRecursion? allNullableTypesOne, + AllNullableTypesWithoutRecursion? allNullableTypesTwo) { + expect(allNullableTypesOne == null, allNullableTypesTwo == null); + if (allNullableTypesOne == null || allNullableTypesTwo == null) { + return; + } + expect( + allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); + expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); + expect( + allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); + expect(allNullableTypesOne.aNullableDouble, + allNullableTypesTwo.aNullableDouble); + expect(allNullableTypesOne.aNullableString, + allNullableTypesTwo.aNullableString); + expect(allNullableTypesOne.aNullableByteArray, + allNullableTypesTwo.aNullableByteArray); + expect(allNullableTypesOne.aNullable4ByteArray, + allNullableTypesTwo.aNullable4ByteArray); + expect(allNullableTypesOne.aNullable8ByteArray, + allNullableTypesTwo.aNullable8ByteArray); + expect(allNullableTypesOne.aNullableFloatArray, + allNullableTypesTwo.aNullableFloatArray); + expect(allNullableTypesOne.aNullableObject, + allNullableTypesTwo.aNullableObject); + expect( + allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); + expect( + listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); + expect( + listEquals( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList), + true); + expect( + listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), + true); + expect( + listEquals( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), + true); + expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), + true); + // TODO(stuartmorgan): Enable this once the Dart types are fixed; see + // https://github.com/flutter/flutter/issues/116117 + //for (int i = 0; i < allNullableTypesOne.listList!.length; i++) { + // expect(listEquals(allNullableTypesOne.listList![i], allNullableTypesTwo.listList![i]), + // true); + //} + // expect(listEquals(allNullableTypesOne.mapList, allNullableTypesTwo.mapList), + // true); + expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); + expect( + mapEquals(allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap), + true); + expect(mapEquals(allNullableTypesOne.intMap, allNullableTypesTwo.intMap), + true); } - expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); - expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); - expect( - allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); - expect( - allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); - expect( - allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); - expect(allNullableTypesOne.aNullableByteArray, - allNullableTypesTwo.aNullableByteArray); - expect(allNullableTypesOne.aNullable4ByteArray, - allNullableTypesTwo.aNullable4ByteArray); - expect(allNullableTypesOne.aNullable8ByteArray, - allNullableTypesTwo.aNullable8ByteArray); - expect(allNullableTypesOne.aNullableFloatArray, - allNullableTypesTwo.aNullableFloatArray); - expect(allNullableTypesOne.nullableNestedList?.length, - allNullableTypesTwo.nullableNestedList?.length); - // TODO(stuartmorgan): Enable this once the Dart types are fixed; see - // https://github.com/flutter/flutter/issues/116117 - //for (int i = 0; i < allNullableTypesOne.nullableNestedList!.length; i++) { - // expect(listEquals(allNullableTypesOne.nullableNestedList![i], allNullableTypesTwo.nullableNestedList![i]), - // true); - //} - expect( - mapEquals(allNullableTypesOne.nullableMapWithAnnotations, - allNullableTypesTwo.nullableMapWithAnnotations), - true); - expect( - mapEquals(allNullableTypesOne.nullableMapWithObject, - allNullableTypesTwo.nullableMapWithObject), - true); - expect( - allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); - expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); - _compareAllNullableTypes(allNullableTypesOne.allNullableTypes, - allNullableTypesTwo.allNullableTypes); - expect(listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); - expect( - listEquals( - allNullableTypesOne.stringList, allNullableTypesTwo.stringList), - true); - expect(listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), - true); - expect( - listEquals( - allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), - true); - expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), - true); - expect(allNullableTypesOne.nestedClassList?.length, - allNullableTypesTwo.nestedClassList?.length); - for (int i = 0; i < (allNullableTypesOne.nestedClassList?.length ?? 0); i++) { - _compareAllNullableTypes(allNullableTypesOne.nestedClassList?[i], - allNullableTypesTwo.nestedClassList?[i]); + + void compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { + expect(allTypesOne == null, allTypesTwo == null); + if (allTypesOne == null || allTypesTwo == null) { + return; + } + expect(allTypesOne.aBool, allTypesTwo.aBool); + expect(allTypesOne.anInt, allTypesTwo.anInt); + expect(allTypesOne.anInt64, allTypesTwo.anInt64); + expect(allTypesOne.aDouble, allTypesTwo.aDouble); + expect(allTypesOne.aString, allTypesTwo.aString); + expect(allTypesOne.aByteArray, allTypesTwo.aByteArray); + expect(allTypesOne.a4ByteArray, allTypesTwo.a4ByteArray); + expect(allTypesOne.a8ByteArray, allTypesTwo.a8ByteArray); + expect(allTypesOne.aFloatArray, allTypesTwo.aFloatArray); + expect(allTypesOne.anEnum, allTypesTwo.anEnum); + expect(allTypesOne.anObject, allTypesTwo.anObject); + expect(listEquals(allTypesOne.list, allTypesTwo.list), true); + expect(listEquals(allTypesOne.stringList, allTypesTwo.stringList), true); + expect(listEquals(allTypesOne.intList, allTypesTwo.intList), true); + expect(listEquals(allTypesOne.doubleList, allTypesTwo.doubleList), true); + expect(listEquals(allTypesOne.boolList, allTypesTwo.boolList), true); + // TODO(stuartmorgan): Enable this once the Dart types are fixed; see + // https://github.com/flutter/flutter/issues/116117 + //for (int i = 0; i < allTypesOne.listList!.length; i++) { + // expect(listEquals(allTypesOne.listList![i], allTypesTwo.listList![i]), + // true); + //} + expect(mapEquals(allTypesOne.map, allTypesTwo.map), true); + expect(mapEquals(allTypesOne.stringMap, allTypesTwo.stringMap), true); + expect(mapEquals(allTypesOne.intMap, allTypesTwo.intMap), true); } - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); -} -void __compareAllNullableTypesWithoutRecursion( - AllNullableTypesWithoutRecursion? allNullableTypesOne, - AllNullableTypesWithoutRecursion? allNullableTypesTwo) { - expect(allNullableTypesOne == null, allNullableTypesTwo == null); - if (allNullableTypesOne == null || allNullableTypesTwo == null) { - return; + void compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, + AllNullableTypes? allNullableTypesTwo) { + expect(allNullableTypesOne == null, allNullableTypesTwo == null); + if (allNullableTypesOne == null || allNullableTypesTwo == null) { + return; + } + expect( + allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); + expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); + expect( + allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); + expect(allNullableTypesOne.aNullableDouble, + allNullableTypesTwo.aNullableDouble); + expect(allNullableTypesOne.aNullableString, + allNullableTypesTwo.aNullableString); + expect(allNullableTypesOne.aNullableByteArray, + allNullableTypesTwo.aNullableByteArray); + expect(allNullableTypesOne.aNullable4ByteArray, + allNullableTypesTwo.aNullable4ByteArray); + expect(allNullableTypesOne.aNullable8ByteArray, + allNullableTypesTwo.aNullable8ByteArray); + expect(allNullableTypesOne.aNullableFloatArray, + allNullableTypesTwo.aNullableFloatArray); + expect(allNullableTypesOne.aNullableObject, + allNullableTypesTwo.aNullableObject); + expect( + allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); + compareAllNullableTypes(allNullableTypesOne.allNullableTypes, + allNullableTypesTwo.allNullableTypes); + expect( + listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); + expect( + listEquals( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList), + true); + expect( + listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), + true); + expect( + listEquals( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), + true); + expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), + true); + // TODO(stuartmorgan): Enable this once the Dart types are fixed; see + // https://github.com/flutter/flutter/issues/116117 + //for (int i = 0; i < allNullableTypesOne.listList!.length; i++) { + // expect(listEquals(allNullableTypesOne.listList![i], allNullableTypesTwo.listList![i]), + // true); + //} + expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); + expect( + mapEquals(allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap), + true); + expect(mapEquals(allNullableTypesOne.intMap, allNullableTypesTwo.intMap), + true); } - expect(allNullableTypesOne.aNullableBool, allNullableTypesTwo.aNullableBool); - expect(allNullableTypesOne.aNullableInt, allNullableTypesTwo.aNullableInt); - expect( - allNullableTypesOne.aNullableInt64, allNullableTypesTwo.aNullableInt64); - expect( - allNullableTypesOne.aNullableDouble, allNullableTypesTwo.aNullableDouble); - expect( - allNullableTypesOne.aNullableString, allNullableTypesTwo.aNullableString); - expect(allNullableTypesOne.aNullableByteArray, - allNullableTypesTwo.aNullableByteArray); - expect(allNullableTypesOne.aNullable4ByteArray, - allNullableTypesTwo.aNullable4ByteArray); - expect(allNullableTypesOne.aNullable8ByteArray, - allNullableTypesTwo.aNullable8ByteArray); - expect(allNullableTypesOne.aNullableFloatArray, - allNullableTypesTwo.aNullableFloatArray); - expect(allNullableTypesOne.nullableNestedList?.length, - allNullableTypesTwo.nullableNestedList?.length); - // TODO(stuartmorgan): Enable this once the Dart types are fixed; see - // https://github.com/flutter/flutter/issues/116117 - //for (int i = 0; i < allNullableTypesOne.nullableNestedList!.length; i++) { - // expect(listEquals(allNullableTypesOne.nullableNestedList![i], allNullableTypesTwo.nullableNestedList![i]), - // true); - //} - expect( - mapEquals(allNullableTypesOne.nullableMapWithAnnotations, - allNullableTypesTwo.nullableMapWithAnnotations), - true); - expect( - mapEquals(allNullableTypesOne.nullableMapWithObject, - allNullableTypesTwo.nullableMapWithObject), - true); - expect( - allNullableTypesOne.aNullableObject, allNullableTypesTwo.aNullableObject); - expect(allNullableTypesOne.aNullableEnum, allNullableTypesTwo.aNullableEnum); - expect(listEquals(allNullableTypesOne.list, allNullableTypesTwo.list), true); - expect( - listEquals( - allNullableTypesOne.stringList, allNullableTypesTwo.stringList), - true); - expect(listEquals(allNullableTypesOne.boolList, allNullableTypesTwo.boolList), - true); - expect( - listEquals( - allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList), - true); - expect(listEquals(allNullableTypesOne.intList, allNullableTypesTwo.intList), - true); - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); -} -void _compareAllClassesWrapper( - AllClassesWrapper? wrapperOne, AllClassesWrapper? wrapperTwo) { - expect(wrapperOne == null, wrapperTwo == null); - if (wrapperOne == null || wrapperTwo == null) { - return; + void compareAllClassesWrapper( + AllClassesWrapper? wrapperOne, AllClassesWrapper? wrapperTwo) { + expect(wrapperOne == null, wrapperTwo == null); + if (wrapperOne == null || wrapperTwo == null) { + return; + } + + compareAllNullableTypes( + wrapperOne.allNullableTypes, wrapperTwo.allNullableTypes); + compareAllNullableTypesWithoutRecursion( + wrapperOne.allNullableTypesWithoutRecursion, + wrapperTwo.allNullableTypesWithoutRecursion, + ); + compareAllTypes(wrapperOne.allTypes, wrapperTwo.allTypes); } - _compareAllNullableTypes( - wrapperOne.allNullableTypes, wrapperTwo.allNullableTypes); - __compareAllNullableTypesWithoutRecursion( - wrapperOne.allNullableTypesWithoutRecursion, - wrapperTwo.allNullableTypesWithoutRecursion, + final List list = [ + 'Thing 1', + 2, + true, + 3.14, + null, + ]; + + final List stringList = [ + 'Thing 1', + '2', + 'true', + '3.14', + null, + ]; + + final List intList = [ + 1, + 2, + 3, + 4, + null, + ]; + + final List doubleList = [ + 1, + 2.99999, + 3, + 3.14, + null, + ]; + + final List boolList = [ + true, + false, + true, + false, + null, + ]; + + final List enumList = [ + AnEnum.one, + AnEnum.two, + AnEnum.three, + AnEnum.fortyTwo, + AnEnum.fourHundredTwentyTwo, + null + ]; + + final List?> listList = ?>[ + list, + stringList, + intList, + doubleList, + boolList, + enumList, + null + ]; + + final Map map = { + 'a': 1, + 'b': 2.0, + 'c': 'three', + 'd': false, + 'e': null + }; + + final Map stringMap = { + 'a': '1', + 'b': '2.0', + 'c': 'three', + 'd': 'false', + 'e': 'null', + 'f': null + }; + + final Map intMap = { + 0: 0, + 1: 1, + 2: 3, + 4: -1, + 5: null, + }; + + final AllNullableTypesWithoutRecursion + genericAllNullableTypesWithoutRecursion = + AllNullableTypesWithoutRecursion( + aNullableBool: true, + aNullableInt: _regularInt, + aNullableInt64: _biggerThanBigInt, + aNullableDouble: _doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + map: map, + stringMap: stringMap, + intMap: intMap, ); - _compareAllTypes(wrapperOne.allTypes, wrapperTwo.allTypes); -} -final Map _map = { - 'a': 1, - 'b': 2.0, - 'c': 'three', - 'd': false, - 'e': null -}; - -final List _list = [ - 'Thing 1', - 2, - true, - 3.14, - null, -]; - -final List _stringList = [ - 'Thing 1', - '2', - 'true', - '3.14', - null, -]; - -final List _intList = [ - 1, - 2, - 3, - 4, - null, -]; - -final List _doubleList = [ - 1, - 2.99999, - 3, - 3.14, - null, -]; - -final List _boolList = [ - true, - false, - true, - false, - null, -]; - -final AllTypes _genericAllTypes = AllTypes( - aBool: true, - anInt: _regularInt, - anInt64: _biggerThanBigInt, - aDouble: _doublePi, - aString: 'Hello host!', - aByteArray: Uint8List.fromList([1, 2, 3]), - a4ByteArray: Int32List.fromList([4, 5, 6]), - a8ByteArray: Int64List.fromList([7, 8, 9]), - aFloatArray: Float64List.fromList([2.71828, _doublePi]), - anEnum: AnEnum.fortyTwo, - // ignore: avoid_redundant_argument_values - anotherEnum: AnotherEnum.justInCase, - anObject: 1, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); - -final AllNullableTypes _genericAllNullableTypes = AllNullableTypes( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); - -final List _allNullableTypesList = [ - _genericAllNullableTypes, - AllNullableTypes(), - null, -]; - -final AllNullableTypes _recursiveAllNullableTypes = AllNullableTypes( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - allNullableTypes: _genericAllNullableTypes, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - nestedClassList: _allNullableTypesList, - map: _map, -); - -final AllNullableTypesWithoutRecursion - __genericAllNullableTypesWithoutRecursion = - AllNullableTypesWithoutRecursion( - aNullableBool: true, - aNullableInt: _regularInt, - aNullableInt64: _biggerThanBigInt, - aNullableDouble: _doublePi, - aNullableString: 'Hello host!', - aNullableByteArray: Uint8List.fromList([1, 2, 3]), - aNullable4ByteArray: Int32List.fromList([4, 5, 6]), - aNullable8ByteArray: Int64List.fromList([7, 8, 9]), - aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), - nullableNestedList: >[ - [true, false], - [false, true] - ], - nullableMapWithAnnotations: {}, - nullableMapWithObject: {}, - aNullableEnum: AnEnum.fourHundredTwentyTwo, - anotherNullableEnum: AnotherEnum.justInCase, - aNullableObject: 0, - list: _list, - stringList: _stringList, - intList: _intList, - doubleList: _doubleList, - boolList: _boolList, - map: _map, -); + final AllTypes genericAllTypes = AllTypes( + aBool: true, + anInt: _regularInt, + anInt64: _biggerThanBigInt, + aDouble: _doublePi, + aString: 'Hello host!', + aByteArray: Uint8List.fromList([1, 2, 3]), + a4ByteArray: Int32List.fromList([4, 5, 6]), + a8ByteArray: Int64List.fromList([7, 8, 9]), + aFloatArray: Float64List.fromList([2.71828, _doublePi]), + anEnum: AnEnum.fortyTwo, + anObject: 1, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap, + ); -/// Sets up and runs the integration tests. -void runPigeonIntegrationTests(TargetGenerator targetGenerator) { - IntegrationTestWidgetsFlutterBinding.ensureInitialized(); + final AllNullableTypes genericAllNullableTypes = AllNullableTypes( + aNullableBool: true, + aNullableInt: _regularInt, + aNullableInt64: _biggerThanBigInt, + aNullableDouble: _doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + map: map, + intMap: intMap, + ); + + final AllNullableTypes recursiveAllNullableTypes = AllNullableTypes( + aNullableBool: true, + aNullableInt: _regularInt, + aNullableInt64: _biggerThanBigInt, + aNullableDouble: _doublePi, + aNullableString: 'Hello host!', + aNullableByteArray: Uint8List.fromList([1, 2, 3]), + aNullable4ByteArray: Int32List.fromList([4, 5, 6]), + aNullable8ByteArray: Int64List.fromList([7, 8, 9]), + aNullableFloatArray: Float64List.fromList([2.71828, _doublePi]), + aNullableEnum: AnEnum.fourHundredTwentyTwo, + aNullableObject: 0, + allNullableTypes: genericAllNullableTypes, + list: list, + stringList: stringList, + intList: intList, + doubleList: doubleList, + boolList: boolList, + map: map, + intMap: intMap, + ); group('Host sync API tests', () { testWidgets('basic void->void call works', (WidgetTester _) async { @@ -374,8 +389,8 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllTypes echoObject = await api.echoAllTypes(_genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + final AllTypes echoObject = await api.echoAllTypes(genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets('all nullable datatypes serialize and deserialize correctly', @@ -383,9 +398,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllNullableTypes? echoObject = - await api.echoAllNullableTypes(_recursiveAllNullableTypes); + await api.echoAllNullableTypes(recursiveAllNullableTypes); - _compareAllNullableTypes(echoObject, _recursiveAllNullableTypes); + compareAllNullableTypes(echoObject, recursiveAllNullableTypes); }); testWidgets('all null datatypes serialize and deserialize correctly', @@ -396,7 +411,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAllNullableTypes(allTypesNull); - _compareAllNullableTypes(allTypesNull, echoNullFilledClass); + compareAllNullableTypes(allTypesNull, echoNullFilledClass); }); testWidgets('Classes with list of null serialize and deserialize correctly', @@ -409,7 +424,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAllNullableTypes(nullableListTypes); - _compareAllNullableTypes(nullableListTypes, echoNullFilledClass); + compareAllNullableTypes(nullableListTypes, echoNullFilledClass); }); testWidgets('Classes with map of null serialize and deserialize correctly', @@ -422,7 +437,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAllNullableTypes(nullableListTypes); - _compareAllNullableTypes(nullableListTypes, echoNullFilledClass); + compareAllNullableTypes(nullableListTypes, echoNullFilledClass); }); testWidgets( @@ -432,10 +447,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoObject = await api.echoAllNullableTypesWithoutRecursion( - __genericAllNullableTypesWithoutRecursion); + genericAllNullableTypesWithoutRecursion); - __compareAllNullableTypesWithoutRecursion( - echoObject, __genericAllNullableTypesWithoutRecursion); + compareAllNullableTypesWithoutRecursion( + echoObject, genericAllNullableTypesWithoutRecursion); }); testWidgets( @@ -448,7 +463,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api.echoAllNullableTypesWithoutRecursion(allTypesNull); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( allTypesNull, echoNullFilledClass); }); @@ -465,7 +480,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api.echoAllNullableTypesWithoutRecursion(nullableListTypes); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( nullableListTypes, echoNullFilledClass); }); @@ -482,7 +497,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api.echoAllNullableTypesWithoutRecursion(nullableListTypes); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( nullableListTypes, echoNullFilledClass); }); @@ -520,10 +535,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllClassesWrapper sentObject = AllClassesWrapper( - allNullableTypes: _recursiveAllNullableTypes, + allNullableTypes: recursiveAllNullableTypes, allNullableTypesWithoutRecursion: - __genericAllNullableTypesWithoutRecursion, - allTypes: _genericAllTypes); + genericAllNullableTypesWithoutRecursion, + allTypes: genericAllTypes); final String? receivedString = await api.extractNestedNullableString(sentObject); @@ -547,12 +562,12 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllClassesWrapper sentWrapper = AllClassesWrapper( allNullableTypes: AllNullableTypes(), allNullableTypesWithoutRecursion: AllNullableTypesWithoutRecursion(), - allTypes: _genericAllTypes, + allTypes: genericAllTypes, ); final AllClassesWrapper receivedClassWrapper = await api.echoClassWrapper(sentWrapper); - _compareAllClassesWrapper(sentWrapper, receivedClassWrapper); + compareAllClassesWrapper(sentWrapper, receivedClassWrapper); }); testWidgets('nested null classes can serialize and deserialize correctly', @@ -566,7 +581,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllClassesWrapper receivedClassWrapper = await api.echoClassWrapper(sentWrapper); - _compareAllClassesWrapper(sentWrapper, receivedClassWrapper); + compareAllClassesWrapper(sentWrapper, receivedClassWrapper); }); testWidgets( @@ -714,14 +729,23 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = await api.echoMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); }); testWidgets('enums serialize and deserialize correctly', @@ -935,16 +959,23 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = await api.echoNullableMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - 'd': null, - }; - final Map? echoObject = - await api.echoNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = await api.echoNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); }); testWidgets('nullable enums serialize and deserialize correctly', @@ -986,7 +1017,24 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = await api.echoNullableMap(null); + final Map? echoObject = await api.echoNullableMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoNullableStringMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = await api.echoNullableIntMap(null); expect(mapEquals(echoObject, null), true); }); @@ -1091,9 +1139,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final AllTypes echoObject = await api.echoAsyncAllTypes(_genericAllTypes); + final AllTypes echoObject = await api.echoAsyncAllTypes(genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets( @@ -1102,9 +1150,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllNullableTypes? echoObject = await api - .echoAsyncNullableAllNullableTypes(_recursiveAllNullableTypes); + .echoAsyncNullableAllNullableTypes(recursiveAllNullableTypes); - _compareAllNullableTypes(echoObject, _recursiveAllNullableTypes); + compareAllNullableTypes(echoObject, recursiveAllNullableTypes); }); testWidgets('all null datatypes async serialize and deserialize correctly', @@ -1115,7 +1163,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypes? echoNullFilledClass = await api.echoAsyncNullableAllNullableTypes(allTypesNull); - _compareAllNullableTypes(echoNullFilledClass, allTypesNull); + compareAllNullableTypes(echoNullFilledClass, allTypesNull); }); testWidgets( @@ -1125,10 +1173,10 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoObject = await api.echoAsyncNullableAllNullableTypesWithoutRecursion( - __genericAllNullableTypesWithoutRecursion); + genericAllNullableTypesWithoutRecursion); - __compareAllNullableTypesWithoutRecursion( - echoObject, __genericAllNullableTypesWithoutRecursion); + compareAllNullableTypesWithoutRecursion( + echoObject, genericAllNullableTypesWithoutRecursion); }); testWidgets( @@ -1141,7 +1189,7 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final AllNullableTypesWithoutRecursion? echoNullFilledClass = await api .echoAsyncNullableAllNullableTypesWithoutRecursion(allTypesNull); - __compareAllNullableTypesWithoutRecursion( + compareAllNullableTypesWithoutRecursion( echoNullFilledClass, allTypesNull); }); @@ -1238,15 +1286,23 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoAsyncMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = - await api.echoAsyncMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.echoAsyncStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = await api.echoAsyncIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); }); testWidgets('enums serialize and deserialize correctly', @@ -1373,15 +1429,25 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map? echoObject = - await api.echoAsyncNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.echoAsyncNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); }); testWidgets('nullable enums serialize and deserialize correctly', @@ -1473,11 +1539,29 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = + final Map? echoObject = await api.echoAsyncNullableMap(null); expect(mapEquals(echoObject, null), true); }); + testWidgets('null string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoAsyncNullableStringMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('null int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.echoAsyncNullableIntMap(null); + expect(mapEquals(echoObject, null), true); + }); + testWidgets('null enums serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); @@ -1572,9 +1656,9 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); final AllTypes echoObject = - await api.callFlutterEchoAllTypes(_genericAllTypes); + await api.callFlutterEchoAllTypes(genericAllTypes); - _compareAllTypes(echoObject, _genericAllTypes); + compareAllTypes(echoObject, genericAllTypes); }); testWidgets( @@ -1706,15 +1790,25 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoMap(map); + expect(mapEquals(echoObject, map), true); + }); - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map echoObject = - await api.callFlutterEchoMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + testWidgets('string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map echoObject = + await api.callFlutterEchoIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); }); testWidgets('enums serialize and deserialize correctly', @@ -1880,26 +1974,54 @@ void runPigeonIntegrationTests(TargetGenerator targetGenerator) { testWidgets('nullable maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - - const Map sentObject = { - 'a': 1, - 'b': 2.3, - 'c': 'four', - }; - final Map? echoObject = - await api.callFlutterEchoNullableMap(sentObject); - expect(mapEquals(echoObject, sentObject), true); + final Map? echoObject = + await api.callFlutterEchoNullableMap(map); + expect(mapEquals(echoObject, map), true); }); testWidgets('null maps serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); - final Map? echoObject = + final Map? echoObject = await api.callFlutterEchoNullableMap(null); expect(mapEquals(echoObject, null), true); }); + testWidgets('nullable string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableStringMap(stringMap); + expect(mapEquals(echoObject, stringMap), true); + }); + + testWidgets('null string maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.callFlutterEchoNullableStringMap(null); + expect(mapEquals(echoObject, null), true); + }); + + testWidgets('nullable int maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + final Map? echoObject = + await api.callFlutterEchoNullableIntMap(intMap); + expect(mapEquals(echoObject, intMap), true); + }); + + testWidgets('null maps serialize and deserialize correctly', + (WidgetTester _) async { + final HostIntegrationCoreApi api = HostIntegrationCoreApi(); + + final Map? echoObject = + await api.callFlutterEchoNullableIntMap(null); + expect(mapEquals(echoObject, null), true); + }); + testWidgets('nullable enums serialize and deserialize correctly', (WidgetTester _) async { final HostIntegrationCoreApi api = HostIntegrationCoreApi(); @@ -2038,7 +2160,14 @@ class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { List echoList(List list) => list; @override - Map echoMap(Map aMap) => aMap; + Map echoMap(Map map) => map; + + @override + Map echoStringMap(Map stringMap) => + stringMap; + + @override + Map echoIntMap(Map intMap) => intMap; @override AnEnum echoEnum(AnEnum anEnum) => anEnum; @@ -2059,7 +2188,15 @@ class _FlutterApiTestImplementation implements FlutterIntegrationCoreApi { List? echoNullableList(List? list) => list; @override - Map? echoNullableMap(Map? aMap) => aMap; + Map? echoNullableMap(Map? map) => map; + + @override + Map? echoNullableStringMap( + Map? stringMap) => + stringMap; + + @override + Map? echoNullableIntMap(Map? intMap) => intMap; @override String? echoNullableString(String? aString) => aString; diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart index 762b5d77502..cbf47b745ce 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/core_tests.gen.dart @@ -62,7 +62,10 @@ class AllTypes { required this.intList, required this.doubleList, required this.boolList, + required this.listList, required this.map, + required this.stringMap, + required this.intMap, }); bool aBool; @@ -99,8 +102,14 @@ class AllTypes { List boolList; + List?> listList; + Map map; + Map stringMap; + + Map intMap; + Object encode() { return [ aBool, @@ -120,7 +129,10 @@ class AllTypes { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ]; } @@ -144,7 +156,11 @@ class AllTypes { intList: (result[14] as List?)!.cast(), doubleList: (result[15] as List?)!.cast(), boolList: (result[16] as List?)!.cast(), - map: result[17]! as Map, + listList: (result[17] as List?)!.cast?>(), + map: result[18]! as Map, + stringMap: + (result[19] as Map?)!.cast(), + intMap: (result[20] as Map?)!.cast(), ); } } @@ -160,9 +176,6 @@ class AllNullableTypes { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -173,8 +186,10 @@ class AllNullableTypes { this.intList, this.doubleList, this.boolList, - this.nestedClassList, + this.listList, this.map, + this.stringMap, + this.intMap, }); bool? aNullableBool; @@ -193,12 +208,6 @@ class AllNullableTypes { Float64List? aNullableFloatArray; - List?>? nullableNestedList; - - Map? nullableMapWithAnnotations; - - Map? nullableMapWithObject; - AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; @@ -219,10 +228,14 @@ class AllNullableTypes { List? boolList; - List? nestedClassList; + List?>? listList; Map? map; + Map? stringMap; + + Map? intMap; + Object encode() { return [ aNullableBool, @@ -233,9 +246,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -246,8 +256,10 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + listList, map, + stringMap, + intMap, ]; } @@ -262,24 +274,21 @@ class AllNullableTypes { aNullable4ByteArray: result[5] as Int32List?, aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, - nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), - aNullableEnum: result[11] as AnEnum?, - anotherNullableEnum: result[12] as AnotherEnum?, - aNullableString: result[13] as String?, - aNullableObject: result[14], - allNullableTypes: result[15] as AllNullableTypes?, - list: result[16] as List?, - stringList: (result[17] as List?)?.cast(), - intList: (result[18] as List?)?.cast(), - doubleList: (result[19] as List?)?.cast(), - boolList: (result[20] as List?)?.cast(), - nestedClassList: - (result[21] as List?)?.cast(), - map: result[22] as Map?, + aNullableEnum: result[8] as AnEnum?, + anotherNullableEnum: result[9] as AnotherEnum?, + aNullableString: result[10] as String?, + aNullableObject: result[11], + allNullableTypes: result[12] as AllNullableTypes?, + list: result[13] as List?, + stringList: (result[14] as List?)?.cast(), + intList: (result[15] as List?)?.cast(), + doubleList: (result[16] as List?)?.cast(), + boolList: (result[17] as List?)?.cast(), + listList: (result[18] as List?)?.cast?>(), + map: result[19] as Map?, + stringMap: + (result[20] as Map?)?.cast(), + intMap: (result[21] as Map?)?.cast(), ); } } @@ -297,9 +306,6 @@ class AllNullableTypesWithoutRecursion { this.aNullable4ByteArray, this.aNullable8ByteArray, this.aNullableFloatArray, - this.nullableNestedList, - this.nullableMapWithAnnotations, - this.nullableMapWithObject, this.aNullableEnum, this.anotherNullableEnum, this.aNullableString, @@ -309,7 +315,10 @@ class AllNullableTypesWithoutRecursion { this.intList, this.doubleList, this.boolList, + this.listList, this.map, + this.stringMap, + this.intMap, }); bool? aNullableBool; @@ -328,12 +337,6 @@ class AllNullableTypesWithoutRecursion { Float64List? aNullableFloatArray; - List?>? nullableNestedList; - - Map? nullableMapWithAnnotations; - - Map? nullableMapWithObject; - AnEnum? aNullableEnum; AnotherEnum? anotherNullableEnum; @@ -352,8 +355,14 @@ class AllNullableTypesWithoutRecursion { List? boolList; + List?>? listList; + Map? map; + Map? stringMap; + + Map? intMap; + Object encode() { return [ aNullableBool, @@ -364,9 +373,6 @@ class AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -376,7 +382,10 @@ class AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ]; } @@ -391,21 +400,20 @@ class AllNullableTypesWithoutRecursion { aNullable4ByteArray: result[5] as Int32List?, aNullable8ByteArray: result[6] as Int64List?, aNullableFloatArray: result[7] as Float64List?, - nullableNestedList: (result[8] as List?)?.cast?>(), - nullableMapWithAnnotations: - (result[9] as Map?)?.cast(), - nullableMapWithObject: - (result[10] as Map?)?.cast(), - aNullableEnum: result[11] as AnEnum?, - anotherNullableEnum: result[12] as AnotherEnum?, - aNullableString: result[13] as String?, - aNullableObject: result[14], - list: result[15] as List?, - stringList: (result[16] as List?)?.cast(), - intList: (result[17] as List?)?.cast(), - doubleList: (result[18] as List?)?.cast(), - boolList: (result[19] as List?)?.cast(), - map: result[20] as Map?, + aNullableEnum: result[8] as AnEnum?, + anotherNullableEnum: result[9] as AnotherEnum?, + aNullableString: result[10] as String?, + aNullableObject: result[11], + list: result[12] as List?, + stringList: (result[13] as List?)?.cast(), + intList: (result[14] as List?)?.cast(), + doubleList: (result[15] as List?)?.cast(), + boolList: (result[16] as List?)?.cast(), + listList: (result[17] as List?)?.cast?>(), + map: result[18] as Map?, + stringMap: + (result[19] as Map?)?.cast(), + intMap: (result[20] as Map?)?.cast(), ); } } @@ -473,7 +481,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is AnEnum) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is AnEnum) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is AnotherEnum) { @@ -883,7 +894,7 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future> echoMap(Map aMap) async { + Future> echoMap(Map map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -893,7 +904,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -909,11 +920,74 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?)! - .cast(); + .cast(); } } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + Future> echoStringMap( + Map stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + /// Returns the passed map, to test serialization and deserialization. + Future> echoIntMap(Map intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + /// Returns the passed class to test nested class serialization and deserialization. Future echoClassWrapper(AllClassesWrapper wrapper) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper$pigeonVar_messageChannelSuffix'; @@ -1446,8 +1520,8 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test serialization and deserialization. - Future?> echoNullableMap( - Map? aNullableMap) async { + Future?> echoNullableMap( + Map? map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -1457,7 +1531,60 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aNullableMap]) as List?; + await pigeonVar_channel.send([map]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + /// Returns the passed map, to test serialization and deserialization. + Future?> echoNullableIntMap(Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1468,7 +1595,7 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?) - ?.cast(); + ?.cast(); } } @@ -1807,7 +1934,7 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test asynchronous serialization and deserialization. - Future> echoAsyncMap(Map aMap) async { + Future> echoAsyncMap(Map map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -1817,7 +1944,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -1833,7 +1960,70 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?)! - .cast(); + .cast(); + } + } + + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncStringMap( + Map stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future> echoAsyncIntMap(Map intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } @@ -2231,8 +2421,8 @@ class HostIntegrationCoreApi { } /// Returns the passed map, to test asynchronous serialization and deserialization. - Future?> echoAsyncNullableMap( - Map? aMap) async { + Future?> echoAsyncNullableMap( + Map? map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -2242,7 +2432,61 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([map]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + /// Returns the passed map, to test asynchronous serialization and deserialization. + Future?> echoAsyncNullableIntMap( + Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2253,7 +2497,7 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?) - ?.cast(); + ?.cast(); } } @@ -2697,8 +2941,8 @@ class HostIntegrationCoreApi { } } - Future> callFlutterEchoMap( - Map aMap) async { + Future> callFlutterEchoMap( + Map map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -2708,7 +2952,7 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([map]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2724,7 +2968,68 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?)! - .cast(); + .cast(); + } + } + + Future> callFlutterEchoStringMap( + Map stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); + } + } + + Future> callFlutterEchoIntMap(Map intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else if (pigeonVar_replyList[0] == null) { + throw PlatformException( + code: 'null-error', + message: 'Host platform returned null value for non-null return value.', + ); + } else { + return (pigeonVar_replyList[0] as Map?)! + .cast(); } } @@ -2932,8 +3237,8 @@ class HostIntegrationCoreApi { } } - Future?> callFlutterEchoNullableMap( - Map? aMap) async { + Future?> callFlutterEchoNullableMap( + Map? map) async { final String pigeonVar_channelName = 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableMap$pigeonVar_messageChannelSuffix'; final BasicMessageChannel pigeonVar_channel = @@ -2943,7 +3248,59 @@ class HostIntegrationCoreApi { binaryMessenger: pigeonVar_binaryMessenger, ); final List? pigeonVar_replyList = - await pigeonVar_channel.send([aMap]) as List?; + await pigeonVar_channel.send([map]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableStringMap( + Map? stringMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([stringMap]) as List?; + if (pigeonVar_replyList == null) { + throw _createConnectionError(pigeonVar_channelName); + } else if (pigeonVar_replyList.length > 1) { + throw PlatformException( + code: pigeonVar_replyList[0]! as String, + message: pigeonVar_replyList[1] as String?, + details: pigeonVar_replyList[2], + ); + } else { + return (pigeonVar_replyList[0] as Map?) + ?.cast(); + } + } + + Future?> callFlutterEchoNullableIntMap( + Map? intMap) async { + final String pigeonVar_channelName = + 'dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap$pigeonVar_messageChannelSuffix'; + final BasicMessageChannel pigeonVar_channel = + BasicMessageChannel( + pigeonVar_channelName, + pigeonChannelCodec, + binaryMessenger: pigeonVar_binaryMessenger, + ); + final List? pigeonVar_replyList = + await pigeonVar_channel.send([intMap]) as List?; if (pigeonVar_replyList == null) { throw _createConnectionError(pigeonVar_channelName); } else if (pigeonVar_replyList.length > 1) { @@ -2954,7 +3311,7 @@ class HostIntegrationCoreApi { ); } else { return (pigeonVar_replyList[0] as Map?) - ?.cast(); + ?.cast(); } } @@ -3093,7 +3450,13 @@ abstract class FlutterIntegrationCoreApi { List echoList(List list); /// Returns the passed map, to test serialization and deserialization. - Map echoMap(Map aMap); + Map echoMap(Map map); + + /// Returns the passed map, to test serialization and deserialization. + Map echoStringMap(Map stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map echoIntMap(Map intMap); /// Returns the passed enum to test serialization and deserialization. AnEnum echoEnum(AnEnum anEnum); @@ -3120,7 +3483,14 @@ abstract class FlutterIntegrationCoreApi { List? echoNullableList(List? list); /// Returns the passed map, to test serialization and deserialization. - Map? echoNullableMap(Map? aMap); + Map? echoNullableMap(Map? map); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableStringMap( + Map? stringMap); + + /// Returns the passed map, to test serialization and deserialization. + Map? echoNullableIntMap(Map? intMap); /// Returns the passed enum to test serialization and deserialization. AnEnum? echoNullableEnum(AnEnum? anEnum); @@ -3548,12 +3918,73 @@ abstract class FlutterIntegrationCoreApi { assert(message != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); - assert(arg_aMap != null, - 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); + final Map? arg_map = + (args[0] as Map?)?.cast(); + assert(arg_map != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap was null, expected non-null Map.'); try { - final Map output = api.echoMap(arg_aMap!); + final Map output = api.echoMap(arg_map!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap was null.'); + final List args = (message as List?)!; + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); + assert(arg_stringMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap was null, expected non-null Map.'); + try { + final Map output = + api.echoStringMap(arg_stringMap!); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap was null.'); + final List args = (message as List?)!; + final Map? arg_intMap = + (args[0] as Map?)?.cast(); + assert(arg_intMap != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap was null, expected non-null Map.'); + try { + final Map output = api.echoIntMap(arg_intMap!); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); @@ -3799,10 +4230,67 @@ abstract class FlutterIntegrationCoreApi { assert(message != null, 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap was null.'); final List args = (message as List?)!; - final Map? arg_aMap = - (args[0] as Map?)?.cast(); + final Map? arg_map = + (args[0] as Map?)?.cast(); + try { + final Map? output = api.echoNullableMap(arg_map); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap was null.'); + final List args = (message as List?)!; + final Map? arg_stringMap = + (args[0] as Map?)?.cast(); + try { + final Map? output = + api.echoNullableStringMap(arg_stringMap); + return wrapResponse(result: output); + } on PlatformException catch (e) { + return wrapResponse(error: e); + } catch (e) { + return wrapResponse( + error: PlatformException(code: 'error', message: e.toString())); + } + }); + } + } + { + final BasicMessageChannel< + Object?> pigeonVar_channel = BasicMessageChannel< + Object?>( + 'dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap$messageChannelSuffix', + pigeonChannelCodec, + binaryMessenger: binaryMessenger); + if (api == null) { + pigeonVar_channel.setMessageHandler(null); + } else { + pigeonVar_channel.setMessageHandler((Object? message) async { + assert(message != null, + 'Argument for dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap was null.'); + final List args = (message as List?)!; + final Map? arg_intMap = + (args[0] as Map?)?.cast(); try { - final Map? output = api.echoNullableMap(arg_aMap); + final Map? output = api.echoNullableIntMap(arg_intMap); return wrapResponse(result: output); } on PlatformException catch (e) { return wrapResponse(error: e); diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart index c20e922fdea..6dfbc13452c 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/enum.gen.dart @@ -72,7 +72,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is EnumState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is EnumState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is DataWithEnum) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart index 07e0958447e..c1a8d542e51 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/flutter_unittests.gen.dart @@ -112,7 +112,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is FlutterSearchRequest) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is FlutterSearchRequest) { buffer.putUint8(129); writeValue(buffer, value.encode()); } else if (value is FlutterSearchReply) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart index 19c10427c3d..6a63637da6f 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/message.gen.dart @@ -144,7 +144,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MessageRequestState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is MessageRequestState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart index ce111714138..c7a84edb7ab 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/non_null_fields.gen.dart @@ -127,7 +127,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is ReplyType) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ReplyType) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is NonNullFieldSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart index 672dccad4a3..9ef352f4a45 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/null_fields.gen.dart @@ -106,7 +106,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is NullFieldsSearchReplyType) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is NullFieldsSearchReplyType) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is NullFieldsSearchRequest) { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart index 977356f8ae1..c0634e08ed4 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/src/generated/proxy_api_tests.gen.dart @@ -419,7 +419,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is ProxyApiTestEnum) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is ProxyApiTestEnum) { buffer.putUint8(129); writeValue(buffer, value.index); } else { diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart index a67e2644e7f..62f67720232 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/test/test_message.gen.dart @@ -18,7 +18,10 @@ class _PigeonCodec extends StandardMessageCodec { const _PigeonCodec(); @override void writeValue(WriteBuffer buffer, Object? value) { - if (value is MessageRequestState) { + if (value is int) { + buffer.putUint8(4); + buffer.putInt64(value); + } else if (value is MessageRequestState) { buffer.putUint8(129); writeValue(buffer, value.index); } else if (value is MessageSearchRequest) { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt index 2bf1533b71a..07ac78a6b0e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/CoreTests.gen.kt @@ -83,13 +83,16 @@ data class AllTypes( val intList: List, val doubleList: List, val boolList: List, - val map: Map + val listList: List?>, + val map: Map, + val stringMap: Map, + val intMap: Map ) { companion object { fun fromList(pigeonVar_list: List): AllTypes { val aBool = pigeonVar_list[0] as Boolean - val anInt = pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long } - val anInt64 = pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long } + val anInt = pigeonVar_list[1] as Long + val anInt64 = pigeonVar_list[2] as Long val aDouble = pigeonVar_list[3] as Double val aByteArray = pigeonVar_list[4] as ByteArray val a4ByteArray = pigeonVar_list[5] as IntArray @@ -104,7 +107,10 @@ data class AllTypes( val intList = pigeonVar_list[14] as List val doubleList = pigeonVar_list[15] as List val boolList = pigeonVar_list[16] as List - val map = pigeonVar_list[17] as Map + val listList = pigeonVar_list[17] as List?> + val map = pigeonVar_list[18] as Map + val stringMap = pigeonVar_list[19] as Map + val intMap = pigeonVar_list[20] as Map return AllTypes( aBool, anInt, @@ -123,7 +129,10 @@ data class AllTypes( intList, doubleList, boolList, - map) + listList, + map, + stringMap, + intMap) } } @@ -146,7 +155,10 @@ data class AllTypes( intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ) } } @@ -165,9 +177,6 @@ data class AllNullableTypes( val aNullable4ByteArray: IntArray? = null, val aNullable8ByteArray: LongArray? = null, val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, val aNullableEnum: AnEnum? = null, val anotherNullableEnum: AnotherEnum? = null, val aNullableString: String? = null, @@ -178,36 +187,35 @@ data class AllNullableTypes( val intList: List? = null, val doubleList: List? = null, val boolList: List? = null, - val nestedClassList: List? = null, - val map: Map? = null + val listList: List?>? = null, + val map: Map? = null, + val stringMap: Map? = null, + val intMap: Map? = null ) { companion object { fun fromList(pigeonVar_list: List): AllNullableTypes { val aNullableBool = pigeonVar_list[0] as Boolean? - val aNullableInt = - pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = pigeonVar_list[1] as Long? + val aNullableInt64 = pigeonVar_list[2] as Long? val aNullableDouble = pigeonVar_list[3] as Double? val aNullableByteArray = pigeonVar_list[4] as ByteArray? val aNullable4ByteArray = pigeonVar_list[5] as IntArray? val aNullable8ByteArray = pigeonVar_list[6] as LongArray? val aNullableFloatArray = pigeonVar_list[7] as DoubleArray? - val nullableNestedList = pigeonVar_list[8] as List?>? - val nullableMapWithAnnotations = pigeonVar_list[9] as Map? - val nullableMapWithObject = pigeonVar_list[10] as Map? - val aNullableEnum = pigeonVar_list[11] as AnEnum? - val anotherNullableEnum = pigeonVar_list[12] as AnotherEnum? - val aNullableString = pigeonVar_list[13] as String? - val aNullableObject = pigeonVar_list[14] - val allNullableTypes = pigeonVar_list[15] as AllNullableTypes? - val list = pigeonVar_list[16] as List? - val stringList = pigeonVar_list[17] as List? - val intList = pigeonVar_list[18] as List? - val doubleList = pigeonVar_list[19] as List? - val boolList = pigeonVar_list[20] as List? - val nestedClassList = pigeonVar_list[21] as List? - val map = pigeonVar_list[22] as Map? + val aNullableEnum = pigeonVar_list[8] as AnEnum? + val anotherNullableEnum = pigeonVar_list[9] as AnotherEnum? + val aNullableString = pigeonVar_list[10] as String? + val aNullableObject = pigeonVar_list[11] + val allNullableTypes = pigeonVar_list[12] as AllNullableTypes? + val list = pigeonVar_list[13] as List? + val stringList = pigeonVar_list[14] as List? + val intList = pigeonVar_list[15] as List? + val doubleList = pigeonVar_list[16] as List? + val boolList = pigeonVar_list[17] as List? + val listList = pigeonVar_list[18] as List?>? + val map = pigeonVar_list[19] as Map? + val stringMap = pigeonVar_list[20] as Map? + val intMap = pigeonVar_list[21] as Map? return AllNullableTypes( aNullableBool, aNullableInt, @@ -217,9 +225,6 @@ data class AllNullableTypes( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -230,8 +235,10 @@ data class AllNullableTypes( intList, doubleList, boolList, - nestedClassList, - map) + listList, + map, + stringMap, + intMap) } } @@ -245,9 +252,6 @@ data class AllNullableTypes( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -258,8 +262,10 @@ data class AllNullableTypes( intList, doubleList, boolList, - nestedClassList, + listList, map, + stringMap, + intMap, ) } } @@ -279,9 +285,6 @@ data class AllNullableTypesWithoutRecursion( val aNullable4ByteArray: IntArray? = null, val aNullable8ByteArray: LongArray? = null, val aNullableFloatArray: DoubleArray? = null, - val nullableNestedList: List?>? = null, - val nullableMapWithAnnotations: Map? = null, - val nullableMapWithObject: Map? = null, val aNullableEnum: AnEnum? = null, val anotherNullableEnum: AnotherEnum? = null, val aNullableString: String? = null, @@ -291,33 +294,34 @@ data class AllNullableTypesWithoutRecursion( val intList: List? = null, val doubleList: List? = null, val boolList: List? = null, - val map: Map? = null + val listList: List?>? = null, + val map: Map? = null, + val stringMap: Map? = null, + val intMap: Map? = null ) { companion object { fun fromList(pigeonVar_list: List): AllNullableTypesWithoutRecursion { val aNullableBool = pigeonVar_list[0] as Boolean? - val aNullableInt = - pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long? } - val aNullableInt64 = - pigeonVar_list[2].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableInt = pigeonVar_list[1] as Long? + val aNullableInt64 = pigeonVar_list[2] as Long? val aNullableDouble = pigeonVar_list[3] as Double? val aNullableByteArray = pigeonVar_list[4] as ByteArray? val aNullable4ByteArray = pigeonVar_list[5] as IntArray? val aNullable8ByteArray = pigeonVar_list[6] as LongArray? val aNullableFloatArray = pigeonVar_list[7] as DoubleArray? - val nullableNestedList = pigeonVar_list[8] as List?>? - val nullableMapWithAnnotations = pigeonVar_list[9] as Map? - val nullableMapWithObject = pigeonVar_list[10] as Map? - val aNullableEnum = pigeonVar_list[11] as AnEnum? - val anotherNullableEnum = pigeonVar_list[12] as AnotherEnum? - val aNullableString = pigeonVar_list[13] as String? - val aNullableObject = pigeonVar_list[14] - val list = pigeonVar_list[15] as List? - val stringList = pigeonVar_list[16] as List? - val intList = pigeonVar_list[17] as List? - val doubleList = pigeonVar_list[18] as List? - val boolList = pigeonVar_list[19] as List? - val map = pigeonVar_list[20] as Map? + val aNullableEnum = pigeonVar_list[8] as AnEnum? + val anotherNullableEnum = pigeonVar_list[9] as AnotherEnum? + val aNullableString = pigeonVar_list[10] as String? + val aNullableObject = pigeonVar_list[11] + val list = pigeonVar_list[12] as List? + val stringList = pigeonVar_list[13] as List? + val intList = pigeonVar_list[14] as List? + val doubleList = pigeonVar_list[15] as List? + val boolList = pigeonVar_list[16] as List? + val listList = pigeonVar_list[17] as List?>? + val map = pigeonVar_list[18] as Map? + val stringMap = pigeonVar_list[19] as Map? + val intMap = pigeonVar_list[20] as Map? return AllNullableTypesWithoutRecursion( aNullableBool, aNullableInt, @@ -327,9 +331,6 @@ data class AllNullableTypesWithoutRecursion( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -339,7 +340,10 @@ data class AllNullableTypesWithoutRecursion( intList, doubleList, boolList, - map) + listList, + map, + stringMap, + intMap) } } @@ -353,9 +357,6 @@ data class AllNullableTypesWithoutRecursion( aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -365,7 +366,10 @@ data class AllNullableTypesWithoutRecursion( intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ) } } @@ -426,10 +430,10 @@ private object CoreTestsPigeonCodec : StandardMessageCodec() { override fun readValueOfType(type: Byte, buffer: ByteBuffer): Any? { return when (type) { 129.toByte() -> { - return (readValue(buffer) as Int?)?.let { AnEnum.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AnEnum.ofRaw(it.toInt()) } } 130.toByte() -> { - return (readValue(buffer) as Int?)?.let { AnotherEnum.ofRaw(it) } + return (readValue(buffer) as Long?)?.let { AnotherEnum.ofRaw(it.toInt()) } } 131.toByte() -> { return (readValue(buffer) as? List)?.let { AllTypes.fromList(it) } @@ -519,8 +523,12 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test serialization and deserialization. */ fun echoList(list: List): List /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMap: Map): Map - /** Returns the passed map to test nested class serialization and deserialization. */ + fun echoMap(map: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoStringMap(stringMap: Map): Map + /** Returns the passed map, to test serialization and deserialization. */ + fun echoIntMap(intMap: Map): Map + /** Returns the passed class to test nested class serialization and deserialization. */ fun echoClassWrapper(wrapper: AllClassesWrapper): AllClassesWrapper /** Returns the passed enum to test serialization and deserialization. */ fun echoEnum(anEnum: AnEnum): AnEnum @@ -573,7 +581,11 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test serialization and deserialization. */ fun echoNullableList(aNullableList: List?): List? /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap(aNullableMap: Map?): Map? + fun echoNullableMap(map: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableStringMap(stringMap: Map?): Map? + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableIntMap(intMap: Map?): Map? fun echoNullableEnum(anEnum: AnEnum?): AnEnum? @@ -602,7 +614,14 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncList(list: List, callback: (Result>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncMap(aMap: Map, callback: (Result>) -> Unit) + fun echoAsyncMap(map: Map, callback: (Result>) -> Unit) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncIntMap(intMap: Map, callback: (Result>) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncEnum(anEnum: AnEnum, callback: (Result) -> Unit) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ @@ -640,9 +659,16 @@ interface HostIntegrationCoreApi { /** Returns the passed list, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableList(list: List?, callback: (Result?>) -> Unit) /** Returns the passed map, to test asynchronous serialization and deserialization. */ - fun echoAsyncNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + fun echoAsyncNullableMap(map: Map?, callback: (Result?>) -> Unit) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) + /** Returns the passed map, to test asynchronous serialization and deserialization. */ + fun echoAsyncNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit ) /** Returns the passed enum, to test asynchronous serialization and deserialization. */ fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) @@ -696,7 +722,17 @@ interface HostIntegrationCoreApi { fun callFlutterEchoList(list: List, callback: (Result>) -> Unit) - fun callFlutterEchoMap(aMap: Map, callback: (Result>) -> Unit) + fun callFlutterEchoMap(map: Map, callback: (Result>) -> Unit) + + fun callFlutterEchoStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) + + fun callFlutterEchoIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) @@ -715,8 +751,18 @@ interface HostIntegrationCoreApi { fun callFlutterEchoNullableList(list: List?, callback: (Result?>) -> Unit) fun callFlutterEchoNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) + + fun callFlutterEchoNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit ) fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) @@ -856,7 +902,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[0] as Long val wrapped: List = try { listOf(api.echoInt(anIntArg)) @@ -1010,10 +1056,54 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map + val mapArg = args[0] as Map + val wrapped: List = + try { + listOf(api.echoMap(mapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map + val wrapped: List = + try { + listOf(api.echoStringMap(stringMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map val wrapped: List = try { - listOf(api.echoMap(aMapArg)) + listOf(api.echoIntMap(intMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1142,7 +1232,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[0] as Long val wrapped: List = try { listOf(api.echoRequiredInt(anIntArg)) @@ -1253,8 +1343,7 @@ interface HostIntegrationCoreApi { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1] as Long? val aNullableStringArg = args[2] as String? val wrapped: List = try { @@ -1280,8 +1369,7 @@ interface HostIntegrationCoreApi { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1] as Long? val aNullableStringArg = args[2] as String? val wrapped: List = try { @@ -1306,8 +1394,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[0] as Long? val wrapped: List = try { listOf(api.echoNullableInt(aNullableIntArg)) @@ -1461,10 +1548,54 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableMapArg = args[0] as Map? + val mapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableMap(mapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + val wrapped: List = + try { + listOf(api.echoNullableStringMap(stringMapArg)) + } catch (exception: Throwable) { + wrapError(exception) + } + reply.reply(wrapped) + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? val wrapped: List = try { - listOf(api.echoNullableMap(aNullableMapArg)) + listOf(api.echoNullableIntMap(intMapArg)) } catch (exception: Throwable) { wrapError(exception) } @@ -1527,8 +1658,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aNullableIntArg = - args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[0] as Long? val wrapped: List = try { listOf(api.echoOptionalNullableInt(aNullableIntArg)) @@ -1593,7 +1723,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[0] as Long api.echoAsyncInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -1761,8 +1891,56 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map - api.echoAsyncMap(aMapArg) { result: Result> -> + val mapArg = args[0] as Map + api.echoAsyncMap(mapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map + api.echoAsyncStringMap(stringMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map + api.echoAsyncIntMap(intMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -1972,7 +2150,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val anIntArg = args[0] as Long? api.echoAsyncNullableInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2140,8 +2318,56 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map? - api.echoAsyncNullableMap(aMapArg) { result: Result?> -> + val mapArg = args[0] as Map? + api.echoAsyncNullableMap(mapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + api.echoAsyncNullableStringMap(stringMapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? + api.echoAsyncNullableIntMap(intMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2326,8 +2552,7 @@ interface HostIntegrationCoreApi { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1] as Long? val aNullableStringArg = args[2] as String? api.callFlutterSendMultipleNullableTypes( aNullableBoolArg, aNullableIntArg, aNullableStringArg) { @@ -2380,8 +2605,7 @@ interface HostIntegrationCoreApi { channel.setMessageHandler { message, reply -> val args = message as List val aNullableBoolArg = args[0] as Boolean? - val aNullableIntArg = - args[1].let { num -> if (num is Int) num.toLong() else num as Long? } + val aNullableIntArg = args[1] as Long? val aNullableStringArg = args[2] as String? api.callFlutterSendMultipleNullableTypesWithoutRecursion( aNullableBoolArg, aNullableIntArg, aNullableStringArg) { @@ -2432,7 +2656,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long } + val anIntArg = args[0] as Long api.callFlutterEchoInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2552,8 +2776,56 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map - api.callFlutterEchoMap(aMapArg) { result: Result> -> + val mapArg = args[0] as Map + api.callFlutterEchoMap(mapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map + api.callFlutterEchoStringMap(stringMapArg) { result: Result> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map + api.callFlutterEchoIntMap(intMapArg) { result: Result> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -2648,7 +2920,7 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val anIntArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val anIntArg = args[0] as Long? api.callFlutterEchoNullableInt(anIntArg) { result: Result -> val error = result.exceptionOrNull() if (error != null) { @@ -2768,8 +3040,57 @@ interface HostIntegrationCoreApi { if (api != null) { channel.setMessageHandler { message, reply -> val args = message as List - val aMapArg = args[0] as Map? - api.callFlutterEchoNullableMap(aMapArg) { result: Result?> -> + val mapArg = args[0] as Map? + api.callFlutterEchoNullableMap(mapArg) { result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val stringMapArg = args[0] as Map? + api.callFlutterEchoNullableStringMap(stringMapArg) { + result: Result?> -> + val error = result.exceptionOrNull() + if (error != null) { + reply.reply(wrapError(error)) + } else { + val data = result.getOrNull() + reply.reply(wrapResult(data)) + } + } + } + } else { + channel.setMessageHandler(null) + } + } + run { + val channel = + BasicMessageChannel( + binaryMessenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap$separatedMessageChannelSuffix", + codec) + if (api != null) { + channel.setMessageHandler { message, reply -> + val args = message as List + val intMapArg = args[0] as Map? + api.callFlutterEchoNullableIntMap(intMapArg) { result: Result?> -> val error = result.exceptionOrNull() if (error != null) { reply.reply(wrapError(error)) @@ -3121,7 +3442,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long } + val output = it[0] as Long callback(Result.success(output)) } } else { @@ -3238,13 +3559,70 @@ class FlutterIntegrationCoreApi( } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoMap(aMapArg: Map, callback: (Result>) -> Unit) { + fun echoMap(mapArg: Map, callback: (Result>) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aMapArg)) { + channel.send(listOf(mapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoStringMap( + stringMapArg: Map, + callback: (Result>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(stringMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else if (it[0] == null) { + callback( + Result.failure( + FlutterError( + "null-error", + "Flutter api returned null value for non-null return value.", + ""))) + } else { + val output = it[0] as Map + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoIntMap(intMapArg: Map, callback: (Result>) -> Unit) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(intMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) @@ -3256,7 +3634,7 @@ class FlutterIntegrationCoreApi( "Flutter api returned null value for non-null return value.", ""))) } else { - val output = it[0] as Map + val output = it[0] as Map callback(Result.success(output)) } } else { @@ -3350,7 +3728,7 @@ class FlutterIntegrationCoreApi( if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long? } + val output = it[0] as Long? callback(Result.success(output)) } } else { @@ -3439,21 +3817,64 @@ class FlutterIntegrationCoreApi( } } /** Returns the passed map, to test serialization and deserialization. */ - fun echoNullableMap( - aMapArg: Map?, - callback: (Result?>) -> Unit - ) { + fun echoNullableMap(mapArg: Map?, callback: (Result?>) -> Unit) { val separatedMessageChannelSuffix = if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" val channelName = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap$separatedMessageChannelSuffix" val channel = BasicMessageChannel(binaryMessenger, channelName, codec) - channel.send(listOf(aMapArg)) { + channel.send(listOf(mapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Map? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableStringMap( + stringMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(stringMapArg)) { + if (it is List<*>) { + if (it.size > 1) { + callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) + } else { + val output = it[0] as Map? + callback(Result.success(output)) + } + } else { + callback(Result.failure(createConnectionError(channelName))) + } + } + } + /** Returns the passed map, to test serialization and deserialization. */ + fun echoNullableIntMap( + intMapArg: Map?, + callback: (Result?>) -> Unit + ) { + val separatedMessageChannelSuffix = + if (messageChannelSuffix.isNotEmpty()) ".$messageChannelSuffix" else "" + val channelName = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap$separatedMessageChannelSuffix" + val channel = BasicMessageChannel(binaryMessenger, channelName, codec) + channel.send(listOf(intMapArg)) { if (it is List<*>) { if (it.size > 1) { callback(Result.failure(FlutterError(it[0] as String, it[1] as String, it[2] as String?))) } else { - val output = it[0] as Map? + val output = it[0] as Map? callback(Result.success(output)) } } else { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt index 4c5a1f983b9..57978061166 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/main/kotlin/com/example/test_plugin/TestPlugin.kt @@ -84,8 +84,16 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { return list } - override fun echoMap(aMap: Map): Map { - return aMap + override fun echoMap(map: Map): Map { + return map + } + + override fun echoStringMap(stringMap: Map): Map { + return stringMap + } + + override fun echoIntMap(intMap: Map): Map { + return intMap } override fun echoClassWrapper(wrapper: AllClassesWrapper): AllClassesWrapper { @@ -170,8 +178,16 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - override fun echoNullableMap(aNullableMap: Map?): Map? { - return aNullableMap + override fun echoNullableMap(map: Map?): Map? { + return map + } + + override fun echoNullableStringMap(stringMap: Map?): Map? { + return stringMap + } + + override fun echoNullableIntMap(intMap: Map?): Map? { + return intMap } override fun echoNullableEnum(anEnum: AnEnum?): AnEnum? { @@ -252,11 +268,22 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { callback(Result.success(list)) } - override fun echoAsyncMap( - aMap: Map, - callback: (Result>) -> Unit + override fun echoAsyncMap(map: Map, callback: (Result>) -> Unit) { + callback(Result.success(map)) + } + + override fun echoAsyncStringMap( + stringMap: Map, + callback: (Result>) -> Unit + ) { + callback(Result.success(stringMap)) + } + + override fun echoAsyncIntMap( + intMap: Map, + callback: (Result>) -> Unit ) { - callback(Result.success(aMap)) + callback(Result.success(intMap)) } override fun echoAsyncEnum(anEnum: AnEnum, callback: (Result) -> Unit) { @@ -302,10 +329,24 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun echoAsyncNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(map)) + } + + override fun echoAsyncNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit ) { - callback(Result.success(aMap)) + callback(Result.success(stringMap)) + } + + override fun echoAsyncNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit + ) { + callback(Result.success(intMap)) } override fun echoAsyncNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) { @@ -390,10 +431,24 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun callFlutterEchoMap( - aMap: Map, - callback: (Result>) -> Unit + map: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoMap(map) { echo -> callback(echo) } + } + + override fun callFlutterEchoStringMap( + stringMap: Map, + callback: (Result>) -> Unit ) { - flutterApi!!.echoMap(aMap) { echo -> callback(echo) } + flutterApi!!.echoStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoIntMap( + intMap: Map, + callback: (Result>) -> Unit + ) { + flutterApi!!.echoIntMap(intMap) { echo -> callback(echo) } } override fun callFlutterEchoEnum(anEnum: AnEnum, callback: (Result) -> Unit) { @@ -451,10 +506,24 @@ class TestPlugin : FlutterPlugin, HostIntegrationCoreApi { } override fun callFlutterEchoNullableMap( - aMap: Map?, - callback: (Result?>) -> Unit + map: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableMap(map) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableStringMap( + stringMap: Map?, + callback: (Result?>) -> Unit + ) { + flutterApi!!.echoNullableStringMap(stringMap) { echo -> callback(echo) } + } + + override fun callFlutterEchoNullableIntMap( + intMap: Map?, + callback: (Result?>) -> Unit ) { - flutterApi!!.echoNullableMap(aMap) { echo -> callback(echo) } + flutterApi!!.echoNullableIntMap(intMap) { echo -> callback(echo) } } override fun callFlutterEchoNullableEnum(anEnum: AnEnum?, callback: (Result) -> Unit) { diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt index 5834f34310a..61296f6526e 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/AllDatatypesTest.kt @@ -11,7 +11,6 @@ import java.nio.ByteBuffer import java.util.ArrayList import org.junit.Assert.assertEquals import org.junit.Assert.assertNotNull -import org.junit.Assert.assertNull import org.junit.Assert.assertTrue import org.junit.Test @@ -58,7 +57,6 @@ internal class AllDatatypesTest { assertTrue(firstTypes.aNullable4ByteArray.contentEquals(secondTypes.aNullable4ByteArray)) assertTrue(firstTypes.aNullable8ByteArray.contentEquals(secondTypes.aNullable8ByteArray)) assertTrue(firstTypes.aNullableFloatArray.contentEquals(secondTypes.aNullableFloatArray)) - assertEquals(firstTypes.nullableMapWithObject, secondTypes.nullableMapWithObject) assertEquals(firstTypes.aNullableObject, secondTypes.aNullableObject) assertEquals(firstTypes.aNullableEnum, secondTypes.aNullableEnum) assertEquals(firstTypes.anotherNullableEnum, secondTypes.anotherNullableEnum) @@ -67,7 +65,10 @@ internal class AllDatatypesTest { assertEquals(firstTypes.doubleList, secondTypes.doubleList) assertEquals(firstTypes.intList, secondTypes.intList) assertEquals(firstTypes.stringList, secondTypes.stringList) + assertEquals(firstTypes.listList, secondTypes.listList) assertEquals(firstTypes.map, secondTypes.map) + assertEquals(firstTypes.stringMap, secondTypes.stringMap) + assertEquals(firstTypes.intMap, secondTypes.intMap) } @Test @@ -100,6 +101,7 @@ internal class AllDatatypesTest { @Test fun testHasValues() { + val stringList = listOf("string", "another one") val everything = AllNullableTypes( aNullableBool = false, @@ -110,14 +112,16 @@ internal class AllDatatypesTest { aNullable4ByteArray = intArrayOf(1, 2, 3, 4), aNullable8ByteArray = longArrayOf(1, 2, 3, 4), aNullableFloatArray = doubleArrayOf(0.5, 0.25, 1.5, 1.25), - nullableMapWithObject = mapOf("hello" to 1234), aNullableObject = 0, list = listOf(1, 2, 3), - stringList = listOf("string", "another one"), + stringList = stringList, boolList = listOf(true, false), intList = listOf(1, 2), doubleList = listOf(1.1, 2.2), - map = mapOf("hello" to 1234)) + listList = listOf(stringList, stringList.toList()), + map = mapOf("hello" to 1234), + stringMap = mapOf("hello" to "you"), + intMap = mapOf(1L to 0L)) val binaryMessenger = mockk() val api = FlutterIntegrationCoreApi(binaryMessenger) @@ -141,43 +145,4 @@ internal class AllDatatypesTest { assertTrue(didCall) } - - @Test - fun testIntegerToLong() { - val everything = AllNullableTypes(aNullableInt = 123L) - val list = everything.toList() - assertNotNull(list) - assertNull(list.first()) - assertNotNull(list[1]) - assertTrue(list[1] == 123L) - - val list2 = - listOf( - null, - 123, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null, - null) - val everything2 = AllNullableTypes.fromList(list2) - - assertEquals(everything.aNullableInt, everything2.aNullableInt) - } } diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt deleted file mode 100644 index acdc6192c01..00000000000 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/EnumTest.kt +++ /dev/null @@ -1,80 +0,0 @@ -// Copyright 2013 The Flutter Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -package com.example.test_plugin - -import io.flutter.plugin.common.BinaryMessenger -import io.mockk.every -import io.mockk.mockk -import io.mockk.slot -import io.mockk.verify -import java.nio.ByteBuffer -import java.util.ArrayList -import org.junit.Assert.assertEquals -import org.junit.Assert.assertNotNull -import org.junit.Assert.assertTrue -import org.junit.Test - -internal class EnumTest { - - @Test - fun testEchoHost() { - val binaryMessenger = mockk() - val api = mockk() - - val channelName = "dev.flutter.pigeon.pigeon_integration_tests.EnumApi2Host.echo" - val input = DataWithEnum(EnumState.SNAKE_CASE) - - val handlerSlot = slot() - - every { binaryMessenger.setMessageHandler(channelName, capture(handlerSlot)) } returns Unit - every { api.echo(any()) } returnsArgument 0 - - EnumApi2Host.setUp(binaryMessenger, api) - - val codec = EnumApi2Host.codec - val message = codec.encodeMessage(listOf(input)) - message?.rewind() - handlerSlot.captured.onMessage(message) { - it?.rewind() - @Suppress("UNCHECKED_CAST") val wrapped = codec.decodeMessage(it) as List? - assertNotNull(wrapped) - wrapped?.let { - assertNotNull(wrapped[0]) - assertEquals(input, wrapped[0]) - } - } - - verify { binaryMessenger.setMessageHandler(channelName, handlerSlot.captured) } - verify { api.echo(input) } - } - - @Test - fun testEchoFlutter() { - val binaryMessenger = mockk() - val api = EnumApi2Flutter(binaryMessenger) - - val input = DataWithEnum(EnumState.SNAKE_CASE) - - every { binaryMessenger.send(any(), any(), any()) } answers - { - val codec = EnumApi2Flutter.codec - val message = arg(1) - val reply = arg(2) - message.position(0) - val args = codec.decodeMessage(message) as ArrayList<*> - val replyData = codec.encodeMessage(args) - replyData?.position(0) - reply.reply(replyData) - } - - var didCall = false - api.echo(input) { - didCall = true - assertEquals(input, it.getOrNull()) - } - - assertTrue(didCall) - } -} diff --git a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt index 047c5b3c219..5f496eb0d3d 100644 --- a/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt +++ b/packages/pigeon/platform_tests/test_plugin/android/src/test/kotlin/com/example/test_plugin/PrimitiveTest.kt @@ -21,7 +21,7 @@ class PrimitiveTest { val binaryMessenger = mockk(relaxed = true) val api = mockk(relaxed = true) - val input = 1 + val input = 1L val channelName = "dev.flutter.pigeon.pigeon_integration_tests.PrimitiveHostApi.anInt" val handlerSlot = slot() @@ -38,7 +38,7 @@ class PrimitiveTest { it?.rewind() @Suppress("UNCHECKED_CAST") val wrapped = codec.decodeMessage(it) as List? assertNotNull(wrapped) - wrapped?.let { assertEquals(input.toLong(), wrapped[0]) } + wrapped?.let { assertEquals(input, wrapped[0]) } } verify { binaryMessenger.setMessageHandler(channelName, handlerSlot.captured) } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift index 76877a80978..9c3fca0ec00 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/AllDatatypesTests.swift @@ -28,15 +28,15 @@ class AllDatatypesTests: XCTestCase { XCTAssertNil(res!.aNullable4ByteArray) XCTAssertNil(res!.aNullable8ByteArray) XCTAssertNil(res!.aNullableFloatArray) - XCTAssertNil(res!.nullableNestedList) - XCTAssertNil(res!.nullableMapWithAnnotations) - XCTAssertNil(res!.nullableMapWithObject) - XCTAssertNil(res!.map) XCTAssertNil(res!.list) XCTAssertNil(res!.boolList) XCTAssertNil(res!.intList) XCTAssertNil(res!.doubleList) XCTAssertNil(res!.stringList) + XCTAssertNil(res!.listList) + XCTAssertNil(res!.map) + XCTAssertNil(res!.stringMap) + XCTAssertNil(res!.intMap) expectation.fulfill() case .failure(_): return @@ -56,16 +56,16 @@ class AllDatatypesTests: XCTestCase { aNullable4ByteArray: FlutterStandardTypedData(int32: "1234".data(using: .utf8)!), aNullable8ByteArray: FlutterStandardTypedData(int64: "12345678".data(using: .utf8)!), aNullableFloatArray: FlutterStandardTypedData(float64: "12345678".data(using: .utf8)!), - nullableNestedList: [[true, false], [true]], - nullableMapWithAnnotations: ["hello": "world"], - nullableMapWithObject: ["hello": 1234, "goodbye": "world"], aNullableString: "123", list: ["string", 2], stringList: ["string", "another one"], intList: [1, 2], doubleList: [1.1, 2.2], boolList: [true, false], - map: ["hello": 1234] + listList: [[true], [false]], + map: ["hello": 1234], + stringMap: ["hello": "you"], + intMap: [1: 0] ) let binaryMessenger = EchoBinaryMessenger(codec: CoreTestsPigeonCodec.shared) @@ -85,15 +85,19 @@ class AllDatatypesTests: XCTestCase { XCTAssertEqual(res!.aNullable4ByteArray, everything.aNullable4ByteArray) XCTAssertEqual(res!.aNullable8ByteArray, everything.aNullable8ByteArray) XCTAssertEqual(res!.aNullableFloatArray, everything.aNullableFloatArray) - XCTAssertEqual(res!.nullableNestedList, everything.nullableNestedList) - XCTAssertEqual(res!.nullableMapWithAnnotations, everything.nullableMapWithAnnotations) - XCTAssert(equalsDictionary(res!.nullableMapWithObject, everything.nullableMapWithObject)) XCTAssert(equalsList(res!.list, everything.list)) XCTAssert(equalsList(res!.stringList, everything.stringList)) XCTAssert(equalsList(res!.intList, everything.intList)) XCTAssert(equalsList(res!.doubleList, everything.doubleList)) XCTAssert(equalsList(res!.boolList, everything.boolList)) + if res!.listList != nil { + for (index, list) in res!.listList!.enumerated() { + XCTAssert(equalsList(list, everything.listList![index])) + } + } XCTAssert(equalsDictionary(res!.map, everything.map)) + XCTAssert(equalsDictionary(res!.stringMap, everything.stringMap)) + XCTAssert(equalsDictionary(res!.intMap, everything.intMap)) expectation.fulfill() return case .failure(_): diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift index 2f99f45f1e9..71e98552277 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/PrimitiveTests.swift @@ -12,7 +12,7 @@ class MockPrimitiveHostApi: PrimitiveHostApi { func aBool(value: Bool) -> Bool { value } func aString(value: String) -> String { value } func aDouble(value: Double) -> Double { value } - func aMap(value: [AnyHashable: Any?]) -> [AnyHashable: Any?] { value } + func aMap(value: [AnyHashable?: Any?]) -> [AnyHashable?: Any?] { value } func aList(value: [Any?]) -> [Any?] { value } func anInt32List(value: FlutterStandardTypedData) -> FlutterStandardTypedData { value } func aBoolList(value: [Bool?]) -> [Bool?] { value } diff --git a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift index c244147bede..552fc83bf92 100644 --- a/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift +++ b/packages/pigeon/platform_tests/test_plugin/example/ios/RunnerTests/Utils.swift @@ -26,7 +26,7 @@ func equalsList(_ x: [Any?]?, _ y: [Any?]?) -> Bool { return (0.. Bool { +func equalsDictionary(_ x: [AnyHashable?: Any?]?, _ y: [AnyHashable?: Any?]?) -> Bool { if x == nil, y == nil { return true } diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift index 00fd797edce..078d0c688ee 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/CoreTests.gen.swift @@ -107,7 +107,10 @@ struct AllTypes { var intList: [Int64?] var doubleList: [Double?] var boolList: [Bool?] - var map: [AnyHashable: Any?] + var listList: [[Any?]?] + var map: [AnyHashable?: Any?] + var stringMap: [String?: String?] + var intMap: [Int64?: Int64?] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { @@ -130,7 +133,10 @@ struct AllTypes { let intList = pigeonVar_list[14] as! [Int64?] let doubleList = pigeonVar_list[15] as! [Double?] let boolList = pigeonVar_list[16] as! [Bool?] - let map = pigeonVar_list[17] as! [AnyHashable: Any?] + let listList = pigeonVar_list[17] as! [[Any?]?] + let map = pigeonVar_list[18] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[19] as! [String?: String?] + let intMap = pigeonVar_list[20] as! [Int64?: Int64?] return AllTypes( aBool: aBool, @@ -150,7 +156,10 @@ struct AllTypes { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -172,7 +181,10 @@ struct AllTypes { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ] } } @@ -190,9 +202,6 @@ class AllNullableTypes { aNullable4ByteArray: FlutterStandardTypedData? = nil, aNullable8ByteArray: FlutterStandardTypedData? = nil, aNullableFloatArray: FlutterStandardTypedData? = nil, - nullableNestedList: [[Bool?]?]? = nil, - nullableMapWithAnnotations: [String?: String?]? = nil, - nullableMapWithObject: [String?: Any?]? = nil, aNullableEnum: AnEnum? = nil, anotherNullableEnum: AnotherEnum? = nil, aNullableString: String? = nil, @@ -203,8 +212,10 @@ class AllNullableTypes { intList: [Int64?]? = nil, doubleList: [Double?]? = nil, boolList: [Bool?]? = nil, - nestedClassList: [AllNullableTypes?]? = nil, - map: [AnyHashable: Any?]? = nil + listList: [[Any?]?]? = nil, + map: [AnyHashable?: Any?]? = nil, + stringMap: [String?: String?]? = nil, + intMap: [Int64?: Int64?]? = nil ) { self.aNullableBool = aNullableBool self.aNullableInt = aNullableInt @@ -214,9 +225,6 @@ class AllNullableTypes { self.aNullable4ByteArray = aNullable4ByteArray self.aNullable8ByteArray = aNullable8ByteArray self.aNullableFloatArray = aNullableFloatArray - self.nullableNestedList = nullableNestedList - self.nullableMapWithAnnotations = nullableMapWithAnnotations - self.nullableMapWithObject = nullableMapWithObject self.aNullableEnum = aNullableEnum self.anotherNullableEnum = anotherNullableEnum self.aNullableString = aNullableString @@ -227,8 +235,10 @@ class AllNullableTypes { self.intList = intList self.doubleList = doubleList self.boolList = boolList - self.nestedClassList = nestedClassList + self.listList = listList self.map = map + self.stringMap = stringMap + self.intMap = intMap } var aNullableBool: Bool? var aNullableInt: Int64? @@ -238,9 +248,6 @@ class AllNullableTypes { var aNullable4ByteArray: FlutterStandardTypedData? var aNullable8ByteArray: FlutterStandardTypedData? var aNullableFloatArray: FlutterStandardTypedData? - var nullableNestedList: [[Bool?]?]? - var nullableMapWithAnnotations: [String?: String?]? - var nullableMapWithObject: [String?: Any?]? var aNullableEnum: AnEnum? var anotherNullableEnum: AnotherEnum? var aNullableString: String? @@ -251,8 +258,10 @@ class AllNullableTypes { var intList: [Int64?]? var doubleList: [Double?]? var boolList: [Bool?]? - var nestedClassList: [AllNullableTypes?]? - var map: [AnyHashable: Any?]? + var listList: [[Any?]?]? + var map: [AnyHashable?: Any?]? + var stringMap: [String?: String?]? + var intMap: [Int64?: Int64?]? // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypes? { @@ -272,21 +281,20 @@ class AllNullableTypes { let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[15]) - let list: [Any?]? = nilOrValue(pigeonVar_list[16]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[17]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[18]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[19]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[20]) - let nestedClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[22]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[12]) + let list: [Any?]? = nilOrValue(pigeonVar_list[13]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[18]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[19]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[20]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[21]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -297,9 +305,6 @@ class AllNullableTypes { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -310,8 +315,10 @@ class AllNullableTypes { intList: intList, doubleList: doubleList, boolList: boolList, - nestedClassList: nestedClassList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -324,9 +331,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -337,8 +341,10 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + listList, map, + stringMap, + intMap, ] } } @@ -357,9 +363,6 @@ struct AllNullableTypesWithoutRecursion { var aNullable4ByteArray: FlutterStandardTypedData? = nil var aNullable8ByteArray: FlutterStandardTypedData? = nil var aNullableFloatArray: FlutterStandardTypedData? = nil - var nullableNestedList: [[Bool?]?]? = nil - var nullableMapWithAnnotations: [String?: String?]? = nil - var nullableMapWithObject: [String?: Any?]? = nil var aNullableEnum: AnEnum? = nil var anotherNullableEnum: AnotherEnum? = nil var aNullableString: String? = nil @@ -369,7 +372,10 @@ struct AllNullableTypesWithoutRecursion { var intList: [Int64?]? = nil var doubleList: [Double?]? = nil var boolList: [Bool?]? = nil - var map: [AnyHashable: Any?]? = nil + var listList: [[Any?]?]? = nil + var map: [AnyHashable?: Any?]? = nil + var stringMap: [String?: String?]? = nil + var intMap: [Int64?: Int64?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { @@ -389,19 +395,19 @@ struct AllNullableTypesWithoutRecursion { let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let list: [Any?]? = nilOrValue(pigeonVar_list[15]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[16]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[17]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[18]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[20]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let list: [Any?]? = nilOrValue(pigeonVar_list[12]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[13]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[14]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[15]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[16]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[17]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[18]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[19]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[20]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -412,9 +418,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -424,7 +427,10 @@ struct AllNullableTypesWithoutRecursion { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -437,9 +443,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -449,7 +452,10 @@ struct AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ] } } @@ -614,8 +620,12 @@ protocol HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. func echo(_ list: [Any?]) throws -> [Any?] /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] - /// Returns the passed map to test nested class serialization and deserialization. + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] + /// Returns the passed map, to test serialization and deserialization. + func echo(stringMap: [String?: String?]) throws -> [String?: String?] + /// Returns the passed map, to test serialization and deserialization. + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] + /// Returns the passed class to test nested class serialization and deserialization. func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnum: AnEnum) throws -> AnEnum @@ -661,7 +671,11 @@ protocol HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? /// Returns passed in int. @@ -689,7 +703,15 @@ protocol HostIntegrationCoreApi { func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -729,7 +751,15 @@ protocol HostIntegrationCoreApi { func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -761,7 +791,13 @@ protocol HostIntegrationCoreApi { completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEcho( _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) @@ -778,7 +814,13 @@ protocol HostIntegrationCoreApi { func callFlutterEchoNullable( _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) func callFlutterEchoNullable( _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterEchoNullable( @@ -1025,9 +1067,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] + let mapArg = args[0] as! [AnyHashable?: Any?] do { - let result = try api.echo(aMapArg) + let result = try api.echo(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1036,7 +1078,45 @@ class HostIntegrationCoreApiSetup { } else { echoMapChannel.setMessageHandler(nil) } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + let echoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + do { + let result = try api.echo(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + do { + let result = try api.echo(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed class to test nested class serialization and deserialization. let echoClassWrapperChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", @@ -1419,9 +1499,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[0]) + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) do { - let result = try api.echoNullable(aNullableMapArg) + let result = try api.echoNullable(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1430,6 +1510,44 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntMapChannel.setMessageHandler(nil) + } let echoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", @@ -1681,8 +1799,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.echoAsync(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.echoAsync(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1694,6 +1812,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.echoAsync(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.echoAsync(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncEnumChannel = FlutterBasicMessageChannel( name: @@ -2013,8 +2173,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(aMapArg) { result in + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.echoAsyncNullable(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2026,6 +2186,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.echoAsyncNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.echoAsyncNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( name: @@ -2362,8 +2564,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.callFlutterEcho(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.callFlutterEcho(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2375,6 +2577,46 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } + let callFlutterEchoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.callFlutterEcho(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.callFlutterEcho(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoIntMapChannel.setMessageHandler(nil) + } let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", @@ -2544,8 +2786,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aMapArg) { result in + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2557,6 +2799,46 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } + let callFlutterEchoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntMapChannel.setMessageHandler(nil) + } let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", @@ -2672,8 +2954,16 @@ protocol FlutterIntegrationCoreApiProtocol { func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum to test serialization and deserialization. @@ -2698,8 +2988,16 @@ protocol FlutterIntegrationCoreApiProtocol { _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echoNullable( _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) @@ -3112,13 +3410,76 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed map, to test serialization and deserialization. func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void ) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnyHashable?: Any?] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: String?] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3135,7 +3496,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [String?: Any?] + let result = listResponse[0] as! [Int64?: Int64?] completion(.success(result)) } } @@ -3346,14 +3707,64 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void ) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [AnyHashable?: Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [String?: String?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3364,7 +3775,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [String?: Any?]? = nilOrValue(listResponse[0]) + let result: [Int64?: Int64?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } diff --git a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift index be07319c7c0..d49277d1329 100644 --- a/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift +++ b/packages/pigeon/platform_tests/test_plugin/ios/Classes/TestPlugin.swift @@ -87,8 +87,16 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return list } - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] { - return aMap + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] { + return map + } + + func echo(stringMap: [String?: String?]) throws -> [String?: String?] { + return stringMap + } + + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] { + return intMap } func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper { @@ -167,8 +175,16 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? { - return aNullableMap + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? { + return map + } + + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? { + return stringMap + } + + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? { + return intMap } func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? { @@ -253,9 +269,21 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(map)) + } + + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + completion(.success(intMap)) } func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { @@ -302,9 +330,23 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void + ) { + completion(.success(map)) + } + + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(stringMap)) + } + + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + completion(.success(intMap)) } func echoAsyncNullable( @@ -501,9 +543,35 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + flutterAPI.echo(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void ) { - flutterAPI.echo(aMap) { response in + flutterAPI.echo(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + flutterAPI.echo(intMap: intMap) { response in switch response { case .success(let res): completion(.success(res)) @@ -618,9 +686,37 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void ) { - flutterAPI.echoNullable(aMap) { response in + flutterAPI.echoNullable(intMap: intMap) { response in switch response { case .success(let res): completion(.success(res)) diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc index 4b2a24280c6..9e32edad6e6 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.cc @@ -31,7 +31,10 @@ struct _CoreTestsPigeonTestAllTypes { FlValue* int_list; FlValue* double_list; FlValue* bool_list; + FlValue* list_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllTypes, core_tests_pigeon_test_all_types, @@ -46,7 +49,10 @@ static void core_tests_pigeon_test_all_types_dispose(GObject* object) { g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_types_parent_class) ->dispose(object); } @@ -68,7 +74,8 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( CoreTestsPigeonTestAnEnum an_enum, CoreTestsPigeonTestAnotherEnum another_enum, const gchar* a_string, FlValue* an_object, FlValue* list, FlValue* string_list, FlValue* int_list, - FlValue* double_list, FlValue* bool_list, FlValue* map) { + FlValue* double_list, FlValue* bool_list, FlValue* list_list, FlValue* map, + FlValue* string_map, FlValue* int_map) { CoreTestsPigeonTestAllTypes* self = CORE_TESTS_PIGEON_TEST_ALL_TYPES( g_object_new(core_tests_pigeon_test_all_types_get_type(), nullptr)); self->a_bool = a_bool; @@ -99,7 +106,10 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( self->int_list = fl_value_ref(int_list); self->double_list = fl_value_ref(double_list); self->bool_list = fl_value_ref(bool_list); + self->list_list = fl_value_ref(list_list); self->map = fl_value_ref(map); + self->string_map = fl_value_ref(string_map); + self->int_map = fl_value_ref(int_map); return self; } @@ -212,12 +222,30 @@ FlValue* core_tests_pigeon_test_all_types_get_bool_list( return self->bool_list; } +FlValue* core_tests_pigeon_test_all_types_get_list_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->list_list; +} + FlValue* core_tests_pigeon_test_all_types_get_map( CoreTestsPigeonTestAllTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); return self->map; } +FlValue* core_tests_pigeon_test_all_types_get_string_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->string_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_int_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->int_map; +} + static FlValue* core_tests_pigeon_test_all_types_to_list( CoreTestsPigeonTestAllTypes* self) { FlValue* values = fl_value_new_list(); @@ -250,7 +278,10 @@ static FlValue* core_tests_pigeon_test_all_types_to_list( fl_value_append_take(values, fl_value_ref(self->int_list)); fl_value_append_take(values, fl_value_ref(self->double_list)); fl_value_append_take(values, fl_value_ref(self->bool_list)); + fl_value_append_take(values, fl_value_ref(self->list_list)); fl_value_append_take(values, fl_value_ref(self->map)); + fl_value_append_take(values, fl_value_ref(self->string_map)); + fl_value_append_take(values, fl_value_ref(self->int_map)); return values; } @@ -300,12 +331,19 @@ core_tests_pigeon_test_all_types_new_from_list(FlValue* values) { FlValue* value16 = fl_value_get_list_value(values, 16); FlValue* bool_list = value16; FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* map = value17; + FlValue* list_list = value17; + FlValue* value18 = fl_value_get_list_value(values, 18); + FlValue* map = value18; + FlValue* value19 = fl_value_get_list_value(values, 19); + FlValue* string_map = value19; + FlValue* value20 = fl_value_get_list_value(values, 20); + FlValue* int_map = value20; return core_tests_pigeon_test_all_types_new( a_bool, an_int, an_int64, a_double, a_byte_array, a_byte_array_length, a4_byte_array, a4_byte_array_length, a8_byte_array, a8_byte_array_length, a_float_array, a_float_array_length, an_enum, another_enum, a_string, - an_object, list, string_list, int_list, double_list, bool_list, map); + an_object, list, string_list, int_list, double_list, bool_list, list_list, + map, string_map, int_map); } struct _CoreTestsPigeonTestAllNullableTypes { @@ -323,9 +361,6 @@ struct _CoreTestsPigeonTestAllNullableTypes { size_t a_nullable8_byte_array_length; double* a_nullable_float_array; size_t a_nullable_float_array_length; - FlValue* nullable_nested_list; - FlValue* nullable_map_with_annotations; - FlValue* nullable_map_with_object; CoreTestsPigeonTestAnEnum* a_nullable_enum; CoreTestsPigeonTestAnotherEnum* another_nullable_enum; gchar* a_nullable_string; @@ -336,8 +371,10 @@ struct _CoreTestsPigeonTestAllNullableTypes { FlValue* int_list; FlValue* double_list; FlValue* bool_list; - FlValue* nested_class_list; + FlValue* list_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllNullableTypes, @@ -350,9 +387,6 @@ static void core_tests_pigeon_test_all_nullable_types_dispose(GObject* object) { g_clear_pointer(&self->a_nullable_int, g_free); g_clear_pointer(&self->a_nullable_int64, g_free); g_clear_pointer(&self->a_nullable_double, g_free); - g_clear_pointer(&self->nullable_nested_list, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_annotations, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_object, fl_value_unref); g_clear_pointer(&self->a_nullable_enum, g_free); g_clear_pointer(&self->another_nullable_enum, g_free); g_clear_pointer(&self->a_nullable_string, g_free); @@ -363,8 +397,10 @@ static void core_tests_pigeon_test_all_nullable_types_dispose(GObject* object) { g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); - g_clear_pointer(&self->nested_class_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_nullable_types_parent_class) ->dispose(object); } @@ -386,14 +422,13 @@ core_tests_pigeon_test_all_nullable_types_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* nested_class_list, FlValue* map) { + FlValue* bool_list, FlValue* list_list, FlValue* map, FlValue* string_map, + FlValue* int_map) { CoreTestsPigeonTestAllNullableTypes* self = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES(g_object_new( core_tests_pigeon_test_all_nullable_types_get_type(), nullptr)); @@ -460,22 +495,6 @@ core_tests_pigeon_test_all_nullable_types_new( self->a_nullable_float_array = nullptr; self->a_nullable_float_array_length = 0; } - if (nullable_nested_list != nullptr) { - self->nullable_nested_list = fl_value_ref(nullable_nested_list); - } else { - self->nullable_nested_list = nullptr; - } - if (nullable_map_with_annotations != nullptr) { - self->nullable_map_with_annotations = - fl_value_ref(nullable_map_with_annotations); - } else { - self->nullable_map_with_annotations = nullptr; - } - if (nullable_map_with_object != nullptr) { - self->nullable_map_with_object = fl_value_ref(nullable_map_with_object); - } else { - self->nullable_map_with_object = nullptr; - } if (a_nullable_enum != nullptr) { self->a_nullable_enum = static_cast( malloc(sizeof(CoreTestsPigeonTestAnEnum))); @@ -531,16 +550,26 @@ core_tests_pigeon_test_all_nullable_types_new( } else { self->bool_list = nullptr; } - if (nested_class_list != nullptr) { - self->nested_class_list = fl_value_ref(nested_class_list); + if (list_list != nullptr) { + self->list_list = fl_value_ref(list_list); } else { - self->nested_class_list = nullptr; + self->list_list = nullptr; } if (map != nullptr) { self->map = fl_value_ref(map); } else { self->map = nullptr; } + if (string_map != nullptr) { + self->string_map = fl_value_ref(string_map); + } else { + self->string_map = nullptr; + } + if (int_map != nullptr) { + self->int_map = fl_value_ref(int_map); + } else { + self->int_map = nullptr; + } return self; } @@ -608,28 +637,6 @@ core_tests_pigeon_test_all_nullable_types_get_a_nullable_float_array( return self->a_nullable_float_array; } -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_nested_list; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_map_with_annotations; -} - -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypes* self) { - g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), - nullptr); - return self->nullable_map_with_object; -} - CoreTestsPigeonTestAnEnum* core_tests_pigeon_test_all_nullable_types_get_a_nullable_enum( CoreTestsPigeonTestAllNullableTypes* self) { @@ -703,11 +710,11 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_bool_list( return self->bool_list; } -FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( CoreTestsPigeonTestAllNullableTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), nullptr); - return self->nested_class_list; + return self->list_list; } FlValue* core_tests_pigeon_test_all_nullable_types_get_map( @@ -717,6 +724,20 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_map( return self->map; } +FlValue* core_tests_pigeon_test_all_nullable_types_get_string_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->string_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_int_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->int_map; +} + static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( CoreTestsPigeonTestAllNullableTypes* self) { FlValue* values = fl_value_new_list(); @@ -753,17 +774,6 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( ? fl_value_new_float_list(self->a_nullable_float_array, self->a_nullable_float_array_length) : fl_value_new_null()); - fl_value_append_take(values, self->nullable_nested_list != nullptr - ? fl_value_ref(self->nullable_nested_list) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_annotations != nullptr - ? fl_value_ref(self->nullable_map_with_annotations) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_object != nullptr - ? fl_value_ref(self->nullable_map_with_object) - : fl_value_new_null()); fl_value_append_take( values, self->a_nullable_enum != nullptr @@ -802,11 +812,17 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( fl_value_append_take(values, self->bool_list != nullptr ? fl_value_ref(self->bool_list) : fl_value_new_null()); - fl_value_append_take(values, self->nested_class_list != nullptr - ? fl_value_ref(self->nested_class_list) + fl_value_append_take(values, self->list_list != nullptr + ? fl_value_ref(self->list_list) : fl_value_new_null()); fl_value_append_take(values, self->map != nullptr ? fl_value_ref(self->map) : fl_value_new_null()); + fl_value_append_take(values, self->string_map != nullptr + ? fl_value_ref(self->string_map) + : fl_value_new_null()); + fl_value_append_take(values, self->int_map != nullptr + ? fl_value_ref(self->int_map) + : fl_value_new_null()); return values; } @@ -869,99 +885,93 @@ core_tests_pigeon_test_all_nullable_types_new_from_list(FlValue* values) { a_nullable_float_array_length = fl_value_get_length(value7); } FlValue* value8 = fl_value_get_list_value(values, 8); - FlValue* nullable_nested_list = nullptr; + CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; + CoreTestsPigeonTestAnEnum a_nullable_enum_value; if (fl_value_get_type(value8) != FL_VALUE_TYPE_NULL) { - nullable_nested_list = value8; + a_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value8))))); + a_nullable_enum = &a_nullable_enum_value; } FlValue* value9 = fl_value_get_list_value(values, 9); - FlValue* nullable_map_with_annotations = nullptr; + CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; if (fl_value_get_type(value9) != FL_VALUE_TYPE_NULL) { - nullable_map_with_annotations = value9; + another_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value9))))); + another_nullable_enum = &another_nullable_enum_value; } FlValue* value10 = fl_value_get_list_value(values, 10); - FlValue* nullable_map_with_object = nullptr; + const gchar* a_nullable_string = nullptr; if (fl_value_get_type(value10) != FL_VALUE_TYPE_NULL) { - nullable_map_with_object = value10; + a_nullable_string = fl_value_get_string(value10); } FlValue* value11 = fl_value_get_list_value(values, 11); - CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; - CoreTestsPigeonTestAnEnum a_nullable_enum_value; + FlValue* a_nullable_object = nullptr; if (fl_value_get_type(value11) != FL_VALUE_TYPE_NULL) { - a_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value11))))); - a_nullable_enum = &a_nullable_enum_value; + a_nullable_object = value11; } FlValue* value12 = fl_value_get_list_value(values, 12); - CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; + CoreTestsPigeonTestAllNullableTypes* all_nullable_types = nullptr; if (fl_value_get_type(value12) != FL_VALUE_TYPE_NULL) { - another_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value12))))); - another_nullable_enum = &another_nullable_enum_value; + all_nullable_types = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( + fl_value_get_custom_value_object(value12)); } FlValue* value13 = fl_value_get_list_value(values, 13); - const gchar* a_nullable_string = nullptr; + FlValue* list = nullptr; if (fl_value_get_type(value13) != FL_VALUE_TYPE_NULL) { - a_nullable_string = fl_value_get_string(value13); + list = value13; } FlValue* value14 = fl_value_get_list_value(values, 14); - FlValue* a_nullable_object = nullptr; + FlValue* string_list = nullptr; if (fl_value_get_type(value14) != FL_VALUE_TYPE_NULL) { - a_nullable_object = value14; + string_list = value14; } FlValue* value15 = fl_value_get_list_value(values, 15); - CoreTestsPigeonTestAllNullableTypes* all_nullable_types = nullptr; + FlValue* int_list = nullptr; if (fl_value_get_type(value15) != FL_VALUE_TYPE_NULL) { - all_nullable_types = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES( - fl_value_get_custom_value_object(value15)); + int_list = value15; } FlValue* value16 = fl_value_get_list_value(values, 16); - FlValue* list = nullptr; + FlValue* double_list = nullptr; if (fl_value_get_type(value16) != FL_VALUE_TYPE_NULL) { - list = value16; + double_list = value16; } FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* string_list = nullptr; + FlValue* bool_list = nullptr; if (fl_value_get_type(value17) != FL_VALUE_TYPE_NULL) { - string_list = value17; + bool_list = value17; } FlValue* value18 = fl_value_get_list_value(values, 18); - FlValue* int_list = nullptr; + FlValue* list_list = nullptr; if (fl_value_get_type(value18) != FL_VALUE_TYPE_NULL) { - int_list = value18; + list_list = value18; } FlValue* value19 = fl_value_get_list_value(values, 19); - FlValue* double_list = nullptr; + FlValue* map = nullptr; if (fl_value_get_type(value19) != FL_VALUE_TYPE_NULL) { - double_list = value19; + map = value19; } FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* bool_list = nullptr; + FlValue* string_map = nullptr; if (fl_value_get_type(value20) != FL_VALUE_TYPE_NULL) { - bool_list = value20; + string_map = value20; } FlValue* value21 = fl_value_get_list_value(values, 21); - FlValue* nested_class_list = nullptr; + FlValue* int_map = nullptr; if (fl_value_get_type(value21) != FL_VALUE_TYPE_NULL) { - nested_class_list = value21; - } - FlValue* value22 = fl_value_get_list_value(values, 22); - FlValue* map = nullptr; - if (fl_value_get_type(value22) != FL_VALUE_TYPE_NULL) { - map = value22; + int_map = value21; } return core_tests_pigeon_test_all_nullable_types_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, a_nullable_byte_array, a_nullable_byte_array_length, a_nullable4_byte_array, a_nullable4_byte_array_length, a_nullable8_byte_array, a_nullable8_byte_array_length, - a_nullable_float_array, a_nullable_float_array_length, - nullable_nested_list, nullable_map_with_annotations, - nullable_map_with_object, a_nullable_enum, another_nullable_enum, - a_nullable_string, a_nullable_object, all_nullable_types, list, - string_list, int_list, double_list, bool_list, nested_class_list, map); + a_nullable_float_array, a_nullable_float_array_length, a_nullable_enum, + another_nullable_enum, a_nullable_string, a_nullable_object, + all_nullable_types, list, string_list, int_list, double_list, bool_list, + list_list, map, string_map, int_map); } struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { @@ -979,9 +989,6 @@ struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { size_t a_nullable8_byte_array_length; double* a_nullable_float_array; size_t a_nullable_float_array_length; - FlValue* nullable_nested_list; - FlValue* nullable_map_with_annotations; - FlValue* nullable_map_with_object; CoreTestsPigeonTestAnEnum* a_nullable_enum; CoreTestsPigeonTestAnotherEnum* another_nullable_enum; gchar* a_nullable_string; @@ -991,7 +998,10 @@ struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { FlValue* int_list; FlValue* double_list; FlValue* bool_list; + FlValue* list_list; FlValue* map; + FlValue* string_map; + FlValue* int_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllNullableTypesWithoutRecursion, @@ -1006,9 +1016,6 @@ static void core_tests_pigeon_test_all_nullable_types_without_recursion_dispose( g_clear_pointer(&self->a_nullable_int, g_free); g_clear_pointer(&self->a_nullable_int64, g_free); g_clear_pointer(&self->a_nullable_double, g_free); - g_clear_pointer(&self->nullable_nested_list, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_annotations, fl_value_unref); - g_clear_pointer(&self->nullable_map_with_object, fl_value_unref); g_clear_pointer(&self->a_nullable_enum, g_free); g_clear_pointer(&self->another_nullable_enum, g_free); g_clear_pointer(&self->a_nullable_string, g_free); @@ -1018,7 +1025,10 @@ static void core_tests_pigeon_test_all_nullable_types_without_recursion_dispose( g_clear_pointer(&self->int_list, fl_value_unref); g_clear_pointer(&self->double_list, fl_value_unref); g_clear_pointer(&self->bool_list, fl_value_unref); + g_clear_pointer(&self->list_list, fl_value_unref); g_clear_pointer(&self->map, fl_value_unref); + g_clear_pointer(&self->string_map, fl_value_unref); + g_clear_pointer(&self->int_map, fl_value_unref); G_OBJECT_CLASS( core_tests_pigeon_test_all_nullable_types_without_recursion_parent_class) ->dispose(object); @@ -1042,13 +1052,12 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* map) { + FlValue* bool_list, FlValue* list_list, FlValue* map, FlValue* string_map, + FlValue* int_map) { CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(g_object_new( core_tests_pigeon_test_all_nullable_types_without_recursion_get_type(), @@ -1116,22 +1125,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( self->a_nullable_float_array = nullptr; self->a_nullable_float_array_length = 0; } - if (nullable_nested_list != nullptr) { - self->nullable_nested_list = fl_value_ref(nullable_nested_list); - } else { - self->nullable_nested_list = nullptr; - } - if (nullable_map_with_annotations != nullptr) { - self->nullable_map_with_annotations = - fl_value_ref(nullable_map_with_annotations); - } else { - self->nullable_map_with_annotations = nullptr; - } - if (nullable_map_with_object != nullptr) { - self->nullable_map_with_object = fl_value_ref(nullable_map_with_object); - } else { - self->nullable_map_with_object = nullptr; - } if (a_nullable_enum != nullptr) { self->a_nullable_enum = static_cast( malloc(sizeof(CoreTestsPigeonTestAnEnum))); @@ -1181,11 +1174,26 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( } else { self->bool_list = nullptr; } + if (list_list != nullptr) { + self->list_list = fl_value_ref(list_list); + } else { + self->list_list = nullptr; + } if (map != nullptr) { self->map = fl_value_ref(map); } else { self->map = nullptr; } + if (string_map != nullptr) { + self->string_map = fl_value_ref(string_map); + } else { + self->string_map = nullptr; + } + if (int_map != nullptr) { + self->int_map = fl_value_ref(int_map); + } else { + self->int_map = nullptr; + } return self; } @@ -1265,33 +1273,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_float return self->a_nullable_float_array; } -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_nested_list; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_map_with_annotations; -} - -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { - g_return_val_if_fail( - CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), - nullptr); - return self->nullable_map_with_object; -} - CoreTestsPigeonTestAnEnum* core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_enum( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { @@ -1372,6 +1353,15 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_bool_list( return self->bool_list; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->list_list; +} + FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { g_return_val_if_fail( @@ -1380,6 +1370,24 @@ FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( return self->map; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->string_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->int_map; +} + static FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { @@ -1417,17 +1425,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( ? fl_value_new_float_list(self->a_nullable_float_array, self->a_nullable_float_array_length) : fl_value_new_null()); - fl_value_append_take(values, self->nullable_nested_list != nullptr - ? fl_value_ref(self->nullable_nested_list) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_annotations != nullptr - ? fl_value_ref(self->nullable_map_with_annotations) - : fl_value_new_null()); - fl_value_append_take(values, - self->nullable_map_with_object != nullptr - ? fl_value_ref(self->nullable_map_with_object) - : fl_value_new_null()); fl_value_append_take( values, self->a_nullable_enum != nullptr @@ -1461,8 +1458,17 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( fl_value_append_take(values, self->bool_list != nullptr ? fl_value_ref(self->bool_list) : fl_value_new_null()); + fl_value_append_take(values, self->list_list != nullptr + ? fl_value_ref(self->list_list) + : fl_value_new_null()); fl_value_append_take(values, self->map != nullptr ? fl_value_ref(self->map) : fl_value_new_null()); + fl_value_append_take(values, self->string_map != nullptr + ? fl_value_ref(self->string_map) + : fl_value_new_null()); + fl_value_append_take(values, self->int_map != nullptr + ? fl_value_ref(self->int_map) + : fl_value_new_null()); return values; } @@ -1526,88 +1532,87 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new_from_list( a_nullable_float_array_length = fl_value_get_length(value7); } FlValue* value8 = fl_value_get_list_value(values, 8); - FlValue* nullable_nested_list = nullptr; + CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; + CoreTestsPigeonTestAnEnum a_nullable_enum_value; if (fl_value_get_type(value8) != FL_VALUE_TYPE_NULL) { - nullable_nested_list = value8; + a_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value8))))); + a_nullable_enum = &a_nullable_enum_value; } FlValue* value9 = fl_value_get_list_value(values, 9); - FlValue* nullable_map_with_annotations = nullptr; + CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; + CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; if (fl_value_get_type(value9) != FL_VALUE_TYPE_NULL) { - nullable_map_with_annotations = value9; + another_nullable_enum_value = static_cast( + fl_value_get_int(reinterpret_cast( + const_cast(fl_value_get_custom_value(value9))))); + another_nullable_enum = &another_nullable_enum_value; } FlValue* value10 = fl_value_get_list_value(values, 10); - FlValue* nullable_map_with_object = nullptr; + const gchar* a_nullable_string = nullptr; if (fl_value_get_type(value10) != FL_VALUE_TYPE_NULL) { - nullable_map_with_object = value10; + a_nullable_string = fl_value_get_string(value10); } FlValue* value11 = fl_value_get_list_value(values, 11); - CoreTestsPigeonTestAnEnum* a_nullable_enum = nullptr; - CoreTestsPigeonTestAnEnum a_nullable_enum_value; + FlValue* a_nullable_object = nullptr; if (fl_value_get_type(value11) != FL_VALUE_TYPE_NULL) { - a_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value11))))); - a_nullable_enum = &a_nullable_enum_value; + a_nullable_object = value11; } FlValue* value12 = fl_value_get_list_value(values, 12); - CoreTestsPigeonTestAnotherEnum* another_nullable_enum = nullptr; - CoreTestsPigeonTestAnotherEnum another_nullable_enum_value; + FlValue* list = nullptr; if (fl_value_get_type(value12) != FL_VALUE_TYPE_NULL) { - another_nullable_enum_value = static_cast( - fl_value_get_int(reinterpret_cast( - const_cast(fl_value_get_custom_value(value12))))); - another_nullable_enum = &another_nullable_enum_value; + list = value12; } FlValue* value13 = fl_value_get_list_value(values, 13); - const gchar* a_nullable_string = nullptr; + FlValue* string_list = nullptr; if (fl_value_get_type(value13) != FL_VALUE_TYPE_NULL) { - a_nullable_string = fl_value_get_string(value13); + string_list = value13; } FlValue* value14 = fl_value_get_list_value(values, 14); - FlValue* a_nullable_object = nullptr; + FlValue* int_list = nullptr; if (fl_value_get_type(value14) != FL_VALUE_TYPE_NULL) { - a_nullable_object = value14; + int_list = value14; } FlValue* value15 = fl_value_get_list_value(values, 15); - FlValue* list = nullptr; + FlValue* double_list = nullptr; if (fl_value_get_type(value15) != FL_VALUE_TYPE_NULL) { - list = value15; + double_list = value15; } FlValue* value16 = fl_value_get_list_value(values, 16); - FlValue* string_list = nullptr; + FlValue* bool_list = nullptr; if (fl_value_get_type(value16) != FL_VALUE_TYPE_NULL) { - string_list = value16; + bool_list = value16; } FlValue* value17 = fl_value_get_list_value(values, 17); - FlValue* int_list = nullptr; + FlValue* list_list = nullptr; if (fl_value_get_type(value17) != FL_VALUE_TYPE_NULL) { - int_list = value17; + list_list = value17; } FlValue* value18 = fl_value_get_list_value(values, 18); - FlValue* double_list = nullptr; + FlValue* map = nullptr; if (fl_value_get_type(value18) != FL_VALUE_TYPE_NULL) { - double_list = value18; + map = value18; } FlValue* value19 = fl_value_get_list_value(values, 19); - FlValue* bool_list = nullptr; + FlValue* string_map = nullptr; if (fl_value_get_type(value19) != FL_VALUE_TYPE_NULL) { - bool_list = value19; + string_map = value19; } FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* map = nullptr; + FlValue* int_map = nullptr; if (fl_value_get_type(value20) != FL_VALUE_TYPE_NULL) { - map = value20; + int_map = value20; } return core_tests_pigeon_test_all_nullable_types_without_recursion_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, a_nullable_byte_array, a_nullable_byte_array_length, a_nullable4_byte_array, a_nullable4_byte_array_length, a_nullable8_byte_array, a_nullable8_byte_array_length, - a_nullable_float_array, a_nullable_float_array_length, - nullable_nested_list, nullable_map_with_annotations, - nullable_map_with_object, a_nullable_enum, another_nullable_enum, - a_nullable_string, a_nullable_object, list, string_list, int_list, - double_list, bool_list, map); + a_nullable_float_array, a_nullable_float_array_length, a_nullable_enum, + another_nullable_enum, a_nullable_string, a_nullable_object, list, + string_list, int_list, double_list, bool_list, list_list, map, string_map, + int_map); } struct _CoreTestsPigeonTestAllClassesWrapper { @@ -2987,62 +2992,61 @@ core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( - CoreTestsPigeonTestAllClassesWrapper* return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom_object(134, G_OBJECT(return_value))); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* -core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -3053,61 +3057,191 @@ core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new return self; } -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponseClass* klass) { +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_dispose; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), - nullptr)); +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_get_type(), + nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), - nullptr)); + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_dispose; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new( + CoreTestsPigeonTestAllClassesWrapper* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom_object(134, G_OBJECT(return_value))); + return self; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* +core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_CLASS_WRAPPER_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponseClass* klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_dispose; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); + return self; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ENUM_RESPONSE(g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_enum_response_get_type(), + nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); fl_value_append_take(self->value, @@ -4339,6 +4473,142 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_ return self; } +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_dispose; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self) { +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_dispose; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse { GObject parent_instance; @@ -5255,65 +5525,208 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_map_response_new_err } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, - CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE, - GObject) + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self) {} +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self) { +} static void -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* -core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE, GObject) + +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE, + GObject) + +struct _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncEnumResponse* self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_ENUM_RESPONSE( g_object_new( core_tests_pigeon_test_host_integration_core_api_echo_async_enum_response_get_type(), @@ -6446,6 +6859,156 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_respons return self; } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_ECHO_ASYNC_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableEnumResponse, core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_enum_response, @@ -7710,69 +8273,68 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_response_ } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE, GObject) -struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse { +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response, G_TYPE_OBJECT) static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose( +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_dispose( GObject* object) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( object); g_clear_pointer(&self->value, fl_value_unref); G_OBJECT_CLASS( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_parent_class) + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_parent_class) ->dispose(object); } static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self) {} static void -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_class_init( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponseClass* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponseClass* klass) { G_OBJECT_CLASS(klass)->dispose = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose; + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_dispose; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( - CoreTestsPigeonTestAnEnum return_value) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); - fl_value_append_take(self->value, - fl_value_new_custom(129, fl_value_new_int(return_value), - (GDestroyNotify)fl_value_unref)); + fl_value_append_take(self->value, fl_value_ref(return_value)); return self; } -static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* -core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new_error( const gchar* code, const gchar* message, FlValue* details) { - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = - CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_STRING_MAP_RESPONSE( g_object_new( - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_get_type(), nullptr)); self->value = fl_value_new_list(); fl_value_append_take(self->value, fl_value_new_string(code)); @@ -7784,21 +8346,167 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response } G_DECLARE_FINAL_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response, CORE_TESTS_PIGEON_TEST, - HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE, GObject) -struct - _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse { +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse { GObject parent_instance; FlValue* value; }; G_DEFINE_TYPE( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_ref(return_value)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE, GObject) + +struct _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new( + CoreTestsPigeonTestAnEnum return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, + fl_value_new_custom(129, fl_value_new_int(return_value), + (GDestroyNotify)fl_value_unref)); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoEnumResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ENUM_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_enum_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_ANOTHER_ENUM_RESPONSE, GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoAnotherEnumResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_another_enum_response, G_TYPE_OBJECT) static void @@ -8392,6 +9100,160 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_ return self; } +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse* + self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE, + GObject) + +struct + _CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse { + GObject parent_instance; + + FlValue* value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* + self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_dispose; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new( + FlValue* return_value) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, return_value != nullptr + ? fl_value_ref(return_value) + : fl_value_new_null()); + return self; +} + +static CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details) { + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API_CALL_FLUTTER_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_get_type(), + nullptr)); + self->value = fl_value_new_list(); + fl_value_append_take(self->value, fl_value_new_string(code)); + fl_value_append_take(self->value, + fl_value_new_string(message != nullptr ? message : "")); + fl_value_append_take(self->value, details != nullptr ? fl_value_ref(details) + : fl_value_new_null()); + return self; +} + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableEnumResponse, core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_enum_response, @@ -9021,9 +9883,9 @@ static void core_tests_pigeon_test_host_integration_core_api_echo_map_cb( } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; + FlValue* map = value0; g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse) response = - self->vtable->echo_map(a_map, self->user_data); + self->vtable->echo_map(map, self->user_data); if (response == nullptr) { g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", "echoMap"); @@ -9038,6 +9900,62 @@ static void core_tests_pigeon_test_host_integration_core_api_echo_map_cb( } } +static void core_tests_pigeon_test_host_integration_core_api_echo_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse) + response = self->vtable->echo_string_map(string_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoStringMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoStringMap", error->message); + } +} + +static void core_tests_pigeon_test_host_integration_core_api_echo_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse) + response = self->vtable->echo_int_map(int_map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoIntMap"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoIntMap", error->message); + } +} + static void core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_cb( FlBasicMessageChannel* channel, FlValue* message_, @@ -9639,7 +10557,66 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb( self->user_data); if (response == nullptr) { g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableObject"); + "echoNullableObject"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableObject", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_list == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* a_nullable_list = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse) + response = + self->vtable->echo_nullable_list(a_nullable_list, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableList"); + return; + } + + g_autoptr(GError) error = NULL; + if (!fl_basic_message_channel_respond(channel, response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoNullableList", error->message); + } +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_nullable_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse) + response = self->vtable->echo_nullable_map(map, self->user_data); + if (response == nullptr) { + g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", + "echoNullableMap"); return; } @@ -9647,29 +10624,31 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_object_cb( if (!fl_basic_message_channel_respond(channel, response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableObject", error->message); + "echoNullableMap", error->message); } } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_cb( FlBasicMessageChannel* channel, FlValue* message_, FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { CoreTestsPigeonTestHostIntegrationCoreApi* self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - if (self->vtable == nullptr || self->vtable->echo_nullable_list == nullptr) { + if (self->vtable == nullptr || + self->vtable->echo_nullable_string_map == nullptr) { return; } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_nullable_list = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse) + FlValue* string_map = value0; + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse) response = - self->vtable->echo_nullable_list(a_nullable_list, self->user_data); + self->vtable->echo_nullable_string_map(string_map, self->user_data); if (response == nullptr) { g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableList"); + "echoNullableStringMap"); return; } @@ -9677,29 +10656,29 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_list_cb( if (!fl_basic_message_channel_respond(channel, response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableList", error->message); + "echoNullableStringMap", error->message); } } static void -core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb( +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_cb( FlBasicMessageChannel* channel, FlValue* message_, FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { CoreTestsPigeonTestHostIntegrationCoreApi* self = CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); - if (self->vtable == nullptr || self->vtable->echo_nullable_map == nullptr) { + if (self->vtable == nullptr || + self->vtable->echo_nullable_int_map == nullptr) { return; } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_nullable_map = value0; - g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse) - response = - self->vtable->echo_nullable_map(a_nullable_map, self->user_data); + FlValue* int_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse) + response = self->vtable->echo_nullable_int_map(int_map, self->user_data); if (response == nullptr) { g_warning("No response returned to %s.%s", "HostIntegrationCoreApi", - "echoNullableMap"); + "echoNullableIntMap"); return; } @@ -9707,7 +10686,7 @@ core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb( if (!fl_basic_message_channel_respond(channel, response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "echoNullableMap", error->message); + "echoNullableIntMap", error->message); } } @@ -10015,11 +10994,50 @@ static void core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb( } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_string_map(string_map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || self->vtable->echo_async_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = core_tests_pigeon_test_host_integration_core_api_response_handle_new( channel, response_handle); - self->vtable->echo_async_map(a_map, handle, self->user_data); + self->vtable->echo_async_int_map(int_map, handle, self->user_data); } static void core_tests_pigeon_test_host_integration_core_api_echo_async_enum_cb( @@ -10356,11 +11374,52 @@ core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb( } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->echo_async_nullable_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->echo_async_nullable_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = core_tests_pigeon_test_host_integration_core_api_response_handle_new( channel, response_handle); - self->vtable->echo_async_nullable_map(a_map, handle, self->user_data); + self->vtable->echo_async_nullable_int_map(int_map, handle, self->user_data); } static void @@ -10749,11 +11808,52 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb( } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = core_tests_pigeon_test_host_integration_core_api_response_handle_new( channel, response_handle); - self->vtable->call_flutter_echo_map(a_map, handle, self->user_data); + self->vtable->call_flutter_echo_int_map(int_map, handle, self->user_data); } static void @@ -10955,11 +12055,53 @@ core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_ } FlValue* value0 = fl_value_get_list_value(message_, 0); - FlValue* a_map = value0; + FlValue* map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_map(map, handle, self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_string_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* string_map = value0; + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = + core_tests_pigeon_test_host_integration_core_api_response_handle_new( + channel, response_handle); + self->vtable->call_flutter_echo_nullable_string_map(string_map, handle, + self->user_data); +} + +static void +core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_cb( + FlBasicMessageChannel* channel, FlValue* message_, + FlBasicMessageChannelResponseHandle* response_handle, gpointer user_data) { + CoreTestsPigeonTestHostIntegrationCoreApi* self = + CORE_TESTS_PIGEON_TEST_HOST_INTEGRATION_CORE_API(user_data); + + if (self->vtable == nullptr || + self->vtable->call_flutter_echo_nullable_int_map == nullptr) { + return; + } + + FlValue* value0 = fl_value_get_list_value(message_, 0); + FlValue* int_map = value0; g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle) handle = core_tests_pigeon_test_host_integration_core_api_response_handle_new( channel, response_handle); - self->vtable->call_flutter_echo_nullable_map(a_map, handle, self->user_data); + self->vtable->call_flutter_echo_nullable_int_map(int_map, handle, + self->user_data); } static void @@ -11193,6 +12335,28 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( echo_map_channel, core_tests_pigeon_test_host_integration_core_api_echo_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_string_map_channel = + fl_basic_message_channel_new(messenger, echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_int_map_channel = + fl_basic_message_channel_new(messenger, echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoClassWrapper%s", @@ -11431,6 +12595,30 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( echo_nullable_map_channel, core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoNullableEnum%s", @@ -11578,6 +12766,29 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( echo_async_map_channel, core_tests_pigeon_test_host_integration_core_api_echo_async_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_int_map_channel = + fl_basic_message_channel_new(messenger, echo_async_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoAsyncEnum%s", @@ -11775,6 +12986,31 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( echo_async_nullable_map_channel, core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* echo_async_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoAsyncNullableEnum%s", @@ -11994,6 +13230,30 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( call_flutter_echo_map_channel, core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "callFlutterEchoEnum%s", @@ -12111,6 +13371,33 @@ void core_tests_pigeon_test_host_integration_core_api_set_method_handlers( call_flutter_echo_nullable_map_channel, core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_cb, g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_string_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_string_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_cb, + g_object_ref(api_data), g_object_unref); + g_autofree gchar* call_flutter_echo_nullable_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_int_map_channel, + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_cb, + g_object_ref(api_data), g_object_unref); g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." @@ -12277,6 +13564,24 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler(echo_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_string_map_channel = + fl_basic_message_channel_new(messenger, echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_string_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_int_map_channel = + fl_basic_message_channel_new(messenger, echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_int_map_channel, nullptr, + nullptr, nullptr); g_autofree gchar* echo_class_wrapper_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoClassWrapper%s", @@ -12477,6 +13782,26 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler(echo_nullable_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_string_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_nullable_int_map_channel, + nullptr, nullptr, nullptr); g_autofree gchar* echo_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoNullableEnum%s", @@ -12596,8 +13921,27 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( g_autoptr(FlBasicMessageChannel) echo_async_map_channel = fl_basic_message_channel_new(messenger, echo_async_map_channel_name, FL_MESSAGE_CODEC(codec)); - fl_basic_message_channel_set_message_handler(echo_async_map_channel, nullptr, - nullptr, nullptr); + fl_basic_message_channel_set_message_handler(echo_async_map_channel, nullptr, + nullptr, nullptr); + g_autofree gchar* echo_async_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_string_map_channel, + nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_int_map_channel = + fl_basic_message_channel_new(messenger, echo_async_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler(echo_async_int_map_channel, + nullptr, nullptr, nullptr); g_autofree gchar* echo_async_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoAsyncEnum%s", @@ -12765,6 +14109,27 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler(echo_async_nullable_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_string_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* echo_async_nullable_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) echo_async_nullable_int_map_channel = + fl_basic_message_channel_new(messenger, + echo_async_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + echo_async_nullable_int_map_channel, nullptr, nullptr, nullptr); g_autofree gchar* echo_async_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "echoAsyncNullableEnum%s", @@ -12953,6 +14318,26 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler(call_flutter_echo_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_string_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_string_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_int_map_channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_int_map_channel = + fl_basic_message_channel_new(messenger, + call_flutter_echo_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_int_map_channel, nullptr, nullptr, nullptr); g_autofree gchar* call_flutter_echo_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "callFlutterEchoEnum%s", @@ -13052,6 +14437,29 @@ void core_tests_pigeon_test_host_integration_core_api_clear_method_handlers( FL_MESSAGE_CODEC(codec)); fl_basic_message_channel_set_message_handler( call_flutter_echo_nullable_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_string_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) + call_flutter_echo_nullable_string_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_string_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_string_map_channel, nullptr, nullptr, nullptr); + g_autofree gchar* call_flutter_echo_nullable_int_map_channel_name = + g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap%s", + dot_suffix); + g_autoptr(FlBasicMessageChannel) call_flutter_echo_nullable_int_map_channel = + fl_basic_message_channel_new( + messenger, call_flutter_echo_nullable_int_map_channel_name, + FL_MESSAGE_CODEC(codec)); + fl_basic_message_channel_set_message_handler( + call_flutter_echo_nullable_int_map_channel, nullptr, nullptr, nullptr); g_autofree gchar* call_flutter_echo_nullable_enum_channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." @@ -13375,6 +14783,70 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_m } } +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr(CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncIntMapResponse) response = + core_tests_pigeon_test_host_integration_core_api_echo_async_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncIntMap", error->message); + } +} + void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, CoreTestsPigeonTestAnEnum return_value) { @@ -13913,6 +15385,74 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_n } } +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiEchoAsyncNullableIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_echo_async_nullable_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "echoAsyncNullableIntMap", error->message); + } +} + void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, CoreTestsPigeonTestAnEnum* return_value) { @@ -14485,6 +16025,74 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter } } +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoStringMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_string_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoStringMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoIntMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoIntMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_int_map_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoIntMap", error->message); + } +} + void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, CoreTestsPigeonTestAnEnum return_value) { @@ -14710,84 +16318,152 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details) { g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableUint8ListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableUint8List", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( + code, message, details); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableList", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) + response = + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( + return_value); + g_autoptr(GError) error = nullptr; + if (!fl_basic_message_channel_respond(response_handle->channel, + response_handle->response_handle, + response->value, &error)) { + g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", + "callFlutterEchoNullableMap", error->message); + } +} + +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details) { + g_autoptr( + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_uint8_list_response_new_error( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( code, message, details); g_autoptr(GError) error = nullptr; if (!fl_basic_message_channel_respond(response_handle->channel, response_handle->response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableUint8List", error->message); + "callFlutterEchoNullableMap", error->message); } } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_list( +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, FlValue* return_value) { g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new( return_value); g_autoptr(GError) error = nullptr; if (!fl_basic_message_channel_respond(response_handle->channel, response_handle->response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableList", error->message); + "callFlutterEchoNullableStringMap", error->message); } } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_list( +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details) { g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableListResponse) + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableStringMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_list_response_new_error( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_string_map_response_new_error( code, message, details); g_autoptr(GError) error = nullptr; if (!fl_basic_message_channel_respond(response_handle->channel, response_handle->response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableList", error->message); + "callFlutterEchoNullableStringMap", error->message); } } -void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_map( +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, FlValue* return_value) { g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new( return_value); g_autoptr(GError) error = nullptr; if (!fl_basic_message_channel_respond(response_handle->channel, response_handle->response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableMap", error->message); + "callFlutterEchoNullableIntMap", error->message); } } -void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_map( +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details) { g_autoptr( - CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableMapResponse) + CoreTestsPigeonTestHostIntegrationCoreApiCallFlutterEchoNullableIntMapResponse) response = - core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_map_response_new_error( + core_tests_pigeon_test_host_integration_core_api_call_flutter_echo_nullable_int_map_response_new_error( code, message, details); g_autoptr(GError) error = nullptr; if (!fl_basic_message_channel_respond(response_handle->channel, response_handle->response_handle, response->value, &error)) { g_warning("Failed to send response to %s.%s: %s", "HostIntegrationCoreApi", - "callFlutterEchoNullableMap", error->message); + "callFlutterEchoNullableIntMap", error->message); } } @@ -17347,11 +19023,11 @@ static void core_tests_pigeon_test_flutter_integration_core_api_echo_map_cb( } void core_tests_pigeon_test_flutter_integration_core_api_echo_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* a_map, + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); - fl_value_append_take(args, fl_value_ref(a_map)); + fl_value_append_take(args, fl_value_ref(map)); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." "echoMap%s", @@ -17380,7 +19056,330 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( if (response == nullptr) { return nullptr; } - return core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( + return core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + self)); + return self->return_value; +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(string_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoStringMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + self)); + return self->return_value; +} + +static void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, fl_value_ref(int_map)); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoIntMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_new( response); } @@ -18881,12 +20880,12 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_cb( } void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* a_map, + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data) { g_autoptr(FlValue) args = fl_value_new_list(); fl_value_append_take( - args, a_map != nullptr ? fl_value_ref(a_map) : fl_value_new_null()); + args, map != nullptr ? fl_value_ref(map) : fl_value_new_null()); g_autofree gchar* channel_name = g_strdup_printf( "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." "echoNullableMap%s", @@ -18920,6 +20919,351 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( response); } +struct + _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take(args, string_map != nullptr ? fl_value_ref(string_map) + : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableStringMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_new( + response); +} + +struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse { + GObject parent_instance; + + FlValue* error; + FlValue* return_value; +}; + +G_DEFINE_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response, + G_TYPE_OBJECT) + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_dispose( + GObject* object) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + object); + g_clear_pointer(&self->error, fl_value_unref); + g_clear_pointer(&self->return_value, fl_value_unref); + G_OBJECT_CLASS( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_parent_class) + ->dispose(object); +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) {} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_class_init( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponseClass* + klass) { + G_OBJECT_CLASS(klass)->dispose = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_dispose; +} + +static CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_new( + FlValue* response) { + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* self = + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + g_object_new( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_type(), + nullptr)); + if (fl_value_get_length(response) > 1) { + self->error = fl_value_ref(response); + } else { + FlValue* value = fl_value_get_list_value(response, 0); + self->return_value = fl_value_ref(value); + } + return self; +} + +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + self), + FALSE); + return self->error != nullptr; +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 0)); +} + +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + self)); + return fl_value_get_string(fl_value_get_list_value(self->error, 1)); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + self)); + return fl_value_get_list_value(self->error, 2); +} + +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE( + self), + nullptr); + g_assert( + !core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + self)); + if (fl_value_get_type(self->return_value) == FL_VALUE_TYPE_NULL) { + return nullptr; + } + return self->return_value; +} + +static void +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_cb( + GObject* object, GAsyncResult* result, gpointer user_data) { + GTask* task = G_TASK(user_data); + g_task_return_pointer(task, result, g_object_unref); +} + +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data) { + g_autoptr(FlValue) args = fl_value_new_list(); + fl_value_append_take( + args, int_map != nullptr ? fl_value_ref(int_map) : fl_value_new_null()); + g_autofree gchar* channel_name = g_strdup_printf( + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableIntMap%s", + self->suffix); + g_autoptr(CoreTestsPigeonTestMessageCodec) codec = + core_tests_pigeon_test_message_codec_new(); + FlBasicMessageChannel* channel = fl_basic_message_channel_new( + self->messenger, channel_name, FL_MESSAGE_CODEC(codec)); + GTask* task = g_task_new(self, cancellable, callback, user_data); + g_task_set_task_data(task, channel, g_object_unref); + fl_basic_message_channel_send( + channel, args, cancellable, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_cb, + task); +} + +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* self, GAsyncResult* result, + GError** error) { + g_autoptr(GTask) task = G_TASK(result); + GAsyncResult* r = G_ASYNC_RESULT(g_task_propagate_pointer(task, nullptr)); + FlBasicMessageChannel* channel = + FL_BASIC_MESSAGE_CHANNEL(g_task_get_task_data(task)); + g_autoptr(FlValue) response = + fl_basic_message_channel_send_finish(channel, r, error); + if (response == nullptr) { + return nullptr; + } + return core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_new( + response); +} + struct _CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse { GObject parent_instance; diff --git a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h index e6e2219c1a6..2cdddcf1ea8 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/linux/pigeon/core_tests.gen.h @@ -71,7 +71,10 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllTypes, * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. + * list_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. * * Creates a new #AllTypes object. * @@ -86,7 +89,8 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( CoreTestsPigeonTestAnEnum an_enum, CoreTestsPigeonTestAnotherEnum another_enum, const gchar* a_string, FlValue* an_object, FlValue* list, FlValue* string_list, FlValue* int_list, - FlValue* double_list, FlValue* bool_list, FlValue* map); + FlValue* double_list, FlValue* bool_list, FlValue* list_list, FlValue* map, + FlValue* string_map, FlValue* int_map); /** * core_tests_pigeon_test_all_types_get_a_bool @@ -280,6 +284,17 @@ FlValue* core_tests_pigeon_test_all_types_get_double_list( FlValue* core_tests_pigeon_test_all_types_get_bool_list( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_list_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the listList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_list_list( + CoreTestsPigeonTestAllTypes* object); + /** * core_tests_pigeon_test_all_types_get_map * @object: a #CoreTestsPigeonTestAllTypes. @@ -291,6 +306,28 @@ FlValue* core_tests_pigeon_test_all_types_get_bool_list( FlValue* core_tests_pigeon_test_all_types_get_map( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_string_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_string_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_int_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_int_map( + CoreTestsPigeonTestAllTypes* object); + /** * CoreTestsPigeonTestAllNullableTypes: * @@ -315,9 +352,6 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllNullableTypes, * a_nullable8_byte_array_length: length of @a_nullable8_byte_array. * a_nullable_float_array: field in this object. * a_nullable_float_array_length: length of @a_nullable_float_array. - * nullable_nested_list: field in this object. - * nullable_map_with_annotations: field in this object. - * nullable_map_with_object: field in this object. * a_nullable_enum: field in this object. * another_nullable_enum: field in this object. * a_nullable_string: field in this object. @@ -328,8 +362,10 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllNullableTypes, * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. - * nested_class_list: field in this object. + * list_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. * * Creates a new #AllNullableTypes object. * @@ -343,14 +379,13 @@ core_tests_pigeon_test_all_nullable_types_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* nested_class_list, FlValue* map); + FlValue* bool_list, FlValue* list_list, FlValue* map, FlValue* string_map, + FlValue* int_map); /** * core_tests_pigeon_test_all_nullable_types_get_a_nullable_bool @@ -448,40 +483,6 @@ const double* core_tests_pigeon_test_all_nullable_types_get_a_nullable_float_array( CoreTestsPigeonTestAllNullableTypes* object, size_t* length); -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableNestedList field of @object. - * - * Returns: the field value. - */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypes* object); - -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableMapWithAnnotations field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypes* object); - -/** - * core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object - * @object: a #CoreTestsPigeonTestAllNullableTypes. - * - * Gets the value of the nullableMapWithObject field of @object. - * - * Returns: the field value. - */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypes* object); - /** * core_tests_pigeon_test_all_nullable_types_get_a_nullable_enum * @object: a #CoreTestsPigeonTestAllNullableTypes. @@ -596,14 +597,14 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_bool_list( CoreTestsPigeonTestAllNullableTypes* object); /** - * core_tests_pigeon_test_all_nullable_types_get_nested_class_list + * core_tests_pigeon_test_all_nullable_types_get_list_list * @object: a #CoreTestsPigeonTestAllNullableTypes. * - * Gets the value of the nestedClassList field of @object. + * Gets the value of the listList field of @object. * * Returns: the field value. */ -FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( CoreTestsPigeonTestAllNullableTypes* object); /** @@ -617,6 +618,28 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_nested_class_list( FlValue* core_tests_pigeon_test_all_nullable_types_get_map( CoreTestsPigeonTestAllNullableTypes* object); +/** + * core_tests_pigeon_test_all_nullable_types_get_string_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_string_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_int_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_int_map( + CoreTestsPigeonTestAllNullableTypes* object); + /** * CoreTestsPigeonTestAllNullableTypesWithoutRecursion: * @@ -644,9 +667,6 @@ G_DECLARE_FINAL_TYPE( * a_nullable8_byte_array_length: length of @a_nullable8_byte_array. * a_nullable_float_array: field in this object. * a_nullable_float_array_length: length of @a_nullable_float_array. - * nullable_nested_list: field in this object. - * nullable_map_with_annotations: field in this object. - * nullable_map_with_object: field in this object. * a_nullable_enum: field in this object. * another_nullable_enum: field in this object. * a_nullable_string: field in this object. @@ -656,7 +676,10 @@ G_DECLARE_FINAL_TYPE( * int_list: field in this object. * double_list: field in this object. * bool_list: field in this object. + * list_list: field in this object. * map: field in this object. + * string_map: field in this object. + * int_map: field in this object. * * Creates a new #AllNullableTypesWithoutRecursion object. * @@ -670,13 +693,12 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const int32_t* a_nullable4_byte_array, size_t a_nullable4_byte_array_length, const int64_t* a_nullable8_byte_array, size_t a_nullable8_byte_array_length, const double* a_nullable_float_array, size_t a_nullable_float_array_length, - FlValue* nullable_nested_list, FlValue* nullable_map_with_annotations, - FlValue* nullable_map_with_object, CoreTestsPigeonTestAnEnum* a_nullable_enum, CoreTestsPigeonTestAnotherEnum* another_nullable_enum, const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, - FlValue* bool_list, FlValue* map); + FlValue* bool_list, FlValue* list_list, FlValue* map, FlValue* string_map, + FlValue* int_map); /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_bool @@ -782,42 +804,6 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_float CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object, size_t* length); -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableNestedList field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_nested_list( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableMapWithAnnotations field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_annotations( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - -/** - * core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object - * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. - * - * Gets the value of the nullableMapWithObject field of @object. - * - * Returns: the field value. - */ -FlValue* -core_tests_pigeon_test_all_nullable_types_without_recursion_get_nullable_map_with_object( - CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); - /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_enum * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. @@ -925,6 +911,18 @@ FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_bool_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the listList field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. @@ -936,6 +934,30 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_bool_list( FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the stringMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_string_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the intMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_int_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + /** * CoreTestsPigeonTestAllClassesWrapper: * @@ -1446,6 +1468,70 @@ CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* core_tests_pigeon_test_host_integration_core_api_echo_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_string_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_int_map_response, + CORE_TESTS_PIGEON_TEST, HOST_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoIntMap. + * + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoIntMap. + * + * Returns: a new #CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse, core_tests_pigeon_test_host_integration_core_api_echo_class_wrapper_response, @@ -2115,6 +2201,72 @@ CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new_error( const gchar* code, const gchar* message, FlValue* details); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableStringMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + HOST_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new: + * + * Creates a new response to HostIntegrationCoreApi.echoNullableIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error: + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Creates a new error response to HostIntegrationCoreApi.echoNullableIntMap. + * + * Returns: a new + * #CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse + */ +CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new_error( + const gchar* code, const gchar* message, FlValue* details); + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse, core_tests_pigeon_test_host_integration_core_api_echo_nullable_enum_response, @@ -2284,7 +2436,11 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse* (*echo_list)( FlValue* list, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* (*echo_map)( - FlValue* a_map, gpointer user_data); + FlValue* map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* ( + *echo_string_map)(FlValue* string_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* (*echo_int_map)( + FlValue* int_map, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* ( *echo_class_wrapper)(CoreTestsPigeonTestAllClassesWrapper* wrapper, gpointer user_data); @@ -2339,7 +2495,11 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableListResponse* ( *echo_nullable_list)(FlValue* a_nullable_list, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* ( - *echo_nullable_map)(FlValue* a_nullable_map, gpointer user_data); + *echo_nullable_map)(FlValue* map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* ( + *echo_nullable_string_map)(FlValue* string_map, gpointer user_data); + CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* ( + *echo_nullable_int_map)(FlValue* int_map, gpointer user_data); CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* ( *echo_nullable_enum)(CoreTestsPigeonTestAnEnum* an_enum, gpointer user_data); @@ -2383,7 +2543,15 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_int_map)( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_enum)( @@ -2444,7 +2612,15 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_nullable_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*echo_async_nullable_int_map)( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*echo_async_nullable_enum)( @@ -2511,7 +2687,15 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_int_map)( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_enum)( @@ -2547,7 +2731,15 @@ typedef struct { CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_nullable_map)( - FlValue* a_map, + FlValue* map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_string_map)( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data); + void (*call_flutter_echo_nullable_int_map)( + FlValue* int_map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data); void (*call_flutter_echo_nullable_enum)( @@ -2808,6 +3000,54 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_m CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details); +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + /** * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_enum: * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. @@ -3196,24 +3436,72 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_n const gchar* code, const gchar* message, FlValue* details); /** - * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum: + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map: * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. * @return_value: location to write the value returned by this method. * - * Responds to HostIntegrationCoreApi.echoAsyncNullableEnum. + * Responds to HostIntegrationCoreApi.echoAsyncNullableStringMap. */ -void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, - CoreTestsPigeonTestAnEnum* return_value); + FlValue* return_value); /** - * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum: + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map: * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. * @code: error code. * @message: error message. * @details: (allow-none): error details or %NULL. * - * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnum. + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.echoAsyncNullableEnum. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_enum( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + CoreTestsPigeonTestAnEnum* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.echoAsyncNullableEnum. */ void core_tests_pigeon_test_host_integration_core_api_respond_error_echo_async_nullable_enum( CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, @@ -3609,6 +3897,54 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details); +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to HostIntegrationCoreApi.callFlutterEchoIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + /** * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_enum: * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. @@ -3830,6 +4166,56 @@ void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, const gchar* code, const gchar* message, FlValue* details); +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableStringMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @return_value: location to write the value returned by this method. + * + * Responds to HostIntegrationCoreApi.callFlutterEchoNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + FlValue* return_value); + +/** + * core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map: + * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. + * @code: error code. + * @message: error message. + * @details: (allow-none): error details or %NULL. + * + * Responds with an error to + * HostIntegrationCoreApi.callFlutterEchoNullableIntMap. + */ +void core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + const gchar* code, const gchar* message, FlValue* details); + /** * core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_enum: * @response_handle: a #CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle. @@ -4942,6 +5328,148 @@ FlValue* core_tests_pigeon_test_flutter_integration_core_api_echo_map_response_get_return_value( CoreTestsPigeonTestFlutterIntegrationCoreApiEchoMapResponse* response); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_STRING_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoStringMap is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response, + CORE_TESTS_PIGEON_TEST, FLUTTER_INTEGRATION_CORE_API_ECHO_INT_MAP_RESPONSE, + GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoIntMap is an error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value: + * @response: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse. + * + * Get the return value for this response. + * + * Returns: a return value. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* response); + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestFlutterIntegrationCoreApiEchoEnumResponse, core_tests_pigeon_test_flutter_integration_core_api_echo_enum_response, @@ -5627,6 +6155,160 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_response_g CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableMapResponse* response); +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_STRING_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoNullableStringMap is an + * error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* + response); + +G_DECLARE_FINAL_TYPE( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response, + CORE_TESTS_PIGEON_TEST, + FLUTTER_INTEGRATION_CORE_API_ECHO_NULLABLE_INT_MAP_RESPONSE, GObject) + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. + * + * Checks if a response to FlutterIntegrationCoreApi.echoNullableIntMap is an + * error. + * + * Returns: a %TRUE if this response is an error. + */ +gboolean +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. + * + * Get the error code for this response. + * + * Returns: an error code or %NULL if not an error. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. + * + * Get the error message for this response. + * + * Returns: an error message. + */ +const gchar* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. + * + * Get the error details for this response. + * + * Returns: (allow-none): an error details or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value: + * @response: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse. + * + * Get the return value for this response. + * + * Returns: (allow-none): a return value or %NULL. + */ +FlValue* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* + response); + G_DECLARE_FINAL_TYPE( CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableEnumResponse, core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum_response, @@ -6435,7 +7117,7 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( /** * core_tests_pigeon_test_flutter_integration_core_api_echo_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_map: parameter for this method. + * @map: parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. @@ -6444,7 +7126,7 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_list_finish( * Returns the passed map, to test serialization and deserialization. */ void core_tests_pigeon_test_flutter_integration_core_api_echo_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* a_map, + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -6466,6 +7148,74 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @string_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. + * + * Returns the passed map, to test serialization and deserialization. + */ +void core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. + * + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_string_map() call. + * + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse + * or %NULL on error. + */ +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @int_map: parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. + * + * Returns the passed map, to test serialization and deserialization. + */ +void core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. + * + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_int_map() call. + * + * Returns: a #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse or + * %NULL on error. + */ +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); + /** * core_tests_pigeon_test_flutter_integration_core_api_echo_enum: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. @@ -6754,7 +7504,7 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( /** * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. - * @a_map: (allow-none): parameter for this method. + * @map: (allow-none): parameter for this method. * @cancellable: (allow-none): a #GCancellable or %NULL. * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when * the call is complete or %NULL to ignore the response. @@ -6763,7 +7513,7 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_list_finish( * Returns the passed map, to test serialization and deserialization. */ void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* a_map, + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* map, GCancellable* cancellable, GAsyncReadyCallback callback, gpointer user_data); @@ -6786,6 +7536,78 @@ core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map_finish( CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, GError** error); +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @string_map: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. + * + * Returns the passed map, to test serialization and deserialization. + */ +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* string_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. + * + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map() + * call. + * + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse or + * %NULL on error. + */ +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @int_map: (allow-none): parameter for this method. + * @cancellable: (allow-none): a #GCancellable or %NULL. + * @callback: (scope async): (allow-none): a #GAsyncReadyCallback to call when + * the call is complete or %NULL to ignore the response. + * @user_data: (closure): user data to pass to @callback. + * + * Returns the passed map, to test serialization and deserialization. + */ +void core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, FlValue* int_map, + GCancellable* cancellable, GAsyncReadyCallback callback, + gpointer user_data); + +/** + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish: + * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. + * @result: a #GAsyncResult. + * @error: (allow-none): #GError location to store the error occurring, or %NULL + * to ignore. + * + * Completes a + * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map() + * call. + * + * Returns: a + * #CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse or + * %NULL on error. + */ +CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse* +core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( + CoreTestsPigeonTestFlutterIntegrationCoreApi* api, GAsyncResult* result, + GError** error); + /** * core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_enum: * @api: a #CoreTestsPigeonTestFlutterIntegrationCoreApi. diff --git a/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc b/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc index 3c4689442dc..1ed782f11dc 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc @@ -126,9 +126,21 @@ static CoreTestsPigeonTestHostIntegrationCoreApiEchoListResponse* echo_list( } static CoreTestsPigeonTestHostIntegrationCoreApiEchoMapResponse* echo_map( - FlValue* a_map, gpointer user_data) { + FlValue* map, gpointer user_data) { return core_tests_pigeon_test_host_integration_core_api_echo_map_response_new( - a_map); + map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoStringMapResponse* +echo_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoIntMapResponse* +echo_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_int_map_response_new( + int_map); } static CoreTestsPigeonTestHostIntegrationCoreApiEchoClassWrapperResponse* @@ -203,9 +215,9 @@ create_nested_nullable_string(const gchar* nullable_string, g_autoptr(CoreTestsPigeonTestAllNullableTypes) types = core_tests_pigeon_test_all_nullable_types_new( nullptr, nullptr, nullptr, nullptr, nullptr, 0, nullptr, 0, nullptr, - 0, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr, - nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr); + 0, nullptr, 0, nullptr, nullptr, nullable_string, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr); g_autoptr(CoreTestsPigeonTestAllClassesWrapper) wrapper = core_tests_pigeon_test_all_classes_wrapper_new(types, nullptr, nullptr); return core_tests_pigeon_test_host_integration_core_api_create_nested_nullable_string_response_new( @@ -219,8 +231,8 @@ send_multiple_nullable_types(gboolean* a_nullable_bool, int64_t* a_nullable_int, g_autoptr(CoreTestsPigeonTestAllNullableTypes) types = core_tests_pigeon_test_all_nullable_types_new( a_nullable_bool, a_nullable_int, nullptr, nullptr, nullptr, 0, - nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, nullptr, - nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, + nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, + a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr); return core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_response_new( types); @@ -234,9 +246,9 @@ send_multiple_nullable_types_without_recursion(gboolean* a_nullable_bool, g_autoptr(CoreTestsPigeonTestAllNullableTypesWithoutRecursion) types = core_tests_pigeon_test_all_nullable_types_without_recursion_new( a_nullable_bool, a_nullable_int, nullptr, nullptr, nullptr, 0, - nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, nullptr, - nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, - nullptr, nullptr, nullptr, nullptr); + nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, + a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, + nullptr, nullptr, nullptr, nullptr, nullptr); return core_tests_pigeon_test_host_integration_core_api_send_multiple_nullable_types_without_recursion_response_new( types); } @@ -286,9 +298,21 @@ echo_nullable_list(FlValue* a_nullable_list, gpointer user_data) { } static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableMapResponse* -echo_nullable_map(FlValue* a_nullable_map, gpointer user_data) { +echo_nullable_map(FlValue* map, gpointer user_data) { return core_tests_pigeon_test_host_integration_core_api_echo_nullable_map_response_new( - a_nullable_map); + map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableStringMapResponse* +echo_nullable_string_map(FlValue* string_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_string_map_response_new( + string_map); +} + +static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableIntMapResponse* +echo_nullable_int_map(FlValue* int_map, gpointer user_data) { + return core_tests_pigeon_test_host_integration_core_api_echo_nullable_int_map_response_new( + int_map); } static CoreTestsPigeonTestHostIntegrationCoreApiEchoNullableEnumResponse* @@ -381,11 +405,27 @@ static void echo_async_list( } static void echo_async_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { core_tests_pigeon_test_host_integration_core_api_respond_echo_async_map( - response_handle, a_map); + response_handle, map); +} + +static void echo_async_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_string_map( + response_handle, string_map); +} + +static void echo_async_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_int_map( + response_handle, int_map); } static void echo_async_enum( @@ -517,11 +557,27 @@ static void echo_async_nullable_list( } static void echo_async_nullable_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_map( - response_handle, a_map); + response_handle, map); +} + +static void echo_async_nullable_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_string_map( + response_handle, string_map); +} + +static void echo_async_nullable_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + core_tests_pigeon_test_host_integration_core_api_respond_echo_async_nullable_int_map( + response_handle, int_map); } static void echo_async_nullable_enum( @@ -1219,13 +1275,103 @@ static void echo_map_cb(GObject* object, GAsyncResult* result, } static void call_flutter_echo_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); core_tests_pigeon_test_flutter_integration_core_api_echo_map( - self->flutter_core_api, a_map, self->cancellable, echo_map_cb, + self->flutter_core_api, map, self->cancellable, echo_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_string_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoStringMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_string_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_string_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_string_map( + self->flutter_core_api, string_map, self->cancellable, echo_string_map_cb, + callback_data_new(self, response_handle)); +} + +static void echo_int_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoIntMapResponse) response = + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), result, + &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_int_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_int_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_int_map( + self->flutter_core_api, int_map, self->cancellable, echo_int_map_cb, callback_data_new(self, response_handle)); } @@ -1633,16 +1779,108 @@ static void echo_nullable_map_cb(GObject* object, GAsyncResult* result, } static void call_flutter_echo_nullable_map( - FlValue* a_map, + FlValue* map, CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, gpointer user_data) { TestPlugin* self = TEST_PLUGIN(user_data); core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_map( - self->flutter_core_api, a_map, self->cancellable, echo_nullable_map_cb, + self->flutter_core_api, map, self->cancellable, echo_nullable_map_cb, callback_data_new(self, response_handle)); } +static void echo_nullable_string_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableStringMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_string_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_string_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_string_map( + FlValue* string_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_string_map( + self->flutter_core_api, string_map, self->cancellable, + echo_nullable_string_map_cb, callback_data_new(self, response_handle)); +} + +static void echo_nullable_int_map_cb(GObject* object, GAsyncResult* result, + gpointer user_data) { + g_autoptr(CallbackData) data = static_cast(user_data); + + g_autoptr(GError) error = nullptr; + g_autoptr( + CoreTestsPigeonTestFlutterIntegrationCoreApiEchoNullableIntMapResponse) + response = + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_finish( + CORE_TESTS_PIGEON_TEST_FLUTTER_INTEGRATION_CORE_API(object), + result, &error); + if (response == nullptr) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_nullable_int_map( + data->response_handle, "Internal Error", error->message, nullptr); + return; + } + if (core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_is_error( + response)) { + core_tests_pigeon_test_host_integration_core_api_respond_error_call_flutter_echo_bool( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_code( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_message( + response), + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_error_details( + response)); + return; + } + + core_tests_pigeon_test_host_integration_core_api_respond_call_flutter_echo_nullable_int_map( + data->response_handle, + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map_response_get_return_value( + response)); +} + +static void call_flutter_echo_nullable_int_map( + FlValue* int_map, + CoreTestsPigeonTestHostIntegrationCoreApiResponseHandle* response_handle, + gpointer user_data) { + TestPlugin* self = TEST_PLUGIN(user_data); + + core_tests_pigeon_test_flutter_integration_core_api_echo_nullable_int_map( + self->flutter_core_api, int_map, self->cancellable, + echo_nullable_int_map_cb, callback_data_new(self, response_handle)); +} + static void echo_nullable_enum_cb(GObject* object, GAsyncResult* result, gpointer user_data) { g_autoptr(CallbackData) data = static_cast(user_data); @@ -1828,6 +2066,8 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_object = echo_object, .echo_list = echo_list, .echo_map = echo_map, + .echo_string_map = echo_string_map, + .echo_int_map = echo_int_map, .echo_class_wrapper = echo_class_wrapper, .echo_enum = echo_enum, .echo_another_enum = echo_another_enum, @@ -1850,6 +2090,8 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_nullable_object = echo_nullable_object, .echo_nullable_list = echo_nullable_list, .echo_nullable_map = echo_nullable_map, + .echo_nullable_string_map = echo_nullable_string_map, + .echo_nullable_int_map = echo_nullable_int_map, .echo_nullable_enum = echo_nullable_enum, .echo_another_nullable_enum = echo_another_nullable_enum, .echo_optional_nullable_int = echo_optional_nullable_int, @@ -1863,6 +2105,8 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_async_object = echo_async_object, .echo_async_list = echo_async_list, .echo_async_map = echo_async_map, + .echo_async_string_map = echo_async_string_map, + .echo_async_int_map = echo_async_int_map, .echo_async_enum = echo_async_enum, .echo_another_async_enum = echo_another_async_enum, .throw_async_error = throw_async_error, @@ -1881,6 +2125,8 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .echo_async_nullable_object = echo_async_nullable_object, .echo_async_nullable_list = echo_async_nullable_list, .echo_async_nullable_map = echo_async_nullable_map, + .echo_async_nullable_string_map = echo_async_nullable_string_map, + .echo_async_nullable_int_map = echo_async_nullable_int_map, .echo_async_nullable_enum = echo_async_nullable_enum, .echo_another_async_nullable_enum = echo_another_async_nullable_enum, .call_flutter_noop = call_flutter_noop, @@ -1902,6 +2148,8 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { .call_flutter_echo_uint8_list = call_flutter_echo_uint8_list, .call_flutter_echo_list = call_flutter_echo_list, .call_flutter_echo_map = call_flutter_echo_map, + .call_flutter_echo_string_map = call_flutter_echo_string_map, + .call_flutter_echo_int_map = call_flutter_echo_int_map, .call_flutter_echo_enum = call_flutter_echo_enum, .call_flutter_echo_another_enum = call_flutter_echo_another_enum, .call_flutter_echo_nullable_bool = call_flutter_echo_nullable_bool, @@ -1912,6 +2160,9 @@ static CoreTestsPigeonTestHostIntegrationCoreApiVTable host_core_api_vtable = { call_flutter_echo_nullable_uint8_list, .call_flutter_echo_nullable_list = call_flutter_echo_nullable_list, .call_flutter_echo_nullable_map = call_flutter_echo_nullable_map, + .call_flutter_echo_nullable_string_map = + call_flutter_echo_nullable_string_map, + .call_flutter_echo_nullable_int_map = call_flutter_echo_nullable_int_map, .call_flutter_echo_nullable_enum = call_flutter_echo_nullable_enum, .call_flutter_echo_another_nullable_enum = call_flutter_echo_another_nullable_enum, diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift index 00fd797edce..078d0c688ee 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/CoreTests.gen.swift @@ -107,7 +107,10 @@ struct AllTypes { var intList: [Int64?] var doubleList: [Double?] var boolList: [Bool?] - var map: [AnyHashable: Any?] + var listList: [[Any?]?] + var map: [AnyHashable?: Any?] + var stringMap: [String?: String?] + var intMap: [Int64?: Int64?] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { @@ -130,7 +133,10 @@ struct AllTypes { let intList = pigeonVar_list[14] as! [Int64?] let doubleList = pigeonVar_list[15] as! [Double?] let boolList = pigeonVar_list[16] as! [Bool?] - let map = pigeonVar_list[17] as! [AnyHashable: Any?] + let listList = pigeonVar_list[17] as! [[Any?]?] + let map = pigeonVar_list[18] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[19] as! [String?: String?] + let intMap = pigeonVar_list[20] as! [Int64?: Int64?] return AllTypes( aBool: aBool, @@ -150,7 +156,10 @@ struct AllTypes { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -172,7 +181,10 @@ struct AllTypes { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ] } } @@ -190,9 +202,6 @@ class AllNullableTypes { aNullable4ByteArray: FlutterStandardTypedData? = nil, aNullable8ByteArray: FlutterStandardTypedData? = nil, aNullableFloatArray: FlutterStandardTypedData? = nil, - nullableNestedList: [[Bool?]?]? = nil, - nullableMapWithAnnotations: [String?: String?]? = nil, - nullableMapWithObject: [String?: Any?]? = nil, aNullableEnum: AnEnum? = nil, anotherNullableEnum: AnotherEnum? = nil, aNullableString: String? = nil, @@ -203,8 +212,10 @@ class AllNullableTypes { intList: [Int64?]? = nil, doubleList: [Double?]? = nil, boolList: [Bool?]? = nil, - nestedClassList: [AllNullableTypes?]? = nil, - map: [AnyHashable: Any?]? = nil + listList: [[Any?]?]? = nil, + map: [AnyHashable?: Any?]? = nil, + stringMap: [String?: String?]? = nil, + intMap: [Int64?: Int64?]? = nil ) { self.aNullableBool = aNullableBool self.aNullableInt = aNullableInt @@ -214,9 +225,6 @@ class AllNullableTypes { self.aNullable4ByteArray = aNullable4ByteArray self.aNullable8ByteArray = aNullable8ByteArray self.aNullableFloatArray = aNullableFloatArray - self.nullableNestedList = nullableNestedList - self.nullableMapWithAnnotations = nullableMapWithAnnotations - self.nullableMapWithObject = nullableMapWithObject self.aNullableEnum = aNullableEnum self.anotherNullableEnum = anotherNullableEnum self.aNullableString = aNullableString @@ -227,8 +235,10 @@ class AllNullableTypes { self.intList = intList self.doubleList = doubleList self.boolList = boolList - self.nestedClassList = nestedClassList + self.listList = listList self.map = map + self.stringMap = stringMap + self.intMap = intMap } var aNullableBool: Bool? var aNullableInt: Int64? @@ -238,9 +248,6 @@ class AllNullableTypes { var aNullable4ByteArray: FlutterStandardTypedData? var aNullable8ByteArray: FlutterStandardTypedData? var aNullableFloatArray: FlutterStandardTypedData? - var nullableNestedList: [[Bool?]?]? - var nullableMapWithAnnotations: [String?: String?]? - var nullableMapWithObject: [String?: Any?]? var aNullableEnum: AnEnum? var anotherNullableEnum: AnotherEnum? var aNullableString: String? @@ -251,8 +258,10 @@ class AllNullableTypes { var intList: [Int64?]? var doubleList: [Double?]? var boolList: [Bool?]? - var nestedClassList: [AllNullableTypes?]? - var map: [AnyHashable: Any?]? + var listList: [[Any?]?]? + var map: [AnyHashable?: Any?]? + var stringMap: [String?: String?]? + var intMap: [Int64?: Int64?]? // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypes? { @@ -272,21 +281,20 @@ class AllNullableTypes { let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[15]) - let list: [Any?]? = nilOrValue(pigeonVar_list[16]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[17]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[18]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[19]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[20]) - let nestedClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[22]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let allNullableTypes: AllNullableTypes? = nilOrValue(pigeonVar_list[12]) + let list: [Any?]? = nilOrValue(pigeonVar_list[13]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[14]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[15]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[16]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[17]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[18]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[19]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[20]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[21]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -297,9 +305,6 @@ class AllNullableTypes { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -310,8 +315,10 @@ class AllNullableTypes { intList: intList, doubleList: doubleList, boolList: boolList, - nestedClassList: nestedClassList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -324,9 +331,6 @@ class AllNullableTypes { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -337,8 +341,10 @@ class AllNullableTypes { intList, doubleList, boolList, - nestedClassList, + listList, map, + stringMap, + intMap, ] } } @@ -357,9 +363,6 @@ struct AllNullableTypesWithoutRecursion { var aNullable4ByteArray: FlutterStandardTypedData? = nil var aNullable8ByteArray: FlutterStandardTypedData? = nil var aNullableFloatArray: FlutterStandardTypedData? = nil - var nullableNestedList: [[Bool?]?]? = nil - var nullableMapWithAnnotations: [String?: String?]? = nil - var nullableMapWithObject: [String?: Any?]? = nil var aNullableEnum: AnEnum? = nil var anotherNullableEnum: AnotherEnum? = nil var aNullableString: String? = nil @@ -369,7 +372,10 @@ struct AllNullableTypesWithoutRecursion { var intList: [Int64?]? = nil var doubleList: [Double?]? = nil var boolList: [Bool?]? = nil - var map: [AnyHashable: Any?]? = nil + var listList: [[Any?]?]? = nil + var map: [AnyHashable?: Any?]? = nil + var stringMap: [String?: String?]? = nil + var intMap: [Int64?: Int64?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { @@ -389,19 +395,19 @@ struct AllNullableTypesWithoutRecursion { let aNullable4ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[5]) let aNullable8ByteArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[6]) let aNullableFloatArray: FlutterStandardTypedData? = nilOrValue(pigeonVar_list[7]) - let nullableNestedList: [[Bool?]?]? = nilOrValue(pigeonVar_list[8]) - let nullableMapWithAnnotations: [String?: String?]? = nilOrValue(pigeonVar_list[9]) - let nullableMapWithObject: [String?: Any?]? = nilOrValue(pigeonVar_list[10]) - let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[11]) - let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[12]) - let aNullableString: String? = nilOrValue(pigeonVar_list[13]) - let aNullableObject: Any? = pigeonVar_list[14] - let list: [Any?]? = nilOrValue(pigeonVar_list[15]) - let stringList: [String?]? = nilOrValue(pigeonVar_list[16]) - let intList: [Int64?]? = nilOrValue(pigeonVar_list[17]) - let doubleList: [Double?]? = nilOrValue(pigeonVar_list[18]) - let boolList: [Bool?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable: Any?]? = nilOrValue(pigeonVar_list[20]) + let aNullableEnum: AnEnum? = nilOrValue(pigeonVar_list[8]) + let anotherNullableEnum: AnotherEnum? = nilOrValue(pigeonVar_list[9]) + let aNullableString: String? = nilOrValue(pigeonVar_list[10]) + let aNullableObject: Any? = pigeonVar_list[11] + let list: [Any?]? = nilOrValue(pigeonVar_list[12]) + let stringList: [String?]? = nilOrValue(pigeonVar_list[13]) + let intList: [Int64?]? = nilOrValue(pigeonVar_list[14]) + let doubleList: [Double?]? = nilOrValue(pigeonVar_list[15]) + let boolList: [Bool?]? = nilOrValue(pigeonVar_list[16]) + let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[17]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[18]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[19]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[20]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -412,9 +418,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray: aNullable4ByteArray, aNullable8ByteArray: aNullable8ByteArray, aNullableFloatArray: aNullableFloatArray, - nullableNestedList: nullableNestedList, - nullableMapWithAnnotations: nullableMapWithAnnotations, - nullableMapWithObject: nullableMapWithObject, aNullableEnum: aNullableEnum, anotherNullableEnum: anotherNullableEnum, aNullableString: aNullableString, @@ -424,7 +427,10 @@ struct AllNullableTypesWithoutRecursion { intList: intList, doubleList: doubleList, boolList: boolList, - map: map + listList: listList, + map: map, + stringMap: stringMap, + intMap: intMap ) } func toList() -> [Any?] { @@ -437,9 +443,6 @@ struct AllNullableTypesWithoutRecursion { aNullable4ByteArray, aNullable8ByteArray, aNullableFloatArray, - nullableNestedList, - nullableMapWithAnnotations, - nullableMapWithObject, aNullableEnum, anotherNullableEnum, aNullableString, @@ -449,7 +452,10 @@ struct AllNullableTypesWithoutRecursion { intList, doubleList, boolList, + listList, map, + stringMap, + intMap, ] } } @@ -614,8 +620,12 @@ protocol HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. func echo(_ list: [Any?]) throws -> [Any?] /// Returns the passed map, to test serialization and deserialization. - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] - /// Returns the passed map to test nested class serialization and deserialization. + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] + /// Returns the passed map, to test serialization and deserialization. + func echo(stringMap: [String?: String?]) throws -> [String?: String?] + /// Returns the passed map, to test serialization and deserialization. + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] + /// Returns the passed class to test nested class serialization and deserialization. func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnum: AnEnum) throws -> AnEnum @@ -661,7 +671,11 @@ protocol HostIntegrationCoreApi { /// Returns the passed list, to test serialization and deserialization. func echoNullable(_ aNullableList: [Any?]?) throws -> [Any?]? /// Returns the passed map, to test serialization and deserialization. - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? + /// Returns the passed map, to test serialization and deserialization. + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? func echoNullable(_ anotherEnum: AnotherEnum?) throws -> AnotherEnum? /// Returns passed in int. @@ -689,7 +703,15 @@ protocol HostIntegrationCoreApi { func echoAsync(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -729,7 +751,15 @@ protocol HostIntegrationCoreApi { func echoAsyncNullable(_ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) /// Returns the passed map, to test asynchronous serialization and deserialization. func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + /// Returns the passed map, to test asynchronous serialization and deserialization. + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) /// Returns the passed enum, to test asynchronous serialization and deserialization. @@ -761,7 +791,13 @@ protocol HostIntegrationCoreApi { completion: @escaping (Result) -> Void) func callFlutterEcho(_ list: [Any?], completion: @escaping (Result<[Any?], Error>) -> Void) func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void) + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void) func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) func callFlutterEcho( _ anotherEnum: AnotherEnum, completion: @escaping (Result) -> Void) @@ -778,7 +814,13 @@ protocol HostIntegrationCoreApi { func callFlutterEchoNullable( _ list: [Any?]?, completion: @escaping (Result<[Any?]?, Error>) -> Void) func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void) + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void) + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void) + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void) func callFlutterEchoNullable( _ anEnum: AnEnum?, completion: @escaping (Result) -> Void) func callFlutterEchoNullable( @@ -1025,9 +1067,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] + let mapArg = args[0] as! [AnyHashable?: Any?] do { - let result = try api.echo(aMapArg) + let result = try api.echo(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1036,7 +1078,45 @@ class HostIntegrationCoreApiSetup { } else { echoMapChannel.setMessageHandler(nil) } - /// Returns the passed map to test nested class serialization and deserialization. + /// Returns the passed map, to test serialization and deserialization. + let echoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + do { + let result = try api.echo(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + do { + let result = try api.echo(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoIntMapChannel.setMessageHandler(nil) + } + /// Returns the passed class to test nested class serialization and deserialization. let echoClassWrapperChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoClassWrapper\(channelSuffix)", @@ -1419,9 +1499,9 @@ class HostIntegrationCoreApiSetup { if let api = api { echoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aNullableMapArg: [String?: Any?]? = nilOrValue(args[0]) + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) do { - let result = try api.echoNullable(aNullableMapArg) + let result = try api.echoNullable(mapArg) reply(wrapResult(result)) } catch { reply(wrapError(error)) @@ -1430,6 +1510,44 @@ class HostIntegrationCoreApiSetup { } else { echoNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(stringMap: stringMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test serialization and deserialization. + let echoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + do { + let result = try api.echoNullable(intMap: intMapArg) + reply(wrapResult(result)) + } catch { + reply(wrapError(error)) + } + } + } else { + echoNullableIntMapChannel.setMessageHandler(nil) + } let echoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoNullableEnum\(channelSuffix)", @@ -1681,8 +1799,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.echoAsync(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.echoAsync(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -1694,6 +1812,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.echoAsync(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.echoAsync(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncIntMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncEnumChannel = FlutterBasicMessageChannel( name: @@ -2013,8 +2173,8 @@ class HostIntegrationCoreApiSetup { if let api = api { echoAsyncNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.echoAsyncNullable(aMapArg) { result in + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.echoAsyncNullable(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2026,6 +2186,48 @@ class HostIntegrationCoreApiSetup { } else { echoAsyncNullableMapChannel.setMessageHandler(nil) } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.echoAsyncNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableStringMapChannel.setMessageHandler(nil) + } + /// Returns the passed map, to test asynchronous serialization and deserialization. + let echoAsyncNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.echoAsyncNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + echoAsyncNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.echoAsyncNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + echoAsyncNullableIntMapChannel.setMessageHandler(nil) + } /// Returns the passed enum, to test asynchronous serialization and deserialization. let echoAsyncNullableEnumChannel = FlutterBasicMessageChannel( name: @@ -2362,8 +2564,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg = args[0] as! [String?: Any?] - api.callFlutterEcho(aMapArg) { result in + let mapArg = args[0] as! [AnyHashable?: Any?] + api.callFlutterEcho(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2375,6 +2577,46 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoMapChannel.setMessageHandler(nil) } + let callFlutterEchoStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg = args[0] as! [String?: String?] + api.callFlutterEcho(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg = args[0] as! [Int64?: Int64?] + api.callFlutterEcho(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoIntMapChannel.setMessageHandler(nil) + } let callFlutterEchoEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoEnum\(channelSuffix)", @@ -2544,8 +2786,8 @@ class HostIntegrationCoreApiSetup { if let api = api { callFlutterEchoNullableMapChannel.setMessageHandler { message, reply in let args = message as! [Any?] - let aMapArg: [String?: Any?]? = nilOrValue(args[0]) - api.callFlutterEchoNullable(aMapArg) { result in + let mapArg: [AnyHashable?: Any?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(mapArg) { result in switch result { case .success(let res): reply(wrapResult(res)) @@ -2557,6 +2799,46 @@ class HostIntegrationCoreApiSetup { } else { callFlutterEchoNullableMapChannel.setMessageHandler(nil) } + let callFlutterEchoNullableStringMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableStringMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableStringMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let stringMapArg: [String?: String?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(stringMap: stringMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableStringMapChannel.setMessageHandler(nil) + } + let callFlutterEchoNullableIntMapChannel = FlutterBasicMessageChannel( + name: + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableIntMap\(channelSuffix)", + binaryMessenger: binaryMessenger, codec: codec) + if let api = api { + callFlutterEchoNullableIntMapChannel.setMessageHandler { message, reply in + let args = message as! [Any?] + let intMapArg: [Int64?: Int64?]? = nilOrValue(args[0]) + api.callFlutterEchoNullable(intMap: intMapArg) { result in + switch result { + case .success(let res): + reply(wrapResult(res)) + case .failure(let error): + reply(wrapError(error)) + } + } + } + } else { + callFlutterEchoNullableIntMapChannel.setMessageHandler(nil) + } let callFlutterEchoNullableEnumChannel = FlutterBasicMessageChannel( name: "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi.callFlutterEchoNullableEnum\(channelSuffix)", @@ -2672,8 +2954,16 @@ protocol FlutterIntegrationCoreApiProtocol { func echo(_ listArg: [Any?], completion: @escaping (Result<[Any?], PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void - ) + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echo(_ anEnumArg: AnEnum, completion: @escaping (Result) -> Void) /// Returns the passed enum to test serialization and deserialization. @@ -2698,8 +2988,16 @@ protocol FlutterIntegrationCoreApiProtocol { _ listArg: [Any?]?, completion: @escaping (Result<[Any?]?, PigeonError>) -> Void) /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void) + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void) + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void) /// Returns the passed enum to test serialization and deserialization. func echoNullable( _ anEnumArg: AnEnum?, completion: @escaping (Result) -> Void) @@ -3112,13 +3410,76 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed map, to test serialization and deserialization. func echo( - _ aMapArg: [String?: Any?], completion: @escaping (Result<[String?: Any?], PigeonError>) -> Void + _ mapArg: [AnyHashable?: Any?], + completion: @escaping (Result<[AnyHashable?: Any?], PigeonError>) -> Void ) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [AnyHashable?: Any?] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echo( + stringMap stringMapArg: [String?: String?], + completion: @escaping (Result<[String?: String?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else if listResponse[0] == nil { + completion( + .failure( + PigeonError( + code: "null-error", + message: "Flutter api returned null value for non-null return value.", details: ""))) + } else { + let result = listResponse[0] as! [String?: String?] + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echo( + intMap intMapArg: [Int64?: Int64?], + completion: @escaping (Result<[Int64?: Int64?], PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3135,7 +3496,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { code: "null-error", message: "Flutter api returned null value for non-null return value.", details: ""))) } else { - let result = listResponse[0] as! [String?: Any?] + let result = listResponse[0] as! [Int64?: Int64?] completion(.success(result)) } } @@ -3346,14 +3707,64 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { } /// Returns the passed map, to test serialization and deserialization. func echoNullable( - _ aMapArg: [String?: Any?]?, - completion: @escaping (Result<[String?: Any?]?, PigeonError>) -> Void + _ mapArg: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, PigeonError>) -> Void ) { let channelName: String = "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableMap\(messageChannelSuffix)" let channel = FlutterBasicMessageChannel( name: channelName, binaryMessenger: binaryMessenger, codec: codec) - channel.sendMessage([aMapArg] as [Any?]) { response in + channel.sendMessage([mapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [AnyHashable?: Any?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + stringMap stringMapArg: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableStringMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([stringMapArg] as [Any?]) { response in + guard let listResponse = response as? [Any?] else { + completion(.failure(createConnectionError(withChannelName: channelName))) + return + } + if listResponse.count > 1 { + let code: String = listResponse[0] as! String + let message: String? = nilOrValue(listResponse[1]) + let details: String? = nilOrValue(listResponse[2]) + completion(.failure(PigeonError(code: code, message: message, details: details))) + } else { + let result: [String?: String?]? = nilOrValue(listResponse[0]) + completion(.success(result)) + } + } + } + /// Returns the passed map, to test serialization and deserialization. + func echoNullable( + intMap intMapArg: [Int64?: Int64?]?, + completion: @escaping (Result<[Int64?: Int64?]?, PigeonError>) -> Void + ) { + let channelName: String = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi.echoNullableIntMap\(messageChannelSuffix)" + let channel = FlutterBasicMessageChannel( + name: channelName, binaryMessenger: binaryMessenger, codec: codec) + channel.sendMessage([intMapArg] as [Any?]) { response in guard let listResponse = response as? [Any?] else { completion(.failure(createConnectionError(withChannelName: channelName))) return @@ -3364,7 +3775,7 @@ class FlutterIntegrationCoreApi: FlutterIntegrationCoreApiProtocol { let details: String? = nilOrValue(listResponse[2]) completion(.failure(PigeonError(code: code, message: message, details: details))) } else { - let result: [String?: Any?]? = nilOrValue(listResponse[0]) + let result: [Int64?: Int64?]? = nilOrValue(listResponse[0]) completion(.success(result)) } } diff --git a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift b/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift index af7a7f89557..85ee03f36be 100644 --- a/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift +++ b/packages/pigeon/platform_tests/test_plugin/macos/Classes/TestPlugin.swift @@ -86,8 +86,16 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return list } - func echo(_ aMap: [String?: Any?]) throws -> [String?: Any?] { - return aMap + func echo(_ map: [AnyHashable?: Any?]) throws -> [AnyHashable?: Any?] { + return map + } + + func echo(stringMap: [String?: String?]) throws -> [String?: String?] { + return stringMap + } + + func echo(intMap: [Int64?: Int64?]) throws -> [Int64?: Int64?] { + return intMap } func echo(_ wrapper: AllClassesWrapper) throws -> AllClassesWrapper { @@ -166,8 +174,16 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { return aNullableList } - func echoNullable(_ aNullableMap: [String?: Any?]?) throws -> [String?: Any?]? { - return aNullableMap + func echoNullable(_ map: [AnyHashable?: Any?]?) throws -> [AnyHashable?: Any?]? { + return map + } + + func echoNullable(stringMap: [String?: String?]?) throws -> [String?: String?]? { + return stringMap + } + + func echoNullable(intMap: [Int64?: Int64?]?) throws -> [Int64?: Int64?]? { + return intMap } func echoNullable(_ anEnum: AnEnum?) throws -> AnEnum? { @@ -252,9 +268,21 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsync( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(map)) + } + + func echoAsync( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsync( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + completion(.success(intMap)) } func echoAsync(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { @@ -301,13 +329,28 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func echoAsyncNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void ) { - completion(.success(aMap)) + completion(.success(map)) } - func echoAsyncNullable(_ anEnum: AnEnum?, completion: @escaping (Result) -> Void) - { + func echoAsyncNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + completion(.success(stringMap)) + } + + func echoAsyncNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void + ) { + completion(.success(intMap)) + } + + func echoAsyncNullable( + _ anEnum: AnEnum?, completion: @escaping (Result) -> Void + ) { completion(.success(anEnum)) } @@ -499,9 +542,22 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEcho( - _ aMap: [String?: Any?], completion: @escaping (Result<[String?: Any?], Error>) -> Void + _ map: [AnyHashable?: Any?], completion: @escaping (Result<[AnyHashable?: Any?], Error>) -> Void + ) { + flutterAPI.echo(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + stringMap: [String?: String?], completion: @escaping (Result<[String?: String?], Error>) -> Void ) { - flutterAPI.echo(aMap) { response in + flutterAPI.echo(stringMap: stringMap) { response in switch response { case .success(let res): completion(.success(res)) @@ -511,7 +567,22 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } } - func callFlutterEcho(_ anEnum: AnEnum, completion: @escaping (Result) -> Void) { + func callFlutterEcho( + intMap: [Int64?: Int64?], completion: @escaping (Result<[Int64?: Int64?], Error>) -> Void + ) { + flutterAPI.echo(intMap: intMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEcho( + _ anEnum: AnEnum, completion: @escaping (Result) -> Void + ) { flutterAPI.echo(anEnum) { response in switch response { case .success(let res): @@ -614,9 +685,37 @@ public class TestPlugin: NSObject, FlutterPlugin, HostIntegrationCoreApi { } func callFlutterEchoNullable( - _ aMap: [String?: Any?]?, completion: @escaping (Result<[String?: Any?]?, Error>) -> Void + _ map: [AnyHashable?: Any?]?, + completion: @escaping (Result<[AnyHashable?: Any?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(map) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + stringMap: [String?: String?]?, + completion: @escaping (Result<[String?: String?]?, Error>) -> Void + ) { + flutterAPI.echoNullable(stringMap: stringMap) { response in + switch response { + case .success(let res): + completion(.success(res)) + case .failure(let error): + completion(.failure(error)) + } + } + } + + func callFlutterEchoNullable( + intMap: [Int64?: Int64?]?, completion: @escaping (Result<[Int64?: Int64?]?, Error>) -> Void ) { - flutterAPI.echoNullable(aMap) { response in + flutterAPI.echoNullable(intMap: intMap) { response in switch response { case .success(let res): completion(.success(res)) diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp index c2ae05c413c..599383d892c 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.cpp @@ -44,7 +44,9 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, const EncodableList& list, const EncodableList& string_list, const EncodableList& int_list, const EncodableList& double_list, - const EncodableList& bool_list, const EncodableMap& map) + const EncodableList& bool_list, + const EncodableList& list_list, const EncodableMap& map, + const EncodableMap& string_map, const EncodableMap& int_map) : a_bool_(a_bool), an_int_(an_int), an_int64_(an_int64), @@ -62,7 +64,10 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, int_list_(int_list), double_list_(double_list), bool_list_(bool_list), - map_(map) {} + list_list_(list_list), + map_(map), + string_map_(string_map), + int_map_(int_map) {} bool AllTypes::a_bool() const { return a_bool_; } @@ -162,13 +167,31 @@ void AllTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } +const EncodableList& AllTypes::list_list() const { return list_list_; } + +void AllTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; +} + const EncodableMap& AllTypes::map() const { return map_; } void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap& AllTypes::string_map() const { return string_map_; } + +void AllTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap& AllTypes::int_map() const { return int_map_; } + +void AllTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} + EncodableList AllTypes::ToEncodableList() const { EncodableList list; - list.reserve(18); + list.reserve(21); list.push_back(EncodableValue(a_bool_)); list.push_back(EncodableValue(an_int_)); list.push_back(EncodableValue(an_int64_)); @@ -186,14 +209,18 @@ EncodableList AllTypes::ToEncodableList() const { list.push_back(EncodableValue(int_list_)); list.push_back(EncodableValue(double_list_)); list.push_back(EncodableValue(bool_list_)); + list.push_back(EncodableValue(list_list_)); list.push_back(EncodableValue(map_)); + list.push_back(EncodableValue(string_map_)); + list.push_back(EncodableValue(int_map_)); return list; } AllTypes AllTypes::FromEncodableList(const EncodableList& list) { AllTypes decoded( - std::get(list[0]), list[1].LongValue(), list[2].LongValue(), - std::get(list[3]), std::get>(list[4]), + std::get(list[0]), std::get(list[1]), + std::get(list[2]), std::get(list[3]), + std::get>(list[4]), std::get>(list[5]), std::get>(list[6]), std::get>(list[7]), @@ -203,7 +230,9 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { std::get(list[10]), list[11], std::get(list[12]), std::get(list[13]), std::get(list[14]), std::get(list[15]), - std::get(list[16]), std::get(list[17])); + std::get(list[16]), std::get(list[17]), + std::get(list[18]), std::get(list[19]), + std::get(list[20])); return decoded; } @@ -218,16 +247,14 @@ AllNullableTypes::AllNullableTypes( const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const AnotherEnum* another_nullable_enum, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const EncodableValue* a_nullable_object, const AllNullableTypes* all_nullable_types, const EncodableList* list, const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, - const EncodableList* nested_class_list, const EncodableMap* map) + const EncodableList* list_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map) : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) @@ -254,17 +281,6 @@ AllNullableTypes::AllNullableTypes( a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), another_nullable_enum_(another_nullable_enum ? std::optional( @@ -289,10 +305,13 @@ AllNullableTypes::AllNullableTypes( : std::nullopt), bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - nested_class_list_(nested_class_list - ? std::optional(*nested_class_list) + list_list_(list_list ? std::optional(*list_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + int_map_(int_map ? std::optional(*int_map) : std::nullopt) { +} AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) : a_nullable_bool_(other.a_nullable_bool_ @@ -323,19 +342,6 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) ? std::optional>( *other.a_nullable_float_array_) : std::nullopt), - nullable_nested_list_( - other.nullable_nested_list_ - ? std::optional(*other.nullable_nested_list_) - : std::nullopt), - nullable_map_with_annotations_( - other.nullable_map_with_annotations_ - ? std::optional( - *other.nullable_map_with_annotations_) - : std::nullopt), - nullable_map_with_object_( - other.nullable_map_with_object_ - ? std::optional(*other.nullable_map_with_object_) - : std::nullopt), a_nullable_enum_(other.a_nullable_enum_ ? std::optional(*other.a_nullable_enum_) : std::nullopt), @@ -368,12 +374,16 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) bool_list_(other.bool_list_ ? std::optional(*other.bool_list_) : std::nullopt), - nested_class_list_( - other.nested_class_list_ - ? std::optional(*other.nested_class_list_) - : std::nullopt), + list_list_(other.list_list_ + ? std::optional(*other.list_list_) + : std::nullopt), map_(other.map_ ? std::optional(*other.map_) - : std::nullopt) {} + : std::nullopt), + string_map_(other.string_map_ + ? std::optional(*other.string_map_) + : std::nullopt), + int_map_(other.int_map_ ? std::optional(*other.int_map_) + : std::nullopt) {} AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable_bool_ = other.a_nullable_bool_; @@ -384,9 +394,6 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { a_nullable4_byte_array_ = other.a_nullable4_byte_array_; a_nullable8_byte_array_ = other.a_nullable8_byte_array_; a_nullable_float_array_ = other.a_nullable_float_array_; - nullable_nested_list_ = other.nullable_nested_list_; - nullable_map_with_annotations_ = other.nullable_map_with_annotations_; - nullable_map_with_object_ = other.nullable_map_with_object_; a_nullable_enum_ = other.a_nullable_enum_; another_nullable_enum_ = other.another_nullable_enum_; a_nullable_string_ = other.a_nullable_string_; @@ -400,8 +407,10 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { int_list_ = other.int_list_; double_list_ = other.double_list_; bool_list_ = other.bool_list_; - nested_class_list_ = other.nested_class_list_; + list_list_ = other.list_list_; map_ = other.map_; + string_map_ = other.string_map_; + int_map_ = other.int_map_; return *this; } @@ -519,52 +528,6 @@ void AllNullableTypes::set_a_nullable_float_array( a_nullable_float_array_ = value_arg; } -const EncodableList* AllNullableTypes::nullable_nested_list() const { - return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; -} - -void AllNullableTypes::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_nested_list( - const EncodableList& value_arg) { - nullable_nested_list_ = value_arg; -} - -const EncodableMap* AllNullableTypes::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; -} - -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { - nullable_map_with_annotations_ = value_arg; -} - -const EncodableMap* AllNullableTypes::nullable_map_with_object() const { - return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; -} - -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypes::set_nullable_map_with_object( - const EncodableMap& value_arg) { - nullable_map_with_object_ = value_arg; -} - const AnEnum* AllNullableTypes::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } @@ -697,17 +660,17 @@ void AllNullableTypes::set_bool_list(const EncodableList& value_arg) { bool_list_ = value_arg; } -const EncodableList* AllNullableTypes::nested_class_list() const { - return nested_class_list_ ? &(*nested_class_list_) : nullptr; +const EncodableList* AllNullableTypes::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; } -void AllNullableTypes::set_nested_class_list(const EncodableList* value_arg) { - nested_class_list_ = +void AllNullableTypes::set_list_list(const EncodableList* value_arg) { + list_list_ = value_arg ? std::optional(*value_arg) : std::nullopt; } -void AllNullableTypes::set_nested_class_list(const EncodableList& value_arg) { - nested_class_list_ = value_arg; +void AllNullableTypes::set_list_list(const EncodableList& value_arg) { + list_list_ = value_arg; } const EncodableMap* AllNullableTypes::map() const { @@ -722,9 +685,34 @@ void AllNullableTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap* AllNullableTypes::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} + +void AllNullableTypes::set_string_map(const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_string_map(const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypes::set_int_map(const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_int_map(const EncodableMap& value_arg) { + int_map_ = value_arg; +} + EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; - list.reserve(23); + list.reserve(22); list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) @@ -745,14 +733,6 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); list.push_back(another_nullable_enum_ @@ -771,9 +751,10 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); - list.push_back(nested_class_list_ ? EncodableValue(*nested_class_list_) - : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); return list; } @@ -786,11 +767,11 @@ AllNullableTypes AllNullableTypes::FromEncodableList( } auto& encodable_a_nullable_int = list[1]; if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(encodable_a_nullable_int.LongValue()); + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); } auto& encodable_a_nullable_int64 = list[2]; if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(encodable_a_nullable_int64.LongValue()); + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { @@ -817,74 +798,66 @@ AllNullableTypes AllNullableTypes::FromEncodableList( decoded.set_a_nullable_float_array( std::get>(encodable_a_nullable_float_array)); } - auto& encodable_nullable_nested_list = list[8]; - if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); - } - auto& encodable_nullable_map_with_annotations = list[9]; - if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); - } - auto& encodable_nullable_map_with_object = list[10]; - if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); - } - auto& encodable_a_nullable_enum = list[11]; + auto& encodable_a_nullable_enum = list[8]; if (!encodable_a_nullable_enum.IsNull()) { decoded.set_a_nullable_enum(std::any_cast( std::get(encodable_a_nullable_enum))); } - auto& encodable_another_nullable_enum = list[12]; + auto& encodable_another_nullable_enum = list[9]; if (!encodable_another_nullable_enum.IsNull()) { decoded.set_another_nullable_enum(std::any_cast( std::get(encodable_another_nullable_enum))); } - auto& encodable_a_nullable_string = list[13]; + auto& encodable_a_nullable_string = list[10]; if (!encodable_a_nullable_string.IsNull()) { decoded.set_a_nullable_string( std::get(encodable_a_nullable_string)); } - auto& encodable_a_nullable_object = list[14]; + auto& encodable_a_nullable_object = list[11]; if (!encodable_a_nullable_object.IsNull()) { decoded.set_a_nullable_object(encodable_a_nullable_object); } - auto& encodable_all_nullable_types = list[15]; + auto& encodable_all_nullable_types = list[12]; if (!encodable_all_nullable_types.IsNull()) { decoded.set_all_nullable_types(std::any_cast( std::get(encodable_all_nullable_types))); } - auto& encodable_list = list[16]; + auto& encodable_list = list[13]; if (!encodable_list.IsNull()) { decoded.set_list(std::get(encodable_list)); } - auto& encodable_string_list = list[17]; + auto& encodable_string_list = list[14]; if (!encodable_string_list.IsNull()) { decoded.set_string_list(std::get(encodable_string_list)); } - auto& encodable_int_list = list[18]; + auto& encodable_int_list = list[15]; if (!encodable_int_list.IsNull()) { decoded.set_int_list(std::get(encodable_int_list)); } - auto& encodable_double_list = list[19]; + auto& encodable_double_list = list[16]; if (!encodable_double_list.IsNull()) { decoded.set_double_list(std::get(encodable_double_list)); } - auto& encodable_bool_list = list[20]; + auto& encodable_bool_list = list[17]; if (!encodable_bool_list.IsNull()) { decoded.set_bool_list(std::get(encodable_bool_list)); } - auto& encodable_nested_class_list = list[21]; - if (!encodable_nested_class_list.IsNull()) { - decoded.set_nested_class_list( - std::get(encodable_nested_class_list)); + auto& encodable_list_list = list[18]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); } - auto& encodable_map = list[22]; + auto& encodable_map = list[19]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } + auto& encodable_string_map = list[20]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[21]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } return decoded; } @@ -899,15 +872,13 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const EncodableList* nullable_nested_list, - const EncodableMap* nullable_map_with_annotations, - const EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, - const AnotherEnum* another_nullable_enum, + const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const EncodableValue* a_nullable_object, const EncodableList* list, const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, - const EncodableMap* map) + const EncodableList* list_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map) : a_nullable_bool_(a_nullable_bool ? std::optional(*a_nullable_bool) : std::nullopt), a_nullable_int_(a_nullable_int ? std::optional(*a_nullable_int) @@ -934,17 +905,6 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( a_nullable_float_array ? std::optional>(*a_nullable_float_array) : std::nullopt), - nullable_nested_list_(nullable_nested_list ? std::optional( - *nullable_nested_list) - : std::nullopt), - nullable_map_with_annotations_( - nullable_map_with_annotations - ? std::optional(*nullable_map_with_annotations) - : std::nullopt), - nullable_map_with_object_( - nullable_map_with_object - ? std::optional(*nullable_map_with_object) - : std::nullopt), a_nullable_enum_(a_nullable_enum ? std::optional(*a_nullable_enum) : std::nullopt), another_nullable_enum_(another_nullable_enum ? std::optional( @@ -965,7 +925,13 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( : std::nullopt), bool_list_(bool_list ? std::optional(*bool_list) : std::nullopt), - map_(map ? std::optional(*map) : std::nullopt) {} + list_list_(list_list ? std::optional(*list_list) + : std::nullopt), + map_(map ? std::optional(*map) : std::nullopt), + string_map_(string_map ? std::optional(*string_map) + : std::nullopt), + int_map_(int_map ? std::optional(*int_map) : std::nullopt) { +} const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; @@ -1089,55 +1055,6 @@ void AllNullableTypesWithoutRecursion::set_a_nullable_float_array( a_nullable_float_array_ = value_arg; } -const EncodableList* AllNullableTypesWithoutRecursion::nullable_nested_list() - const { - return nullable_nested_list_ ? &(*nullable_nested_list_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList* value_arg) { - nullable_nested_list_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_nested_list( - const EncodableList& value_arg) { - nullable_nested_list_ = value_arg; -} - -const EncodableMap* -AllNullableTypesWithoutRecursion::nullable_map_with_annotations() const { - return nullable_map_with_annotations_ ? &(*nullable_map_with_annotations_) - : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap* value_arg) { - nullable_map_with_annotations_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_annotations( - const EncodableMap& value_arg) { - nullable_map_with_annotations_ = value_arg; -} - -const EncodableMap* AllNullableTypesWithoutRecursion::nullable_map_with_object() - const { - return nullable_map_with_object_ ? &(*nullable_map_with_object_) : nullptr; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap* value_arg) { - nullable_map_with_object_ = - value_arg ? std::optional(*value_arg) : std::nullopt; -} - -void AllNullableTypesWithoutRecursion::set_nullable_map_with_object( - const EncodableMap& value_arg) { - nullable_map_with_object_ = value_arg; -} - const AnEnum* AllNullableTypesWithoutRecursion::a_nullable_enum() const { return a_nullable_enum_ ? &(*a_nullable_enum_) : nullptr; } @@ -1274,6 +1191,21 @@ void AllNullableTypesWithoutRecursion::set_bool_list( bool_list_ = value_arg; } +const EncodableList* AllNullableTypesWithoutRecursion::list_list() const { + return list_list_ ? &(*list_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList* value_arg) { + list_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_list( + const EncodableList& value_arg) { + list_list_ = value_arg; +} + const EncodableMap* AllNullableTypesWithoutRecursion::map() const { return map_ ? &(*map_) : nullptr; } @@ -1286,6 +1218,35 @@ void AllNullableTypesWithoutRecursion::set_map(const EncodableMap& value_arg) { map_ = value_arg; } +const EncodableMap* AllNullableTypesWithoutRecursion::string_map() const { + return string_map_ ? &(*string_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap* value_arg) { + string_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_string_map( + const EncodableMap& value_arg) { + string_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::int_map() const { + return int_map_ ? &(*int_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap* value_arg) { + int_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_int_map( + const EncodableMap& value_arg) { + int_map_ = value_arg; +} + EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { EncodableList list; list.reserve(21); @@ -1309,14 +1270,6 @@ EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { list.push_back(a_nullable_float_array_ ? EncodableValue(*a_nullable_float_array_) : EncodableValue()); - list.push_back(nullable_nested_list_ ? EncodableValue(*nullable_nested_list_) - : EncodableValue()); - list.push_back(nullable_map_with_annotations_ - ? EncodableValue(*nullable_map_with_annotations_) - : EncodableValue()); - list.push_back(nullable_map_with_object_ - ? EncodableValue(*nullable_map_with_object_) - : EncodableValue()); list.push_back(a_nullable_enum_ ? CustomEncodableValue(*a_nullable_enum_) : EncodableValue()); list.push_back(another_nullable_enum_ @@ -1332,7 +1285,10 @@ EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { list.push_back(double_list_ ? EncodableValue(*double_list_) : EncodableValue()); list.push_back(bool_list_ ? EncodableValue(*bool_list_) : EncodableValue()); + list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); + list.push_back(string_map_ ? EncodableValue(*string_map_) : EncodableValue()); + list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); return list; } @@ -1345,11 +1301,11 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { } auto& encodable_a_nullable_int = list[1]; if (!encodable_a_nullable_int.IsNull()) { - decoded.set_a_nullable_int(encodable_a_nullable_int.LongValue()); + decoded.set_a_nullable_int(std::get(encodable_a_nullable_int)); } auto& encodable_a_nullable_int64 = list[2]; if (!encodable_a_nullable_int64.IsNull()) { - decoded.set_a_nullable_int64(encodable_a_nullable_int64.LongValue()); + decoded.set_a_nullable_int64(std::get(encodable_a_nullable_int64)); } auto& encodable_a_nullable_double = list[3]; if (!encodable_a_nullable_double.IsNull()) { @@ -1376,64 +1332,61 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { decoded.set_a_nullable_float_array( std::get>(encodable_a_nullable_float_array)); } - auto& encodable_nullable_nested_list = list[8]; - if (!encodable_nullable_nested_list.IsNull()) { - decoded.set_nullable_nested_list( - std::get(encodable_nullable_nested_list)); - } - auto& encodable_nullable_map_with_annotations = list[9]; - if (!encodable_nullable_map_with_annotations.IsNull()) { - decoded.set_nullable_map_with_annotations( - std::get(encodable_nullable_map_with_annotations)); - } - auto& encodable_nullable_map_with_object = list[10]; - if (!encodable_nullable_map_with_object.IsNull()) { - decoded.set_nullable_map_with_object( - std::get(encodable_nullable_map_with_object)); - } - auto& encodable_a_nullable_enum = list[11]; + auto& encodable_a_nullable_enum = list[8]; if (!encodable_a_nullable_enum.IsNull()) { decoded.set_a_nullable_enum(std::any_cast( std::get(encodable_a_nullable_enum))); } - auto& encodable_another_nullable_enum = list[12]; + auto& encodable_another_nullable_enum = list[9]; if (!encodable_another_nullable_enum.IsNull()) { decoded.set_another_nullable_enum(std::any_cast( std::get(encodable_another_nullable_enum))); } - auto& encodable_a_nullable_string = list[13]; + auto& encodable_a_nullable_string = list[10]; if (!encodable_a_nullable_string.IsNull()) { decoded.set_a_nullable_string( std::get(encodable_a_nullable_string)); } - auto& encodable_a_nullable_object = list[14]; + auto& encodable_a_nullable_object = list[11]; if (!encodable_a_nullable_object.IsNull()) { decoded.set_a_nullable_object(encodable_a_nullable_object); } - auto& encodable_list = list[15]; + auto& encodable_list = list[12]; if (!encodable_list.IsNull()) { decoded.set_list(std::get(encodable_list)); } - auto& encodable_string_list = list[16]; + auto& encodable_string_list = list[13]; if (!encodable_string_list.IsNull()) { decoded.set_string_list(std::get(encodable_string_list)); } - auto& encodable_int_list = list[17]; + auto& encodable_int_list = list[14]; if (!encodable_int_list.IsNull()) { decoded.set_int_list(std::get(encodable_int_list)); } - auto& encodable_double_list = list[18]; + auto& encodable_double_list = list[15]; if (!encodable_double_list.IsNull()) { decoded.set_double_list(std::get(encodable_double_list)); } - auto& encodable_bool_list = list[19]; + auto& encodable_bool_list = list[16]; if (!encodable_bool_list.IsNull()) { decoded.set_bool_list(std::get(encodable_bool_list)); } - auto& encodable_map = list[20]; + auto& encodable_list_list = list[17]; + if (!encodable_list_list.IsNull()) { + decoded.set_list_list(std::get(encodable_list_list)); + } + auto& encodable_map = list[18]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } + auto& encodable_string_map = list[19]; + if (!encodable_string_map.IsNull()) { + decoded.set_string_map(std::get(encodable_string_map)); + } + auto& encodable_int_map = list[20]; + if (!encodable_int_map.IsNull()) { + decoded.set_int_map(std::get(encodable_int_map)); + } return decoded; } @@ -2131,14 +2084,83 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); + return; + } + const auto& map_arg = std::get(encodable_map_arg); + ErrorOr output = api->EchoMap(map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + ErrorOr output = api->EchoStringMap(string_map_arg); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back(EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); - ErrorOr output = api->EchoMap(a_map_arg); + const auto& int_map_arg = + std::get(encodable_int_map_arg); + ErrorOr output = api->EchoIntMap(int_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2553,14 +2575,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; + std::get_if(&encodable_a_nullable_int_arg); const auto& encodable_a_nullable_string_arg = args.at(2); const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); @@ -2600,14 +2616,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; + std::get_if(&encodable_a_nullable_int_arg); const auto& encodable_a_nullable_string_arg = args.at(2); const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); @@ -2644,14 +2654,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, try { const auto& args = std::get(message); const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; + std::get_if(&encodable_a_nullable_int_arg); ErrorOr> output = api->EchoNullableInt(a_nullable_int_arg); if (output.has_error()) { @@ -2917,11 +2921,11 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_map_arg = args.at(0); - const auto* a_nullable_map_arg = - std::get_if(&encodable_a_nullable_map_arg); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); ErrorOr> output = - api->EchoNullableMap(a_nullable_map_arg); + api->EchoNullableMap(map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2944,27 +2948,23 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.echoNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoNullableStringMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - AnEnum an_enum_arg_value; - const AnEnum* an_enum_arg = nullptr; - if (!encodable_an_enum_arg.IsNull()) { - an_enum_arg_value = std::any_cast( - std::get(encodable_an_enum_arg)); - an_enum_arg = &an_enum_arg_value; - } - ErrorOr> output = api->EchoNullableEnum( - an_enum_arg ? &(*an_enum_arg) : nullptr); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + ErrorOr> output = + api->EchoNullableStringMap(string_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -2973,7 +2973,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, auto output_optional = std::move(output).TakeValue(); if (output_optional) { wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); + EncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -2987,29 +2987,22 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoAnotherNullableEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableIntMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - AnotherEnum another_enum_arg_value; - const AnotherEnum* another_enum_arg = nullptr; - if (!encodable_another_enum_arg.IsNull()) { - another_enum_arg_value = std::any_cast( - std::get(encodable_another_enum_arg)); - another_enum_arg = &another_enum_arg_value; - } - ErrorOr> output = - api->EchoAnotherNullableEnum( - another_enum_arg ? &(*another_enum_arg) : nullptr); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + ErrorOr> output = + api->EchoNullableIntMap(int_map_arg); if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3018,7 +3011,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, auto output_optional = std::move(output).TakeValue(); if (output_optional) { wrapped.push_back( - CustomEncodableValue(std::move(output_optional).value())); + EncodableValue(std::move(output_optional).value())); } else { wrapped.push_back(EncodableValue()); } @@ -3032,28 +3025,110 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "echoOptionalNullableInt" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoNullableEnum" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_nullable_int_arg = args.at(0); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); - const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; - ErrorOr> output = + const auto& encodable_an_enum_arg = args.at(0); + AnEnum an_enum_arg_value; + const AnEnum* an_enum_arg = nullptr; + if (!encodable_an_enum_arg.IsNull()) { + an_enum_arg_value = std::any_cast( + std::get(encodable_an_enum_arg)); + an_enum_arg = &an_enum_arg_value; + } + ErrorOr> output = api->EchoNullableEnum( + an_enum_arg ? &(*an_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAnotherNullableEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_another_enum_arg = args.at(0); + AnotherEnum another_enum_arg_value; + const AnotherEnum* another_enum_arg = nullptr; + if (!encodable_another_enum_arg.IsNull()) { + another_enum_arg_value = std::any_cast( + std::get(encodable_another_enum_arg)); + another_enum_arg = &another_enum_arg_value; + } + ErrorOr> output = + api->EchoAnotherNullableEnum( + another_enum_arg ? &(*another_enum_arg) : nullptr); + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + CustomEncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoOptionalNullableInt" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_a_nullable_int_arg = args.at(0); + const auto* a_nullable_int_arg = + std::get_if(&encodable_a_nullable_int_arg); + ErrorOr> output = api->EchoOptionalNullableInt(a_nullable_int_arg); if (output.has_error()) { reply(WrapError(output.error())); @@ -3417,15 +3492,90 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); + const auto& map_arg = std::get(encodable_map_arg); api->EchoAsyncMap( - a_map_arg, [reply](ErrorOr&& output) { + map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); + return; + } + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->EchoAsyncStringMap( + string_map_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + EncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.echoAsyncIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); + return; + } + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->EchoAsyncIntMap( + int_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -3765,12 +3915,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, try { const auto& args = std::get(message); const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + std::get_if(&encodable_an_int_arg); api->EchoAsyncNullableInt( an_int_arg, [reply](ErrorOr>&& output) { @@ -4053,11 +4199,93 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); api->EchoAsyncNullableMap( - a_map_arg, + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->EchoAsyncNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "echoAsyncNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->EchoAsyncNullableIntMap( + int_map_arg, [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); @@ -4369,14 +4597,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; + std::get_if(&encodable_a_nullable_int_arg); const auto& encodable_a_nullable_string_arg = args.at(2); const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); @@ -4465,14 +4687,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const auto* a_nullable_bool_arg = std::get_if(&encodable_a_nullable_bool_arg); const auto& encodable_a_nullable_int_arg = args.at(1); - const int64_t a_nullable_int_arg_value = - encodable_a_nullable_int_arg.IsNull() - ? 0 - : encodable_a_nullable_int_arg.LongValue(); const auto* a_nullable_int_arg = - encodable_a_nullable_int_arg.IsNull() - ? nullptr - : &a_nullable_int_arg_value; + std::get_if(&encodable_a_nullable_int_arg); const auto& encodable_a_nullable_string_arg = args.at(2); const auto* a_nullable_string_arg = std::get_if(&encodable_a_nullable_string_arg); @@ -4738,15 +4954,14 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - if (encodable_a_map_arg.IsNull()) { - reply(WrapError("a_map_arg unexpectedly null.")); + const auto& encodable_map_arg = args.at(0); + if (encodable_map_arg.IsNull()) { + reply(WrapError("map_arg unexpectedly null.")); return; } - const auto& a_map_arg = - std::get(encodable_a_map_arg); + const auto& map_arg = std::get(encodable_map_arg); api->CallFlutterEchoMap( - a_map_arg, [reply](ErrorOr&& output) { + map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; @@ -4765,33 +4980,34 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel(binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests." - "HostIntegrationCoreApi.callFlutterEchoEnum" + - prepended_suffix, - &GetCodec()); + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoStringMap" + + prepended_suffix, + &GetCodec()); if (api != nullptr) { channel.SetMessageHandler( [api](const EncodableValue& message, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_an_enum_arg = args.at(0); - if (encodable_an_enum_arg.IsNull()) { - reply(WrapError("an_enum_arg unexpectedly null.")); + const auto& encodable_string_map_arg = args.at(0); + if (encodable_string_map_arg.IsNull()) { + reply(WrapError("string_map_arg unexpectedly null.")); return; } - const auto& an_enum_arg = std::any_cast( - std::get(encodable_an_enum_arg)); - api->CallFlutterEchoEnum( - an_enum_arg, [reply](ErrorOr&& output) { + const auto& string_map_arg = + std::get(encodable_string_map_arg); + api->CallFlutterEchoStringMap( + string_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4806,7 +5022,7 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, BasicMessageChannel<> channel( binary_messenger, "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." - "callFlutterEchoAnotherEnum" + + "callFlutterEchoIntMap" + prepended_suffix, &GetCodec()); if (api != nullptr) { @@ -4815,22 +5031,22 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_another_enum_arg = args.at(0); - if (encodable_another_enum_arg.IsNull()) { - reply(WrapError("another_enum_arg unexpectedly null.")); + const auto& encodable_int_map_arg = args.at(0); + if (encodable_int_map_arg.IsNull()) { + reply(WrapError("int_map_arg unexpectedly null.")); return; } - const auto& another_enum_arg = std::any_cast( - std::get(encodable_another_enum_arg)); - api->CallFlutterEchoAnotherEnum( - another_enum_arg, [reply](ErrorOr&& output) { + const auto& int_map_arg = + std::get(encodable_int_map_arg); + api->CallFlutterEchoIntMap( + int_map_arg, [reply](ErrorOr&& output) { if (output.has_error()) { reply(WrapError(output.error())); return; } EncodableList wrapped; wrapped.push_back( - CustomEncodableValue(std::move(output).TakeValue())); + EncodableValue(std::move(output).TakeValue())); reply(EncodableValue(std::move(wrapped))); }); } catch (const std::exception& exception) { @@ -4842,9 +5058,86 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, } } { - BasicMessageChannel<> channel( - binary_messenger, - "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + BasicMessageChannel<> channel(binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests." + "HostIntegrationCoreApi.callFlutterEchoEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_an_enum_arg = args.at(0); + if (encodable_an_enum_arg.IsNull()) { + reply(WrapError("an_enum_arg unexpectedly null.")); + return; + } + const auto& an_enum_arg = std::any_cast( + std::get(encodable_an_enum_arg)); + api->CallFlutterEchoEnum( + an_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoAnotherEnum" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_another_enum_arg = args.at(0); + if (encodable_another_enum_arg.IsNull()) { + reply(WrapError("another_enum_arg unexpectedly null.")); + return; + } + const auto& another_enum_arg = std::any_cast( + std::get(encodable_another_enum_arg)); + api->CallFlutterEchoAnotherEnum( + another_enum_arg, [reply](ErrorOr&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + wrapped.push_back( + CustomEncodableValue(std::move(output).TakeValue())); + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." "callFlutterEchoNullableBool" + prepended_suffix, &GetCodec()); @@ -4894,12 +5187,8 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, try { const auto& args = std::get(message); const auto& encodable_an_int_arg = args.at(0); - const int64_t an_int_arg_value = - encodable_an_int_arg.IsNull() - ? 0 - : encodable_an_int_arg.LongValue(); const auto* an_int_arg = - encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value; + std::get_if(&encodable_an_int_arg); api->CallFlutterEchoNullableInt( an_int_arg, [reply](ErrorOr>&& output) { @@ -5103,11 +5392,93 @@ void HostIntegrationCoreApi::SetUp(flutter::BinaryMessenger* binary_messenger, const flutter::MessageReply& reply) { try { const auto& args = std::get(message); - const auto& encodable_a_map_arg = args.at(0); - const auto* a_map_arg = - std::get_if(&encodable_a_map_arg); + const auto& encodable_map_arg = args.at(0); + const auto* map_arg = + std::get_if(&encodable_map_arg); api->CallFlutterEchoNullableMap( - a_map_arg, + map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableStringMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_string_map_arg = args.at(0); + const auto* string_map_arg = + std::get_if(&encodable_string_map_arg); + api->CallFlutterEchoNullableStringMap( + string_map_arg, + [reply](ErrorOr>&& output) { + if (output.has_error()) { + reply(WrapError(output.error())); + return; + } + EncodableList wrapped; + auto output_optional = std::move(output).TakeValue(); + if (output_optional) { + wrapped.push_back( + EncodableValue(std::move(output_optional).value())); + } else { + wrapped.push_back(EncodableValue()); + } + reply(EncodableValue(std::move(wrapped))); + }); + } catch (const std::exception& exception) { + reply(WrapError(exception.what())); + } + }); + } else { + channel.SetMessageHandler(nullptr); + } + } + { + BasicMessageChannel<> channel( + binary_messenger, + "dev.flutter.pigeon.pigeon_integration_tests.HostIntegrationCoreApi." + "callFlutterEchoNullableIntMap" + + prepended_suffix, + &GetCodec()); + if (api != nullptr) { + channel.SetMessageHandler( + [api](const EncodableValue& message, + const flutter::MessageReply& reply) { + try { + const auto& args = std::get(message); + const auto& encodable_int_map_arg = args.at(0); + const auto* int_map_arg = + std::get_if(&encodable_int_map_arg); + api->CallFlutterEchoNullableIntMap( + int_map_arg, [reply](ErrorOr>&& output) { if (output.has_error()) { reply(WrapError(output.error())); @@ -5830,7 +6201,7 @@ void FlutterIntegrationCoreApi::EchoList( } void FlutterIntegrationCoreApi::EchoMap( - const EncodableMap& a_map_arg, + const EncodableMap& map_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = @@ -5839,7 +6210,83 @@ void FlutterIntegrationCoreApi::EchoMap( message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - EncodableValue(a_map_arg), + EncodableValue(map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoStringMap( + const EncodableMap& string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(string_map_arg), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto& return_value = + std::get(list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoIntMap( + const EncodableMap& int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + EncodableValue(int_map_arg), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), @@ -5989,34 +6436,30 @@ void FlutterIntegrationCoreApi::EchoNullableInt( EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ an_int_arg ? EncodableValue(*an_int_arg) : EncodableValue(), }); - channel.Send(encoded_api_arguments, [channel_name, - on_success = std::move(on_success), - on_error = std::move(on_error)]( - const uint8_t* reply, - size_t reply_size) { - std::unique_ptr response = - GetCodec().DecodeMessage(reply, reply_size); - const auto& encodable_return_value = *response; - const auto* list_return_value = - std::get_if(&encodable_return_value); - if (list_return_value) { - if (list_return_value->size() > 1) { - on_error(FlutterError(std::get(list_return_value->at(0)), - std::get(list_return_value->at(1)), - list_return_value->at(2))); - } else { - const int64_t return_value_value = - list_return_value->at(0).IsNull() - ? 0 - : list_return_value->at(0).LongValue(); - const auto* return_value = - list_return_value->at(0).IsNull() ? nullptr : &return_value_value; - on_success(return_value); - } - } else { - on_error(CreateConnectionError(channel_name)); - } - }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); } void FlutterIntegrationCoreApi::EchoNullableDouble( @@ -6171,7 +6614,7 @@ void FlutterIntegrationCoreApi::EchoNullableList( } void FlutterIntegrationCoreApi::EchoNullableMap( - const EncodableMap* a_map_arg, + const EncodableMap* map_arg, std::function&& on_success, std::function&& on_error) { const std::string channel_name = @@ -6180,7 +6623,83 @@ void FlutterIntegrationCoreApi::EchoNullableMap( message_channel_suffix_; BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ - a_map_arg ? EncodableValue(*a_map_arg) : EncodableValue(), + map_arg ? EncodableValue(*map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableStringMap( + const EncodableMap* string_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableStringMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + string_map_arg ? EncodableValue(*string_map_arg) : EncodableValue(), + }); + channel.Send( + encoded_api_arguments, [channel_name, on_success = std::move(on_success), + on_error = std::move(on_error)]( + const uint8_t* reply, size_t reply_size) { + std::unique_ptr response = + GetCodec().DecodeMessage(reply, reply_size); + const auto& encodable_return_value = *response; + const auto* list_return_value = + std::get_if(&encodable_return_value); + if (list_return_value) { + if (list_return_value->size() > 1) { + on_error( + FlutterError(std::get(list_return_value->at(0)), + std::get(list_return_value->at(1)), + list_return_value->at(2))); + } else { + const auto* return_value = + std::get_if(&list_return_value->at(0)); + on_success(return_value); + } + } else { + on_error(CreateConnectionError(channel_name)); + } + }); +} + +void FlutterIntegrationCoreApi::EchoNullableIntMap( + const EncodableMap* int_map_arg, + std::function&& on_success, + std::function&& on_error) { + const std::string channel_name = + "dev.flutter.pigeon.pigeon_integration_tests.FlutterIntegrationCoreApi." + "echoNullableIntMap" + + message_channel_suffix_; + BasicMessageChannel<> channel(binary_messenger_, channel_name, &GetCodec()); + EncodableValue encoded_api_arguments = EncodableValue(EncodableList{ + int_map_arg ? EncodableValue(*int_map_arg) : EncodableValue(), }); channel.Send( encoded_api_arguments, [channel_name, on_success = std::move(on_success), diff --git a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h index 53419f806f7..b4e0693f61d 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/pigeon/core_tests.gen.h @@ -94,7 +94,10 @@ class AllTypes { const flutter::EncodableList& int_list, const flutter::EncodableList& double_list, const flutter::EncodableList& bool_list, - const flutter::EncodableMap& map); + const flutter::EncodableList& list_list, + const flutter::EncodableMap& map, + const flutter::EncodableMap& string_map, + const flutter::EncodableMap& int_map); bool a_bool() const; void set_a_bool(bool value_arg); @@ -147,9 +150,18 @@ class AllTypes { const flutter::EncodableList& bool_list() const; void set_bool_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList& list_list() const; + void set_list_list(const flutter::EncodableList& value_arg); + const flutter::EncodableMap& map() const; void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap& string_map() const; + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& int_map() const; + void set_int_map(const flutter::EncodableMap& value_arg); + private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -178,7 +190,10 @@ class AllTypes { flutter::EncodableList int_list_; flutter::EncodableList double_list_; flutter::EncodableList bool_list_; + flutter::EncodableList list_list_; flutter::EncodableMap map_; + flutter::EncodableMap string_map_; + flutter::EncodableMap int_map_; }; // A class containing all supported nullable types. @@ -197,9 +212,6 @@ class AllNullableTypes { const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const flutter::EncodableValue* a_nullable_object, @@ -209,8 +221,9 @@ class AllNullableTypes { const flutter::EncodableList* int_list, const flutter::EncodableList* double_list, const flutter::EncodableList* bool_list, - const flutter::EncodableList* nested_class_list, - const flutter::EncodableMap* map); + const flutter::EncodableList* list_list, const flutter::EncodableMap* map, + const flutter::EncodableMap* string_map, + const flutter::EncodableMap* int_map); ~AllNullableTypes() = default; AllNullableTypes(const AllNullableTypes& other); @@ -249,20 +262,6 @@ class AllNullableTypes { void set_a_nullable_float_array(const std::vector* value_arg); void set_a_nullable_float_array(const std::vector& value_arg); - const flutter::EncodableList* nullable_nested_list() const; - void set_nullable_nested_list(const flutter::EncodableList* value_arg); - void set_nullable_nested_list(const flutter::EncodableList& value_arg); - - const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); - - const flutter::EncodableMap* nullable_map_with_object() const; - void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_object(const flutter::EncodableMap& value_arg); - const AnEnum* a_nullable_enum() const; void set_a_nullable_enum(const AnEnum* value_arg); void set_a_nullable_enum(const AnEnum& value_arg); @@ -303,14 +302,22 @@ class AllNullableTypes { void set_bool_list(const flutter::EncodableList* value_arg); void set_bool_list(const flutter::EncodableList& value_arg); - const flutter::EncodableList* nested_class_list() const; - void set_nested_class_list(const flutter::EncodableList* value_arg); - void set_nested_class_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* list_list() const; + void set_list_list(const flutter::EncodableList* value_arg); + void set_list_list(const flutter::EncodableList& value_arg); const flutter::EncodableMap* map() const; void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* string_map() const; + void set_string_map(const flutter::EncodableMap* value_arg); + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* int_map() const; + void set_int_map(const flutter::EncodableMap* value_arg); + void set_int_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -330,9 +337,6 @@ class AllNullableTypes { std::optional> a_nullable4_byte_array_; std::optional> a_nullable8_byte_array_; std::optional> a_nullable_float_array_; - std::optional nullable_nested_list_; - std::optional nullable_map_with_annotations_; - std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional another_nullable_enum_; std::optional a_nullable_string_; @@ -343,8 +347,10 @@ class AllNullableTypes { std::optional int_list_; std::optional double_list_; std::optional bool_list_; - std::optional nested_class_list_; + std::optional list_list_; std::optional map_; + std::optional string_map_; + std::optional int_map_; }; // The primary purpose for this class is to ensure coverage of Swift structs @@ -365,9 +371,6 @@ class AllNullableTypesWithoutRecursion { const std::vector* a_nullable4_byte_array, const std::vector* a_nullable8_byte_array, const std::vector* a_nullable_float_array, - const flutter::EncodableList* nullable_nested_list, - const flutter::EncodableMap* nullable_map_with_annotations, - const flutter::EncodableMap* nullable_map_with_object, const AnEnum* a_nullable_enum, const AnotherEnum* another_nullable_enum, const std::string* a_nullable_string, const flutter::EncodableValue* a_nullable_object, @@ -376,7 +379,9 @@ class AllNullableTypesWithoutRecursion { const flutter::EncodableList* int_list, const flutter::EncodableList* double_list, const flutter::EncodableList* bool_list, - const flutter::EncodableMap* map); + const flutter::EncodableList* list_list, const flutter::EncodableMap* map, + const flutter::EncodableMap* string_map, + const flutter::EncodableMap* int_map); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -410,20 +415,6 @@ class AllNullableTypesWithoutRecursion { void set_a_nullable_float_array(const std::vector* value_arg); void set_a_nullable_float_array(const std::vector& value_arg); - const flutter::EncodableList* nullable_nested_list() const; - void set_nullable_nested_list(const flutter::EncodableList* value_arg); - void set_nullable_nested_list(const flutter::EncodableList& value_arg); - - const flutter::EncodableMap* nullable_map_with_annotations() const; - void set_nullable_map_with_annotations( - const flutter::EncodableMap* value_arg); - void set_nullable_map_with_annotations( - const flutter::EncodableMap& value_arg); - - const flutter::EncodableMap* nullable_map_with_object() const; - void set_nullable_map_with_object(const flutter::EncodableMap* value_arg); - void set_nullable_map_with_object(const flutter::EncodableMap& value_arg); - const AnEnum* a_nullable_enum() const; void set_a_nullable_enum(const AnEnum* value_arg); void set_a_nullable_enum(const AnEnum& value_arg); @@ -460,10 +451,22 @@ class AllNullableTypesWithoutRecursion { void set_bool_list(const flutter::EncodableList* value_arg); void set_bool_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* list_list() const; + void set_list_list(const flutter::EncodableList* value_arg); + void set_list_list(const flutter::EncodableList& value_arg); + const flutter::EncodableMap* map() const; void set_map(const flutter::EncodableMap* value_arg); void set_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* string_map() const; + void set_string_map(const flutter::EncodableMap* value_arg); + void set_string_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* int_map() const; + void set_int_map(const flutter::EncodableMap* value_arg); + void set_int_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypesWithoutRecursion FromEncodableList( const flutter::EncodableList& list); @@ -484,9 +487,6 @@ class AllNullableTypesWithoutRecursion { std::optional> a_nullable4_byte_array_; std::optional> a_nullable8_byte_array_; std::optional> a_nullable_float_array_; - std::optional nullable_nested_list_; - std::optional nullable_map_with_annotations_; - std::optional nullable_map_with_object_; std::optional a_nullable_enum_; std::optional another_nullable_enum_; std::optional a_nullable_string_; @@ -496,7 +496,10 @@ class AllNullableTypesWithoutRecursion { std::optional int_list_; std::optional double_list_; std::optional bool_list_; + std::optional list_list_; std::optional map_; + std::optional string_map_; + std::optional int_map_; }; // A class for testing nested class handling. @@ -638,8 +641,14 @@ class HostIntegrationCoreApi { const flutter::EncodableList& list) = 0; // Returns the passed map, to test serialization and deserialization. virtual ErrorOr EchoMap( - const flutter::EncodableMap& a_map) = 0; - // Returns the passed map to test nested class serialization and + const flutter::EncodableMap& map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoStringMap( + const flutter::EncodableMap& string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr EchoIntMap( + const flutter::EncodableMap& int_map) = 0; + // Returns the passed class to test nested class serialization and // deserialization. virtual ErrorOr EchoClassWrapper( const AllClassesWrapper& wrapper) = 0; @@ -702,7 +711,13 @@ class HostIntegrationCoreApi { const flutter::EncodableList* a_nullable_list) = 0; // Returns the passed map, to test serialization and deserialization. virtual ErrorOr> EchoNullableMap( - const flutter::EncodableMap* a_nullable_map) = 0; + const flutter::EncodableMap* map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableStringMap( + const flutter::EncodableMap* string_map) = 0; + // Returns the passed map, to test serialization and deserialization. + virtual ErrorOr> EchoNullableIntMap( + const flutter::EncodableMap* int_map) = 0; virtual ErrorOr> EchoNullableEnum( const AnEnum* an_enum) = 0; virtual ErrorOr> EchoAnotherNullableEnum( @@ -746,7 +761,17 @@ class HostIntegrationCoreApi { // Returns the passed map, to test asynchronous serialization and // deserialization. virtual void EchoAsyncMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncStringMap( + const flutter::EncodableMap& string_map, + std::function reply)> result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncIntMap( + const flutter::EncodableMap& int_map, std::function reply)> result) = 0; // Returns the passed enum, to test asynchronous serialization and // deserialization. @@ -820,7 +845,19 @@ class HostIntegrationCoreApi { // Returns the passed map, to test asynchronous serialization and // deserialization. virtual void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> reply)> + result) = 0; + // Returns the passed map, to test asynchronous serialization and + // deserialization. + virtual void EchoAsyncNullableIntMap( + const flutter::EncodableMap* int_map, std::function> reply)> result) = 0; // Returns the passed enum, to test asynchronous serialization and @@ -878,7 +915,13 @@ class HostIntegrationCoreApi { const flutter::EncodableList& list, std::function reply)> result) = 0; virtual void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoStringMap( + const flutter::EncodableMap& string_map, + std::function reply)> result) = 0; + virtual void CallFlutterEchoIntMap( + const flutter::EncodableMap& int_map, std::function reply)> result) = 0; virtual void CallFlutterEchoEnum( const AnEnum& an_enum, @@ -908,7 +951,15 @@ class HostIntegrationCoreApi { std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> reply)> + result) = 0; + virtual void CallFlutterEchoNullableIntMap( + const flutter::EncodableMap* int_map, std::function> reply)> result) = 0; virtual void CallFlutterEchoNullableEnum( @@ -1012,9 +1063,19 @@ class FlutterIntegrationCoreApi { std::function&& on_success, std::function&& on_error); // Returns the passed map, to test serialization and deserialization. - void EchoMap(const flutter::EncodableMap& a_map, + void EchoMap(const flutter::EncodableMap& map, std::function&& on_success, std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoStringMap( + const flutter::EncodableMap& string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoIntMap( + const flutter::EncodableMap& int_map, + std::function&& on_success, + std::function&& on_error); // Returns the passed enum to test serialization and deserialization. void EchoEnum(const AnEnum& an_enum, std::function&& on_success, @@ -1051,7 +1112,17 @@ class FlutterIntegrationCoreApi { std::function&& on_error); // Returns the passed map, to test serialization and deserialization. void EchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function&& on_success, + std::function&& on_error); + // Returns the passed map, to test serialization and deserialization. + void EchoNullableIntMap( + const flutter::EncodableMap* int_map, std::function&& on_success, std::function&& on_error); // Returns the passed enum to test serialization and deserialization. diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp index da56b4a7576..8bbbf3edf9f 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test/null_fields_test.cpp @@ -92,9 +92,10 @@ TEST(NullFields, BuildReplyWithNulls) { } TEST_F(NullFieldsTest, RequestFromListWithValues) { + int64_t one = 1; EncodableList list{ EncodableValue("hello"), - EncodableValue(1), + EncodableValue(one), }; NullFieldsSearchRequest request = RequestFromList(list); @@ -103,9 +104,10 @@ TEST_F(NullFieldsTest, RequestFromListWithValues) { } TEST_F(NullFieldsTest, RequestFromListWithNulls) { + int64_t one = 1; EncodableList list{ EncodableValue(), - EncodableValue(1), + EncodableValue(one), }; NullFieldsSearchRequest request = RequestFromList(list); diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp index 89c0f3175ae..6a3bed759b4 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test/nullable_returns_test.cpp @@ -68,9 +68,10 @@ TEST(NullableReturns, HostNullableArgNonNull) { NullableArgHostApi::SetUp(&messenger, &api); int64_t result = 0; + int64_t seven = 7; messenger.SendHostMessage( "dev.flutter.pigeon.pigeon_integration_tests.NullableArgHostApi.doit", - EncodableValue(EncodableList({EncodableValue(7)})), + EncodableValue(EncodableList({EncodableValue(seven)})), [&result](const EncodableValue& reply) { result = GetResult(reply).LongValue(); }); diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp index e8f77369928..7ca42e238bf 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.cpp @@ -145,6 +145,15 @@ ErrorOr TestPlugin::EchoMap(const EncodableMap& a_map) { return a_map; } +ErrorOr TestPlugin::EchoStringMap( + const EncodableMap& string_map) { + return string_map; +} + +ErrorOr TestPlugin::EchoIntMap(const EncodableMap& int_map) { + return int_map; +} + ErrorOr TestPlugin::EchoClassWrapper( const AllClassesWrapper& wrapper) { return wrapper; @@ -283,11 +292,27 @@ ErrorOr> TestPlugin::EchoNullableList( }; ErrorOr> TestPlugin::EchoNullableMap( - const EncodableMap* a_nullable_map) { - if (!a_nullable_map) { + const EncodableMap* map) { + if (!map) { + return std::nullopt; + } + return *map; +}; + +ErrorOr> TestPlugin::EchoNullableStringMap( + const EncodableMap* string_map) { + if (!string_map) { + return std::nullopt; + } + return *string_map; +}; + +ErrorOr> TestPlugin::EchoNullableIntMap( + const EncodableMap* int_map) { + if (!int_map) { return std::nullopt; } - return *a_nullable_map; + return *int_map; }; ErrorOr> TestPlugin::EchoNullableEnum( @@ -387,9 +412,21 @@ void TestPlugin::EchoAsyncList( } void TestPlugin::EchoAsyncMap( - const EncodableMap& a_map, + const EncodableMap& map, std::function reply)> result) { - result(a_map); + result(map); +} + +void TestPlugin::EchoAsyncStringMap( + const EncodableMap& string_map, + std::function reply)> result) { + result(string_map); +} + +void TestPlugin::EchoAsyncIntMap( + const EncodableMap& int_map, + std::function reply)> result) { + result(int_map); } void TestPlugin::EchoAsyncEnum( @@ -466,9 +503,21 @@ void TestPlugin::EchoAsyncNullableList( } void TestPlugin::EchoAsyncNullableMap( - const EncodableMap* a_map, + const EncodableMap* map, + std::function> reply)> result) { + result(map ? std::optional(*map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableStringMap( + const EncodableMap* string_map, + std::function> reply)> result) { + result(string_map ? std::optional(*string_map) : std::nullopt); +} + +void TestPlugin::EchoAsyncNullableIntMap( + const EncodableMap* int_map, std::function> reply)> result) { - result(a_map ? std::optional(*a_map) : std::nullopt); + result(int_map ? std::optional(*int_map) : std::nullopt); } void TestPlugin::EchoAsyncNullableEnum( @@ -608,10 +657,26 @@ void TestPlugin::CallFlutterEchoList( } void TestPlugin::CallFlutterEchoMap( - const EncodableMap& a_map, + const EncodableMap& map, std::function reply)> result) { flutter_api_->EchoMap( - a_map, [result](const EncodableMap& echo) { result(echo); }, + map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoStringMap( + const EncodableMap& string_map, + std::function reply)> result) { + flutter_api_->EchoStringMap( + string_map, [result](const EncodableMap& echo) { result(echo); }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoIntMap( + const EncodableMap& int_map, + std::function reply)> result) { + flutter_api_->EchoIntMap( + int_map, [result](const EncodableMap& echo) { result(echo); }, [result](const FlutterError& error) { result(error); }); } @@ -699,10 +764,32 @@ void TestPlugin::CallFlutterEchoNullableList( } void TestPlugin::CallFlutterEchoNullableMap( - const EncodableMap* a_map, + const EncodableMap* map, std::function> reply)> result) { flutter_api_->EchoNullableMap( - a_map, + map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableStringMap( + const EncodableMap* string_map, + std::function> reply)> result) { + flutter_api_->EchoNullableStringMap( + string_map, + [result](const EncodableMap* echo) { + result(echo ? std::optional(*echo) : std::nullopt); + }, + [result](const FlutterError& error) { result(error); }); +} + +void TestPlugin::CallFlutterEchoNullableIntMap( + const EncodableMap* int_map, + std::function> reply)> result) { + flutter_api_->EchoNullableIntMap( + int_map, [result](const EncodableMap* echo) { result(echo ? std::optional(*echo) : std::nullopt); }, diff --git a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h index deb0ab62cb4..0febf4e1009 100644 --- a/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h +++ b/packages/pigeon/platform_tests/test_plugin/windows/test_plugin.h @@ -82,7 +82,11 @@ class TestPlugin : public flutter::Plugin, core_tests_pigeontest::ErrorOr EchoList( const flutter::EncodableList& a_list) override; core_tests_pigeontest::ErrorOr EchoMap( - const flutter::EncodableMap& a_map) override; + const flutter::EncodableMap& map) override; + core_tests_pigeontest::ErrorOr EchoStringMap( + const flutter::EncodableMap& string_map) override; + core_tests_pigeontest::ErrorOr EchoIntMap( + const flutter::EncodableMap& int_map) override; core_tests_pigeontest::ErrorOr EchoClassWrapper( const core_tests_pigeontest::AllClassesWrapper& wrapper) override; @@ -127,7 +131,11 @@ class TestPlugin : public flutter::Plugin, core_tests_pigeontest::ErrorOr> EchoNullableList(const flutter::EncodableList* a_nullable_list) override; core_tests_pigeontest::ErrorOr> - EchoNullableMap(const flutter::EncodableMap* a_nullable_map) override; + EchoNullableMap(const flutter::EncodableMap* map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableStringMap(const flutter::EncodableMap* string_map) override; + core_tests_pigeontest::ErrorOr> + EchoNullableIntMap(const flutter::EncodableMap* int_map) override; core_tests_pigeontest::ErrorOr> EchoNullableEnum(const core_tests_pigeontest::AnEnum* an_enum) override; core_tests_pigeontest::ErrorOr< @@ -206,7 +214,17 @@ class TestPlugin : public flutter::Plugin, void(core_tests_pigeontest::ErrorOr reply)> result) override; void EchoAsyncMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncStringMap( + const flutter::EncodableMap& string_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void EchoAsyncIntMap( + const flutter::EncodableMap& int_map, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; @@ -260,7 +278,19 @@ class TestPlugin : public flutter::Plugin, reply)> result) override; void EchoAsyncNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> + reply)> + result) override; + void EchoAsyncNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> + reply)> + result) override; + void EchoAsyncNullableIntMap( + const flutter::EncodableMap* int_map, std::function> reply)> @@ -351,7 +381,17 @@ class TestPlugin : public flutter::Plugin, void(core_tests_pigeontest::ErrorOr reply)> result) override; void CallFlutterEchoMap( - const flutter::EncodableMap& a_map, + const flutter::EncodableMap& map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoStringMap( + const flutter::EncodableMap& string_map, + std::function< + void(core_tests_pigeontest::ErrorOr reply)> + result) override; + void CallFlutterEchoIntMap( + const flutter::EncodableMap& int_map, std::function< void(core_tests_pigeontest::ErrorOr reply)> result) override; @@ -399,7 +439,19 @@ class TestPlugin : public flutter::Plugin, reply)> result) override; void CallFlutterEchoNullableMap( - const flutter::EncodableMap* a_map, + const flutter::EncodableMap* map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableStringMap( + const flutter::EncodableMap* string_map, + std::function> + reply)> + result) override; + void CallFlutterEchoNullableIntMap( + const flutter::EncodableMap* int_map, std::function> reply)> diff --git a/packages/pigeon/pubspec.yaml b/packages/pigeon/pubspec.yaml index 65d27bdb3fb..1422754831c 100644 --- a/packages/pigeon/pubspec.yaml +++ b/packages/pigeon/pubspec.yaml @@ -2,7 +2,7 @@ name: pigeon description: Code generator tool to make communication between Flutter and the host platform type-safe and easier. repository: https://github.com/flutter/packages/tree/main/packages/pigeon issue_tracker: https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+pigeon%22 -version: 21.2.0 # This must match the version in lib/generator_tools.dart +version: 22.0.0 # This must match the version in lib/generator_tools.dart environment: sdk: ^3.3.0 diff --git a/packages/pigeon/test/cpp_generator_test.dart b/packages/pigeon/test/cpp_generator_test.dart index edc074a4789..65a8f7ed8fd 100644 --- a/packages/pigeon/test/cpp_generator_test.dart +++ b/packages/pigeon/test/cpp_generator_test.dart @@ -1197,16 +1197,14 @@ void main() { code, contains( 'const auto* a_map_arg = std::get_if(&encodable_a_map_arg);')); - // Ints are complicated since there are two possible pointer types, but - // the parameter always needs an int64_t*. expect( code, contains( - 'const int64_t an_int_arg_value = encodable_an_int_arg.IsNull() ? 0 : encodable_an_int_arg.LongValue();')); + 'const auto* a_bool_arg = std::get_if(&encodable_a_bool_arg);')); expect( code, contains( - 'const auto* an_int_arg = encodable_an_int_arg.IsNull() ? nullptr : &an_int_arg_value;')); + 'const auto* an_int_arg = std::get_if(&encodable_an_int_arg);')); // Custom class types require an extra layer of extraction. expect( code, diff --git a/packages/pigeon/test/java_generator_test.dart b/packages/pigeon/test/java_generator_test.dart index b58fe1ef739..63a6e8330ea 100644 --- a/packages/pigeon/test/java_generator_test.dart +++ b/packages/pigeon/test/java_generator_test.dart @@ -776,8 +776,10 @@ void main() { ); final String code = sink.toString(); expect(code, contains('public enum Foo')); - expect(code, - contains('return value == null ? null : Foo.values()[(int) value];')); + expect( + code, + contains( + 'return value == null ? null : Foo.values()[((Long) value).intValue()];')); expect( code, contains( @@ -1040,10 +1042,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('public void doit(@NonNull Result result)')); - expect( - code, - contains( - 'Long output = listReply.get(0) == null ? null : ((Number) listReply.get(0)).longValue();')); + expect(code, contains('Long output = (Long) listReply.get(0);')); }); test('host multiple args', () { @@ -1080,12 +1079,9 @@ void main() { expect(code, contains('Long add(@NonNull Long x, @NonNull Long y)')); expect(code, contains('ArrayList args = (ArrayList) message;')); - expect(code, contains('Number xArg = (Number) args.get(0)')); - expect(code, contains('Number yArg = (Number) args.get(1)')); - expect( - code, - contains( - 'Long output = api.add((xArg == null) ? null : xArg.longValue(), (yArg == null) ? null : yArg.longValue())')); + expect(code, contains('Long xArg = (Long) args.get(0)')); + expect(code, contains('Long yArg = (Long) args.get(1)')); + expect(code, contains('Long output = api.add(xArg, yArg)')); }); test('if host argType is Object not cast', () { diff --git a/packages/pigeon/test/kotlin_generator_test.dart b/packages/pigeon/test/kotlin_generator_test.dart index 6f47e5b0672..549601b8851 100644 --- a/packages/pigeon/test/kotlin_generator_test.dart +++ b/packages/pigeon/test/kotlin_generator_test.dart @@ -133,7 +133,7 @@ void main() { expect(code, contains('val field1: Foo,')); expect(code, contains('val field2: String')); expect(code, contains('fun fromList(pigeonVar_list: List): Bar')); - expect(code, contains('Foo.ofRaw(it)')); + expect(code, contains('Foo.ofRaw(it.toInt())')); expect(code, contains('val field1 = pigeonVar_list[0] as Foo')); expect(code, contains('val field2 = pigeonVar_list[1] as String\n')); expect(code, contains('fun toList(): List')); @@ -173,7 +173,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('enum class Foo(val raw: Int) {')); - expect(code, contains('Foo.ofRaw(it)')); + expect(code, contains('Foo.ofRaw(it.toInt())')); }); test('gen one host api', () { @@ -391,10 +391,6 @@ void main() { expect(code, contains('val aInt32List: IntArray')); expect(code, contains('val aInt64List: LongArray')); expect(code, contains('val aFloat64List: DoubleArray')); - expect( - code, - contains( - 'val aInt = pigeonVar_list[1].let { num -> if (num is Int) num.toLong() else num as Long }')); expect(code, contains('val aNullableBool: Boolean? = null')); expect(code, contains('val aNullableInt: Long? = null')); expect(code, contains('val aNullableDouble: Double? = null')); @@ -403,10 +399,6 @@ void main() { expect(code, contains('val aNullableInt32List: IntArray? = null')); expect(code, contains('val aNullableInt64List: LongArray? = null')); expect(code, contains('val aNullableFloat64List: DoubleArray? = null')); - expect( - code, - contains( - 'val aNullableInt = pigeonVar_list[9].let { num -> if (num is Int) num.toLong() else num as Long? }')); }); test('gen one flutter api', () { @@ -1163,14 +1155,6 @@ void main() { final String code = sink.toString(); expect(code, contains('fun add(x: Long, y: Long): Long')); expect(code, contains('val args = message as List')); - expect( - code, - contains( - 'val xArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long }')); - expect( - code, - contains( - 'val yArg = args[1].let { num -> if (num is Int) num.toLong() else num as Long }')); expect(code, contains('listOf(api.add(xArg, yArg))')); expect(code, contains('reply.reply(wrapped)')); }); @@ -1206,11 +1190,6 @@ void main() { ); final String code = sink.toString(); expect(code, contains('val channel = BasicMessageChannel')); - expect( - code, - contains( - 'val output = it[0].let { num -> if (num is Int) num.toLong() else num as Long }'), - ); expect(code, contains('callback(Result.success(output))')); expect( code, @@ -1311,10 +1290,7 @@ void main() { dartPackageName: DEFAULT_PACKAGE_NAME, ); final String code = sink.toString(); - expect( - code, - contains( - 'val fooArg = args[0].let { num -> if (num is Int) num.toLong() else num as Long? }')); + expect(code, contains('val fooArg = args[0]')); }); test('nullable argument flutter', () { diff --git a/packages/pigeon/test/swift_generator_test.dart b/packages/pigeon/test/swift_generator_test.dart index b90db1e1f24..8a86ec77251 100644 --- a/packages/pigeon/test/swift_generator_test.dart +++ b/packages/pigeon/test/swift_generator_test.dart @@ -535,7 +535,7 @@ void main() { ); final String code = sink.toString(); expect(code, contains('struct Foobar')); - expect(code, contains('var field1: [AnyHashable: Any?]? = nil')); + expect(code, contains('var field1: [AnyHashable?: Any?]? = nil')); expect(code, isNot(contains('if ('))); });