diff --git a/packages/pigeon/pigeons/core_tests.dart b/packages/pigeon/pigeons/core_tests.dart index dd2c81fe36de..a644ce5b3e00 100644 --- a/packages/pigeon/pigeons/core_tests.dart +++ b/packages/pigeon/pigeons/core_tests.dart @@ -52,6 +52,7 @@ class AllTypes { required this.enumList, required this.objectList, required this.listList, + required this.mapList, // Maps required this.map, @@ -59,6 +60,8 @@ class AllTypes { required this.intMap, required this.enumMap, required this.objectMap, + required this.listMap, + required this.mapMap, }); bool aBool; @@ -84,6 +87,7 @@ class AllTypes { List enumList; List objectList; List> listList; + List> mapList; // Maps // ignore: strict_raw_type, always_specify_types @@ -92,6 +96,8 @@ class AllTypes { Map intMap; Map enumMap; Map objectMap; + Map> listMap; + Map> mapMap; } /// A class containing all supported nullable types. @@ -123,6 +129,7 @@ class AllNullableTypes { this.enumList, this.objectList, this.listList, + this.mapList, this.recursiveClassList, // Maps @@ -131,6 +138,8 @@ class AllNullableTypes { this.intMap, this.enumMap, this.objectMap, + this.listMap, + this.mapMap, this.recursiveClassMap, ); @@ -158,6 +167,7 @@ class AllNullableTypes { List? enumList; List? objectList; List?>? listList; + List?>? mapList; List? recursiveClassList; // Maps @@ -167,6 +177,8 @@ class AllNullableTypes { Map? intMap; Map? enumMap; Map? objectMap; + Map?>? listMap; + Map?>? mapMap; Map? recursiveClassMap; } @@ -199,6 +211,7 @@ class AllNullableTypesWithoutRecursion { this.enumList, this.objectList, this.listList, + this.mapList, // Maps this.map, @@ -206,6 +219,8 @@ class AllNullableTypesWithoutRecursion { this.intMap, this.enumMap, this.objectMap, + this.listMap, + this.mapMap, ); bool? aNullableBool; @@ -231,6 +246,7 @@ class AllNullableTypesWithoutRecursion { List? enumList; List? objectList; List?>? listList; + List?>? mapList; // Maps // ignore: strict_raw_type, always_specify_types @@ -239,6 +255,8 @@ class AllNullableTypesWithoutRecursion { Map? intMap; Map? enumMap; Map? objectMap; + Map?>? listMap; + Map?>? mapMap; } /// A class for testing nested class handling. 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 bd306279ee7f..4707969aab13 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 @@ -426,6 +426,19 @@ public void setListList(@NonNull List> setterArg) { this.listList = setterArg; } + private @NonNull List> mapList; + + public @NonNull List> getMapList() { + return mapList; + } + + public void setMapList(@NonNull List> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"mapList\" is null."); + } + this.mapList = setterArg; + } + private @NonNull Map map; public @NonNull Map getMap() { @@ -491,6 +504,32 @@ public void setObjectMap(@NonNull Map setterArg) { this.objectMap = setterArg; } + private @NonNull Map> listMap; + + public @NonNull Map> getListMap() { + return listMap; + } + + public void setListMap(@NonNull Map> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"listMap\" is null."); + } + this.listMap = setterArg; + } + + private @NonNull Map> mapMap; + + public @NonNull Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@NonNull Map> setterArg) { + if (setterArg == null) { + throw new IllegalStateException("Nonnull field \"mapMap\" is null."); + } + this.mapMap = setterArg; + } + /** Constructor is non-public to enforce null safety; use Builder. */ AllTypes() {} @@ -523,11 +562,14 @@ public boolean equals(Object o) { && enumList.equals(that.enumList) && objectList.equals(that.objectList) && listList.equals(that.listList) + && mapList.equals(that.mapList) && map.equals(that.map) && stringMap.equals(that.stringMap) && intMap.equals(that.intMap) && enumMap.equals(that.enumMap) - && objectMap.equals(that.objectMap); + && objectMap.equals(that.objectMap) + && listMap.equals(that.listMap) + && mapMap.equals(that.mapMap); } @Override @@ -550,11 +592,14 @@ public int hashCode() { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, - objectMap); + objectMap, + listMap, + mapMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(a8ByteArray); @@ -724,6 +769,14 @@ public static final class Builder { return this; } + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@NonNull List> setterArg) { + this.mapList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -764,6 +817,22 @@ public static final class Builder { return this; } + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@NonNull Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@NonNull Map> setterArg) { + this.mapMap = setterArg; + return this; + } + public @NonNull AllTypes build() { AllTypes pigeonReturn = new AllTypes(); pigeonReturn.setABool(aBool); @@ -786,18 +855,21 @@ public static final class Builder { pigeonReturn.setEnumList(enumList); pigeonReturn.setObjectList(objectList); pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); pigeonReturn.setMap(map); pigeonReturn.setStringMap(stringMap); pigeonReturn.setIntMap(intMap); pigeonReturn.setEnumMap(enumMap); pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(25); + ArrayList toListResult = new ArrayList<>(28); toListResult.add(aBool); toListResult.add(anInt); toListResult.add(anInt64); @@ -818,11 +890,14 @@ ArrayList toList() { toListResult.add(enumList); toListResult.add(objectList); toListResult.add(listList); + toListResult.add(mapList); toListResult.add(map); toListResult.add(stringMap); toListResult.add(intMap); toListResult.add(enumMap); toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); return toListResult; } @@ -868,16 +943,22 @@ ArrayList toList() { pigeonResult.setObjectList((List) objectList); Object listList = pigeonVar_list.get(19); pigeonResult.setListList((List>) listList); - Object map = pigeonVar_list.get(20); + Object mapList = pigeonVar_list.get(20); + pigeonResult.setMapList((List>) mapList); + Object map = pigeonVar_list.get(21); pigeonResult.setMap((Map) map); - Object stringMap = pigeonVar_list.get(21); + Object stringMap = pigeonVar_list.get(22); pigeonResult.setStringMap((Map) stringMap); - Object intMap = pigeonVar_list.get(22); + Object intMap = pigeonVar_list.get(23); pigeonResult.setIntMap((Map) intMap); - Object enumMap = pigeonVar_list.get(23); + Object enumMap = pigeonVar_list.get(24); pigeonResult.setEnumMap((Map) enumMap); - Object objectMap = pigeonVar_list.get(24); + Object objectMap = pigeonVar_list.get(25); pigeonResult.setObjectMap((Map) objectMap); + Object listMap = pigeonVar_list.get(26); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(27); + pigeonResult.setMapMap((Map>) mapMap); return pigeonResult; } } @@ -1098,6 +1179,16 @@ public void setListList(@Nullable List> setterArg) { this.listList = setterArg; } + private @Nullable List> mapList; + + public @Nullable List> getMapList() { + return mapList; + } + + public void setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + } + private @Nullable List recursiveClassList; public @Nullable List getRecursiveClassList() { @@ -1158,6 +1249,26 @@ public void setObjectMap(@Nullable Map setterArg) { this.objectMap = setterArg; } + private @Nullable Map> listMap; + + public @Nullable Map> getListMap() { + return listMap; + } + + public void setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + } + + private @Nullable Map> mapMap; + + public @Nullable Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + } + private @Nullable Map recursiveClassMap; public @Nullable Map getRecursiveClassMap() { @@ -1198,12 +1309,15 @@ public boolean equals(Object o) { && Objects.equals(enumList, that.enumList) && Objects.equals(objectList, that.objectList) && Objects.equals(listList, that.listList) + && Objects.equals(mapList, that.mapList) && Objects.equals(recursiveClassList, that.recursiveClassList) && Objects.equals(map, that.map) && Objects.equals(stringMap, that.stringMap) && Objects.equals(intMap, that.intMap) && Objects.equals(enumMap, that.enumMap) && Objects.equals(objectMap, that.objectMap) + && Objects.equals(listMap, that.listMap) + && Objects.equals(mapMap, that.mapMap) && Objects.equals(recursiveClassMap, that.recursiveClassMap); } @@ -1228,12 +1342,15 @@ public int hashCode() { enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); @@ -1412,6 +1529,14 @@ public static final class Builder { return this; } + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + return this; + } + private @Nullable List recursiveClassList; @CanIgnoreReturnValue @@ -1460,6 +1585,22 @@ public static final class Builder { return this; } + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + return this; + } + private @Nullable Map recursiveClassMap; @CanIgnoreReturnValue @@ -1492,12 +1633,15 @@ public static final class Builder { pigeonReturn.setEnumList(enumList); pigeonReturn.setObjectList(objectList); pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); pigeonReturn.setRecursiveClassList(recursiveClassList); pigeonReturn.setMap(map); pigeonReturn.setStringMap(stringMap); pigeonReturn.setIntMap(intMap); pigeonReturn.setEnumMap(enumMap); pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); pigeonReturn.setRecursiveClassMap(recursiveClassMap); return pigeonReturn; } @@ -1505,7 +1649,7 @@ public static final class Builder { @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(28); + ArrayList toListResult = new ArrayList<>(31); toListResult.add(aNullableBool); toListResult.add(aNullableInt); toListResult.add(aNullableInt64); @@ -1527,12 +1671,15 @@ ArrayList toList() { toListResult.add(enumList); toListResult.add(objectList); toListResult.add(listList); + toListResult.add(mapList); toListResult.add(recursiveClassList); toListResult.add(map); toListResult.add(stringMap); toListResult.add(intMap); toListResult.add(enumMap); toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); toListResult.add(recursiveClassMap); return toListResult; } @@ -1581,19 +1728,25 @@ ArrayList toList() { pigeonResult.setObjectList((List) objectList); Object listList = pigeonVar_list.get(20); pigeonResult.setListList((List>) listList); - Object recursiveClassList = pigeonVar_list.get(21); + Object mapList = pigeonVar_list.get(21); + pigeonResult.setMapList((List>) mapList); + Object recursiveClassList = pigeonVar_list.get(22); pigeonResult.setRecursiveClassList((List) recursiveClassList); - Object map = pigeonVar_list.get(22); + Object map = pigeonVar_list.get(23); pigeonResult.setMap((Map) map); - Object stringMap = pigeonVar_list.get(23); + Object stringMap = pigeonVar_list.get(24); pigeonResult.setStringMap((Map) stringMap); - Object intMap = pigeonVar_list.get(24); + Object intMap = pigeonVar_list.get(25); pigeonResult.setIntMap((Map) intMap); - Object enumMap = pigeonVar_list.get(25); + Object enumMap = pigeonVar_list.get(26); pigeonResult.setEnumMap((Map) enumMap); - Object objectMap = pigeonVar_list.get(26); + Object objectMap = pigeonVar_list.get(27); pigeonResult.setObjectMap((Map) objectMap); - Object recursiveClassMap = pigeonVar_list.get(27); + Object listMap = pigeonVar_list.get(28); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(29); + pigeonResult.setMapMap((Map>) mapMap); + Object recursiveClassMap = pigeonVar_list.get(30); pigeonResult.setRecursiveClassMap((Map) recursiveClassMap); return pigeonResult; } @@ -1806,6 +1959,16 @@ public void setListList(@Nullable List> setterArg) { this.listList = setterArg; } + private @Nullable List> mapList; + + public @Nullable List> getMapList() { + return mapList; + } + + public void setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + } + private @Nullable Map map; public @Nullable Map getMap() { @@ -1856,6 +2019,26 @@ public void setObjectMap(@Nullable Map setterArg) { this.objectMap = setterArg; } + private @Nullable Map> listMap; + + public @Nullable Map> getListMap() { + return listMap; + } + + public void setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + } + + private @Nullable Map> mapMap; + + public @Nullable Map> getMapMap() { + return mapMap; + } + + public void setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + } + @Override public boolean equals(Object o) { if (this == o) { @@ -1885,11 +2068,14 @@ public boolean equals(Object o) { && Objects.equals(enumList, that.enumList) && Objects.equals(objectList, that.objectList) && Objects.equals(listList, that.listList) + && Objects.equals(mapList, that.mapList) && Objects.equals(map, that.map) && Objects.equals(stringMap, that.stringMap) && Objects.equals(intMap, that.intMap) && Objects.equals(enumMap, that.enumMap) - && Objects.equals(objectMap, that.objectMap); + && Objects.equals(objectMap, that.objectMap) + && Objects.equals(listMap, that.listMap) + && Objects.equals(mapMap, that.mapMap); } @Override @@ -1912,11 +2098,14 @@ public int hashCode() { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, - objectMap); + objectMap, + listMap, + mapMap); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullableByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable4ByteArray); pigeonVar_result = 31 * pigeonVar_result + Arrays.hashCode(aNullable8ByteArray); @@ -2086,6 +2275,14 @@ public static final class Builder { return this; } + private @Nullable List> mapList; + + @CanIgnoreReturnValue + public @NonNull Builder setMapList(@Nullable List> setterArg) { + this.mapList = setterArg; + return this; + } + private @Nullable Map map; @CanIgnoreReturnValue @@ -2126,6 +2323,22 @@ public static final class Builder { return this; } + private @Nullable Map> listMap; + + @CanIgnoreReturnValue + public @NonNull Builder setListMap(@Nullable Map> setterArg) { + this.listMap = setterArg; + return this; + } + + private @Nullable Map> mapMap; + + @CanIgnoreReturnValue + public @NonNull Builder setMapMap(@Nullable Map> setterArg) { + this.mapMap = setterArg; + return this; + } + public @NonNull AllNullableTypesWithoutRecursion build() { AllNullableTypesWithoutRecursion pigeonReturn = new AllNullableTypesWithoutRecursion(); pigeonReturn.setANullableBool(aNullableBool); @@ -2148,18 +2361,21 @@ public static final class Builder { pigeonReturn.setEnumList(enumList); pigeonReturn.setObjectList(objectList); pigeonReturn.setListList(listList); + pigeonReturn.setMapList(mapList); pigeonReturn.setMap(map); pigeonReturn.setStringMap(stringMap); pigeonReturn.setIntMap(intMap); pigeonReturn.setEnumMap(enumMap); pigeonReturn.setObjectMap(objectMap); + pigeonReturn.setListMap(listMap); + pigeonReturn.setMapMap(mapMap); return pigeonReturn; } } @NonNull ArrayList toList() { - ArrayList toListResult = new ArrayList<>(25); + ArrayList toListResult = new ArrayList<>(28); toListResult.add(aNullableBool); toListResult.add(aNullableInt); toListResult.add(aNullableInt64); @@ -2180,11 +2396,14 @@ ArrayList toList() { toListResult.add(enumList); toListResult.add(objectList); toListResult.add(listList); + toListResult.add(mapList); toListResult.add(map); toListResult.add(stringMap); toListResult.add(intMap); toListResult.add(enumMap); toListResult.add(objectMap); + toListResult.add(listMap); + toListResult.add(mapMap); return toListResult; } @@ -2231,16 +2450,22 @@ ArrayList toList() { pigeonResult.setObjectList((List) objectList); Object listList = pigeonVar_list.get(19); pigeonResult.setListList((List>) listList); - Object map = pigeonVar_list.get(20); + Object mapList = pigeonVar_list.get(20); + pigeonResult.setMapList((List>) mapList); + Object map = pigeonVar_list.get(21); pigeonResult.setMap((Map) map); - Object stringMap = pigeonVar_list.get(21); + Object stringMap = pigeonVar_list.get(22); pigeonResult.setStringMap((Map) stringMap); - Object intMap = pigeonVar_list.get(22); + Object intMap = pigeonVar_list.get(23); pigeonResult.setIntMap((Map) intMap); - Object enumMap = pigeonVar_list.get(23); + Object enumMap = pigeonVar_list.get(24); pigeonResult.setEnumMap((Map) enumMap); - Object objectMap = pigeonVar_list.get(24); + Object objectMap = pigeonVar_list.get(25); pigeonResult.setObjectMap((Map) objectMap); + Object listMap = pigeonVar_list.get(26); + pigeonResult.setListMap((Map>) listMap); + Object mapMap = pigeonVar_list.get(27); + pigeonResult.setMapMap((Map>) mapMap); return pigeonResult; } } 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 2d95c14dc64f..d873a0ffe428 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 @@ -16,6 +16,7 @@ import java.util.Arrays; import java.util.HashMap; import java.util.List; +import java.util.Map; import org.junit.Test; public class AllDatatypesTest { @@ -170,7 +171,13 @@ public void hasValues() { // Not inline due to warnings about an ambiguous varargs call when inline. final List genericList = Arrays.asList(new Object[] {"hello", 1, true, false, null}); final List> listList = new ArrayList<>(Arrays.asList()); + final List> mapList = new ArrayList<>(Arrays.asList()); + final Map> listMap = new HashMap>(); + final Map> mapMap = new HashMap>(); listList.add(genericList); + mapList.add(makeMap("hello", 1234)); + listMap.put(1L, genericList); + mapMap.put(1L, makeMap("hello", 1234)); AllTypes allEverything = new AllTypes.Builder() .setABool(false) @@ -195,11 +202,14 @@ public void hasValues() { Arrays.asList( new CoreTests.AnEnum[] {CoreTests.AnEnum.ONE, CoreTests.AnEnum.FORTY_TWO})) .setListList(listList) + .setMapList(mapList) .setMap(makeMap("hello", 1234)) .setIntMap(makeMap(1L, 0L)) .setStringMap(makeMap("hello", "you")) .setObjectMap(makeMap("E", 4321)) .setEnumMap(makeMap(CoreTests.AnEnum.ONE, CoreTests.AnEnum.FOUR_HUNDRED_TWENTY_TWO)) + .setListMap(listMap) + .setMapMap(mapMap) .build(); AllNullableTypes everything = 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 1b72e5e1c0db..b4ebec5f9c70 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 @@ -67,10 +67,15 @@ - (void)testAllEquals { everything.stringList = @[ @"string", @"another one" ]; everything.objectList = @[ @"string", @1 ]; everything.listList = @[ @[ @"string" ], @[ @"another one" ] ]; + everything.mapList = @[ + @{@"hello" : @(1234), @"goodbye" : @"world"}, @{@"hello" : @(1234), @"goodbye" : @"world"} + ]; everything.map = @{@"hello" : @(1234), @"goodbye" : @"world"}; everything.stringMap = @{@"hello" : @"you", @"goodbye" : @"world"}; everything.intMap = @{@(1) : @(0), @(2) : @(-2)}; everything.objectMap = @{@"hello" : @(1234), @"goodbye" : @"world"}; + everything.listMap = @{@(1234) : @[ @"string", @"another one" ]}; + everything.mapMap = @{@(1234) : @{@"goodbye" : @"world"}}; EchoBinaryMessenger *binaryMessenger = [[EchoBinaryMessenger alloc] initWithCodec:FLTGetCoreTestsCodec()]; FLTFlutterIntegrationCoreApi *api = @@ -97,10 +102,13 @@ - (void)testAllEquals { XCTAssertEqualObjects(result.stringList, everything.stringList); XCTAssertEqualObjects(result.objectList, everything.objectList); XCTAssertEqualObjects(result.listList, everything.listList); + XCTAssertEqualObjects(result.mapList, everything.mapList); XCTAssertEqualObjects(result.map, everything.map); XCTAssertEqualObjects(result.stringMap, everything.stringMap); XCTAssertEqualObjects(result.intMap, everything.intMap); XCTAssertEqualObjects(result.objectMap, everything.objectMap); + XCTAssertEqualObjects(result.listMap, everything.listMap); + XCTAssertEqualObjects(result.mapMap, everything.mapMap); [expectation fulfill]; }]; [self waitForExpectations:@[ expectation ] timeout:1.0]; 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 822cdf7aa57b..bd913ca95a9e 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 @@ -74,11 +74,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { enumList:(NSArray *)enumList objectList:(NSArray *)objectList listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList map:(NSDictionary *)map stringMap:(NSDictionary *)stringMap intMap:(NSDictionary *)intMap enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap; + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -99,11 +102,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy) NSArray *enumList; @property(nonatomic, copy) NSArray *objectList; @property(nonatomic, copy) NSArray *> *listList; +@property(nonatomic, copy) NSArray *> *mapList; @property(nonatomic, copy) NSDictionary *map; @property(nonatomic, copy) NSDictionary *stringMap; @property(nonatomic, copy) NSDictionary *intMap; @property(nonatomic, copy) NSDictionary *enumMap; @property(nonatomic, copy) NSDictionary *objectMap; +@property(nonatomic, copy) NSDictionary *> *listMap; +@property(nonatomic, copy) NSDictionary *> *mapMap; @end /// A class containing all supported nullable types. @@ -130,12 +136,15 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { enumList:(nullable NSArray *)enumList objectList:(nullable NSArray *)objectList listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList recursiveClassList:(nullable NSArray *)recursiveClassList map:(nullable NSDictionary *)map stringMap:(nullable NSDictionary *)stringMap intMap:(nullable NSDictionary *)intMap enumMap:(nullable NSDictionary *)enumMap objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap recursiveClassMap: (nullable NSDictionary *)recursiveClassMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @@ -159,12 +168,15 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *enumList; @property(nonatomic, copy, nullable) NSArray *objectList; @property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSArray *recursiveClassList; @property(nonatomic, copy, nullable) NSDictionary *map; @property(nonatomic, copy, nullable) NSDictionary *stringMap; @property(nonatomic, copy, nullable) NSDictionary *intMap; @property(nonatomic, copy, nullable) NSDictionary *enumMap; @property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @property(nonatomic, copy, nullable) NSDictionary *recursiveClassMap; @end @@ -173,32 +185,35 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { /// with nullable items, as the primary [AllNullableTypes] class is being used to /// test Swift classes. @interface FLTAllNullableTypesWithoutRecursion : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap: - (nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap; ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -219,11 +234,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *enumList; @property(nonatomic, copy, nullable) NSArray *objectList; @property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSDictionary *map; @property(nonatomic, copy, nullable) NSDictionary *stringMap; @property(nonatomic, copy, nullable) NSDictionary *intMap; @property(nonatomic, copy, nullable) NSDictionary *enumMap; @property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @end /// A class for testing nested class handling. 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 3bbd52011cb0..2cc3da7877d8 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 @@ -138,11 +138,14 @@ + (instancetype)makeWithABool:(BOOL)aBool enumList:(NSArray *)enumList objectList:(NSArray *)objectList listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList map:(NSDictionary *)map stringMap:(NSDictionary *)stringMap intMap:(NSDictionary *)intMap enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap { + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap { FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; @@ -164,11 +167,14 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllTypes *)fromList:(NSArray *)list { @@ -195,11 +201,14 @@ + (FLTAllTypes *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 21); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @@ -227,11 +236,14 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end @@ -259,12 +271,15 @@ @implementation FLTAllNullableTypes enumList:(nullable NSArray *)enumList objectList:(nullable NSArray *)objectList listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList recursiveClassList:(nullable NSArray *)recursiveClassList map:(nullable NSDictionary *)map stringMap:(nullable NSDictionary *)stringMap intMap:(nullable NSDictionary *)intMap enumMap:(nullable NSDictionary *)enumMap objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap recursiveClassMap: (nullable NSDictionary *)recursiveClassMap { FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; @@ -289,12 +304,15 @@ @implementation FLTAllNullableTypes pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.recursiveClassList = recursiveClassList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; pigeonResult.recursiveClassMap = recursiveClassMap; return pigeonResult; } @@ -321,13 +339,16 @@ + (FLTAllNullableTypes *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 18); pigeonResult.objectList = GetNullableObjectAtIndex(list, 19); pigeonResult.listList = GetNullableObjectAtIndex(list, 20); - pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 24); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 25); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 26); - pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 21); + pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 22); + pigeonResult.map = GetNullableObjectAtIndex(list, 23); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 28); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 29); + pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 30); return pigeonResult; } + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @@ -356,44 +377,50 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.recursiveClassList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], self.recursiveClassMap ?: [NSNull null], ]; } @end @implementation FLTAllNullableTypesWithoutRecursion -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap: - (nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap { ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap { FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; @@ -416,11 +443,14 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { @@ -446,11 +476,14 @@ + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 21); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { @@ -478,11 +511,14 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end 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 822cdf7aa57b..bd913ca95a9e 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 @@ -74,11 +74,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { enumList:(NSArray *)enumList objectList:(NSArray *)objectList listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList map:(NSDictionary *)map stringMap:(NSDictionary *)stringMap intMap:(NSDictionary *)intMap enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap; + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap; @property(nonatomic, assign) BOOL aBool; @property(nonatomic, assign) NSInteger anInt; @property(nonatomic, assign) NSInteger anInt64; @@ -99,11 +102,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy) NSArray *enumList; @property(nonatomic, copy) NSArray *objectList; @property(nonatomic, copy) NSArray *> *listList; +@property(nonatomic, copy) NSArray *> *mapList; @property(nonatomic, copy) NSDictionary *map; @property(nonatomic, copy) NSDictionary *stringMap; @property(nonatomic, copy) NSDictionary *intMap; @property(nonatomic, copy) NSDictionary *enumMap; @property(nonatomic, copy) NSDictionary *objectMap; +@property(nonatomic, copy) NSDictionary *> *listMap; +@property(nonatomic, copy) NSDictionary *> *mapMap; @end /// A class containing all supported nullable types. @@ -130,12 +136,15 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { enumList:(nullable NSArray *)enumList objectList:(nullable NSArray *)objectList listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList recursiveClassList:(nullable NSArray *)recursiveClassList map:(nullable NSDictionary *)map stringMap:(nullable NSDictionary *)stringMap intMap:(nullable NSDictionary *)intMap enumMap:(nullable NSDictionary *)enumMap objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap recursiveClassMap: (nullable NSDictionary *)recursiveClassMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @@ -159,12 +168,15 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *enumList; @property(nonatomic, copy, nullable) NSArray *objectList; @property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSArray *recursiveClassList; @property(nonatomic, copy, nullable) NSDictionary *map; @property(nonatomic, copy, nullable) NSDictionary *stringMap; @property(nonatomic, copy, nullable) NSDictionary *intMap; @property(nonatomic, copy, nullable) NSDictionary *enumMap; @property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @property(nonatomic, copy, nullable) NSDictionary *recursiveClassMap; @end @@ -173,32 +185,35 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { /// with nullable items, as the primary [AllNullableTypes] class is being used to /// test Swift classes. @interface FLTAllNullableTypesWithoutRecursion : NSObject -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap: - (nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap; ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap; @property(nonatomic, strong, nullable) NSNumber *aNullableBool; @property(nonatomic, strong, nullable) NSNumber *aNullableInt; @property(nonatomic, strong, nullable) NSNumber *aNullableInt64; @@ -219,11 +234,14 @@ typedef NS_ENUM(NSUInteger, FLTAnotherEnum) { @property(nonatomic, copy, nullable) NSArray *enumList; @property(nonatomic, copy, nullable) NSArray *objectList; @property(nonatomic, copy, nullable) NSArray *> *listList; +@property(nonatomic, copy, nullable) NSArray *> *mapList; @property(nonatomic, copy, nullable) NSDictionary *map; @property(nonatomic, copy, nullable) NSDictionary *stringMap; @property(nonatomic, copy, nullable) NSDictionary *intMap; @property(nonatomic, copy, nullable) NSDictionary *enumMap; @property(nonatomic, copy, nullable) NSDictionary *objectMap; +@property(nonatomic, copy, nullable) NSDictionary *> *listMap; +@property(nonatomic, copy, nullable) NSDictionary *> *mapMap; @end /// A class for testing nested class handling. 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 3bbd52011cb0..2cc3da7877d8 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 @@ -138,11 +138,14 @@ + (instancetype)makeWithABool:(BOOL)aBool enumList:(NSArray *)enumList objectList:(NSArray *)objectList listList:(NSArray *> *)listList + mapList:(NSArray *> *)mapList map:(NSDictionary *)map stringMap:(NSDictionary *)stringMap intMap:(NSDictionary *)intMap enumMap:(NSDictionary *)enumMap - objectMap:(NSDictionary *)objectMap { + objectMap:(NSDictionary *)objectMap + listMap:(NSDictionary *> *)listMap + mapMap:(NSDictionary *> *)mapMap { FLTAllTypes *pigeonResult = [[FLTAllTypes alloc] init]; pigeonResult.aBool = aBool; pigeonResult.anInt = anInt; @@ -164,11 +167,14 @@ + (instancetype)makeWithABool:(BOOL)aBool pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllTypes *)fromList:(NSArray *)list { @@ -195,11 +201,14 @@ + (FLTAllTypes *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 21); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { @@ -227,11 +236,14 @@ + (nullable FLTAllTypes *)nullableFromList:(NSArray *)list { self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end @@ -259,12 +271,15 @@ @implementation FLTAllNullableTypes enumList:(nullable NSArray *)enumList objectList:(nullable NSArray *)objectList listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList recursiveClassList:(nullable NSArray *)recursiveClassList map:(nullable NSDictionary *)map stringMap:(nullable NSDictionary *)stringMap intMap:(nullable NSDictionary *)intMap enumMap:(nullable NSDictionary *)enumMap objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap recursiveClassMap: (nullable NSDictionary *)recursiveClassMap { FLTAllNullableTypes *pigeonResult = [[FLTAllNullableTypes alloc] init]; @@ -289,12 +304,15 @@ @implementation FLTAllNullableTypes pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.recursiveClassList = recursiveClassList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; pigeonResult.recursiveClassMap = recursiveClassMap; return pigeonResult; } @@ -321,13 +339,16 @@ + (FLTAllNullableTypes *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 18); pigeonResult.objectList = GetNullableObjectAtIndex(list, 19); pigeonResult.listList = GetNullableObjectAtIndex(list, 20); - pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 21); - pigeonResult.map = GetNullableObjectAtIndex(list, 22); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 24); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 25); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 26); - pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 21); + pigeonResult.recursiveClassList = GetNullableObjectAtIndex(list, 22); + pigeonResult.map = GetNullableObjectAtIndex(list, 23); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 27); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 28); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 29); + pigeonResult.recursiveClassMap = GetNullableObjectAtIndex(list, 30); return pigeonResult; } + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { @@ -356,44 +377,50 @@ + (nullable FLTAllNullableTypes *)nullableFromList:(NSArray *)list { self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.recursiveClassList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], self.recursiveClassMap ?: [NSNull null], ]; } @end @implementation FLTAllNullableTypesWithoutRecursion -+ (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool - aNullableInt:(nullable NSNumber *)aNullableInt - aNullableInt64:(nullable NSNumber *)aNullableInt64 - aNullableDouble:(nullable NSNumber *)aNullableDouble - aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray - aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray - aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray - aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray - aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum - anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum - aNullableString:(nullable NSString *)aNullableString - aNullableObject:(nullable id)aNullableObject - list:(nullable NSArray *)list - stringList:(nullable NSArray *)stringList - intList:(nullable NSArray *)intList - doubleList:(nullable NSArray *)doubleList - boolList:(nullable NSArray *)boolList - enumList:(nullable NSArray *)enumList - objectList:(nullable NSArray *)objectList - listList:(nullable NSArray *> *)listList - map:(nullable NSDictionary *)map - stringMap:(nullable NSDictionary *)stringMap - intMap:(nullable NSDictionary *)intMap - enumMap: - (nullable NSDictionary *)enumMap - objectMap:(nullable NSDictionary *)objectMap { ++ (instancetype) + makeWithANullableBool:(nullable NSNumber *)aNullableBool + aNullableInt:(nullable NSNumber *)aNullableInt + aNullableInt64:(nullable NSNumber *)aNullableInt64 + aNullableDouble:(nullable NSNumber *)aNullableDouble + aNullableByteArray:(nullable FlutterStandardTypedData *)aNullableByteArray + aNullable4ByteArray:(nullable FlutterStandardTypedData *)aNullable4ByteArray + aNullable8ByteArray:(nullable FlutterStandardTypedData *)aNullable8ByteArray + aNullableFloatArray:(nullable FlutterStandardTypedData *)aNullableFloatArray + aNullableEnum:(nullable FLTAnEnumBox *)aNullableEnum + anotherNullableEnum:(nullable FLTAnotherEnumBox *)anotherNullableEnum + aNullableString:(nullable NSString *)aNullableString + aNullableObject:(nullable id)aNullableObject + list:(nullable NSArray *)list + stringList:(nullable NSArray *)stringList + intList:(nullable NSArray *)intList + doubleList:(nullable NSArray *)doubleList + boolList:(nullable NSArray *)boolList + enumList:(nullable NSArray *)enumList + objectList:(nullable NSArray *)objectList + listList:(nullable NSArray *> *)listList + mapList:(nullable NSArray *> *)mapList + map:(nullable NSDictionary *)map + stringMap:(nullable NSDictionary *)stringMap + intMap:(nullable NSDictionary *)intMap + enumMap:(nullable NSDictionary *)enumMap + objectMap:(nullable NSDictionary *)objectMap + listMap:(nullable NSDictionary *> *)listMap + mapMap:(nullable NSDictionary *> *)mapMap { FLTAllNullableTypesWithoutRecursion *pigeonResult = [[FLTAllNullableTypesWithoutRecursion alloc] init]; pigeonResult.aNullableBool = aNullableBool; @@ -416,11 +443,14 @@ + (instancetype)makeWithANullableBool:(nullable NSNumber *)aNullableBool pigeonResult.enumList = enumList; pigeonResult.objectList = objectList; pigeonResult.listList = listList; + pigeonResult.mapList = mapList; pigeonResult.map = map; pigeonResult.stringMap = stringMap; pigeonResult.intMap = intMap; pigeonResult.enumMap = enumMap; pigeonResult.objectMap = objectMap; + pigeonResult.listMap = listMap; + pigeonResult.mapMap = mapMap; return pigeonResult; } + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { @@ -446,11 +476,14 @@ + (FLTAllNullableTypesWithoutRecursion *)fromList:(NSArray *)list { pigeonResult.enumList = GetNullableObjectAtIndex(list, 17); pigeonResult.objectList = GetNullableObjectAtIndex(list, 18); pigeonResult.listList = GetNullableObjectAtIndex(list, 19); - pigeonResult.map = GetNullableObjectAtIndex(list, 20); - pigeonResult.stringMap = GetNullableObjectAtIndex(list, 21); - pigeonResult.intMap = GetNullableObjectAtIndex(list, 22); - pigeonResult.enumMap = GetNullableObjectAtIndex(list, 23); - pigeonResult.objectMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.mapList = GetNullableObjectAtIndex(list, 20); + pigeonResult.map = GetNullableObjectAtIndex(list, 21); + pigeonResult.stringMap = GetNullableObjectAtIndex(list, 22); + pigeonResult.intMap = GetNullableObjectAtIndex(list, 23); + pigeonResult.enumMap = GetNullableObjectAtIndex(list, 24); + pigeonResult.objectMap = GetNullableObjectAtIndex(list, 25); + pigeonResult.listMap = GetNullableObjectAtIndex(list, 26); + pigeonResult.mapMap = GetNullableObjectAtIndex(list, 27); return pigeonResult; } + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray *)list { @@ -478,11 +511,14 @@ + (nullable FLTAllNullableTypesWithoutRecursion *)nullableFromList:(NSArray self.enumList ?: [NSNull null], self.objectList ?: [NSNull null], self.listList ?: [NSNull null], + self.mapList ?: [NSNull null], self.map ?: [NSNull null], self.stringMap ?: [NSNull null], self.intMap ?: [NSNull null], self.enumMap ?: [NSNull null], self.objectMap ?: [NSNull null], + self.listMap ?: [NSNull null], + self.mapMap ?: [NSNull null], ]; } @end 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 c2a98def00af..234361ada5ae 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 @@ -86,11 +86,14 @@ class AllTypes { required this.enumList, required this.objectList, required this.listList, + required this.mapList, required this.map, required this.stringMap, required this.intMap, required this.enumMap, required this.objectMap, + required this.listMap, + required this.mapMap, }); bool aBool; @@ -133,6 +136,8 @@ class AllTypes { List> listList; + List> mapList; + Map map; Map stringMap; @@ -143,6 +148,10 @@ class AllTypes { Map objectMap; + Map> listMap; + + Map> mapMap; + Object encode() { return [ aBool, @@ -165,11 +174,14 @@ class AllTypes { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ]; } @@ -196,11 +208,16 @@ class AllTypes { enumList: (result[17] as List?)!.cast(), objectList: (result[18] as List?)!.cast(), listList: (result[19] as List?)!.cast>(), - map: result[20]! as Map, - stringMap: (result[21] as Map?)!.cast(), - intMap: (result[22] as Map?)!.cast(), - enumMap: (result[23] as Map?)!.cast(), - objectMap: (result[24] as Map?)!.cast(), + mapList: (result[20] as List?)!.cast>(), + map: result[21]! as Map, + stringMap: (result[22] as Map?)!.cast(), + intMap: (result[23] as Map?)!.cast(), + enumMap: (result[24] as Map?)!.cast(), + objectMap: (result[25] as Map?)!.cast(), + listMap: + (result[26] as Map?)!.cast>(), + mapMap: (result[27] as Map?)! + .cast>(), ); } } @@ -229,12 +246,15 @@ class AllNullableTypes { this.enumList, this.objectList, this.listList, + this.mapList, this.recursiveClassList, this.map, this.stringMap, this.intMap, this.enumMap, this.objectMap, + this.listMap, + this.mapMap, this.recursiveClassMap, }); @@ -280,6 +300,8 @@ class AllNullableTypes { List?>? listList; + List?>? mapList; + List? recursiveClassList; Map? map; @@ -292,6 +314,10 @@ class AllNullableTypes { Map? objectMap; + Map?>? listMap; + + Map?>? mapMap; + Map? recursiveClassMap; Object encode() { @@ -317,12 +343,15 @@ class AllNullableTypes { enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap, ]; } @@ -351,16 +380,21 @@ class AllNullableTypes { enumList: (result[18] as List?)?.cast(), objectList: (result[19] as List?)?.cast(), listList: (result[20] as List?)?.cast?>(), + mapList: (result[21] as List?)?.cast?>(), recursiveClassList: - (result[21] as List?)?.cast(), - map: result[22] as Map?, + (result[22] as List?)?.cast(), + map: result[23] as Map?, stringMap: - (result[23] as Map?)?.cast(), - intMap: (result[24] as Map?)?.cast(), - enumMap: (result[25] as Map?)?.cast(), + (result[24] as Map?)?.cast(), + intMap: (result[25] as Map?)?.cast(), + enumMap: (result[26] as Map?)?.cast(), objectMap: - (result[26] as Map?)?.cast(), - recursiveClassMap: (result[27] as Map?) + (result[27] as Map?)?.cast(), + listMap: + (result[28] as Map?)?.cast?>(), + mapMap: (result[29] as Map?) + ?.cast?>(), + recursiveClassMap: (result[30] as Map?) ?.cast(), ); } @@ -391,11 +425,14 @@ class AllNullableTypesWithoutRecursion { this.enumList, this.objectList, this.listList, + this.mapList, this.map, this.stringMap, this.intMap, this.enumMap, this.objectMap, + this.listMap, + this.mapMap, }); bool? aNullableBool; @@ -438,6 +475,8 @@ class AllNullableTypesWithoutRecursion { List?>? listList; + List?>? mapList; + Map? map; Map? stringMap; @@ -448,6 +487,10 @@ class AllNullableTypesWithoutRecursion { Map? objectMap; + Map?>? listMap; + + Map?>? mapMap; + Object encode() { return [ aNullableBool, @@ -470,11 +513,14 @@ class AllNullableTypesWithoutRecursion { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ]; } @@ -501,13 +547,18 @@ class AllNullableTypesWithoutRecursion { enumList: (result[17] as List?)?.cast(), objectList: (result[18] as List?)?.cast(), listList: (result[19] as List?)?.cast?>(), - map: result[20] as Map?, + mapList: (result[20] as List?)?.cast?>(), + map: result[21] as Map?, stringMap: - (result[21] as Map?)?.cast(), - intMap: (result[22] as Map?)?.cast(), - enumMap: (result[23] as Map?)?.cast(), + (result[22] as Map?)?.cast(), + intMap: (result[23] as Map?)?.cast(), + enumMap: (result[24] as Map?)?.cast(), objectMap: - (result[24] as Map?)?.cast(), + (result[25] as Map?)?.cast(), + listMap: + (result[26] as Map?)?.cast?>(), + mapMap: (result[27] as Map?) + ?.cast?>(), ); } } diff --git a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart index 70305a30cc8b..40d35dc67940 100644 --- a/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart +++ b/packages/pigeon/platform_tests/shared_test_plugin_code/lib/test_types.dart @@ -13,6 +13,69 @@ const int biggerThanBigInt = 3000000000; const int regularInt = 42; const double doublePi = 3.14159; +void compareComplexLists(List? listOne, List? listTwo) { + expect(listOne == null, listTwo == null); + if (listOne == null || listTwo == null) { + return; + } + expect(listOne.length, listTwo.length); + for (int i = 0; i < listOne.length; i++) { + if (listOne[i] is List) { + compareComplexLists( + listOne[i] as List, listTwo[i] as List); + } else if (listOne[i] is Map) { + compareComplexMaps(listOne[i] as Map, + listTwo[i] as Map); + } else if (listOne[i] is AllTypes) { + compareAllTypes(listOne[i] as AllTypes, listTwo[i] as AllTypes); + } else if (listOne[i] is AllNullableTypes) { + compareAllNullableTypes( + listOne[i] as AllNullableTypes, listTwo[i] as AllNullableTypes); + } else if (listOne[i] is AllNullableTypesWithoutRecursion) { + compareAllNullableTypesWithoutRecursion( + listOne[i] as AllNullableTypesWithoutRecursion, + listTwo[i] as AllNullableTypesWithoutRecursion); + } else if (listOne[i] is AllClassesWrapper) { + compareAllClassesWrapper( + listOne[i] as AllClassesWrapper, listTwo[i] as AllClassesWrapper); + } else { + expect(listOne[i], listTwo[i]); + } + } +} + +void compareComplexMaps( + Map? mapOne, Map? mapTwo) { + expect(mapOne == null, mapTwo == null); + if (mapOne == null || mapTwo == null) { + return; + } + expect(mapOne.length, mapTwo.length); + for (final dynamic key in mapOne.keys) { + if (mapOne[key] is List) { + compareComplexLists( + mapOne[key] as List, mapTwo[key] as List); + } else if (mapOne[key] is Map) { + compareComplexMaps(mapOne[key] as Map, + mapTwo[key] as Map); + } else if (mapOne[key] is AllTypes) { + compareAllTypes(mapOne[key] as AllTypes, mapTwo[key] as AllTypes); + } else if (mapOne[key] is AllNullableTypes) { + compareAllNullableTypes( + mapOne[key] as AllNullableTypes, mapTwo[key] as AllNullableTypes); + } else if (mapOne[key] is AllNullableTypesWithoutRecursion) { + compareAllNullableTypesWithoutRecursion( + mapOne[key] as AllNullableTypesWithoutRecursion, + mapTwo[key] as AllNullableTypesWithoutRecursion); + } else if (mapOne[key] is AllClassesWrapper) { + compareAllClassesWrapper( + mapOne[key] as AllClassesWrapper, mapTwo[key] as AllClassesWrapper); + } else { + expect(mapOne[key], mapTwo[key]); + } + } +} + void compareAllNullableTypesWithoutRecursion( AllNullableTypesWithoutRecursion? allNullableTypesOne, AllNullableTypesWithoutRecursion? allNullableTypesTwo) { @@ -39,29 +102,30 @@ void compareAllNullableTypesWithoutRecursion( 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(listEquals(allNullableTypesOne.enumList, allNullableTypesTwo.enumList), - true); - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); - expect( - mapEquals(allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap), - true); - expect( - mapEquals(allNullableTypesOne.intMap, allNullableTypesTwo.intMap), true); - expect(mapEquals(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap), - true); + compareComplexLists(allNullableTypesOne.list, allNullableTypesTwo.list); + compareComplexLists( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList); + compareComplexLists( + allNullableTypesOne.boolList, allNullableTypesTwo.boolList); + compareComplexLists( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList); + compareComplexLists(allNullableTypesOne.intList, allNullableTypesTwo.intList); + compareComplexLists( + allNullableTypesOne.enumList, allNullableTypesTwo.enumList); + compareComplexLists( + allNullableTypesOne.objectList, allNullableTypesTwo.objectList); + compareComplexLists( + allNullableTypesOne.listList, allNullableTypesTwo.listList); + compareComplexLists(allNullableTypesOne.mapList, allNullableTypesTwo.mapList); + compareComplexMaps(allNullableTypesOne.map, allNullableTypesTwo.map); + compareComplexMaps( + allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap); + compareComplexMaps(allNullableTypesOne.intMap, allNullableTypesTwo.intMap); + compareComplexMaps(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap); + compareComplexMaps( + allNullableTypesOne.objectMap, allNullableTypesTwo.objectMap); + compareComplexMaps(allNullableTypesOne.listMap, allNullableTypesTwo.listMap); + compareComplexMaps(allNullableTypesOne.mapMap, allNullableTypesTwo.mapMap); } void compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { @@ -80,16 +144,22 @@ void compareAllTypes(AllTypes? allTypesOne, AllTypes? allTypesTwo) { 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); - expect(listEquals(allTypesOne.enumList, allTypesTwo.enumList), true); - expect(mapEquals(allTypesOne.map, allTypesTwo.map), true); - expect(mapEquals(allTypesOne.stringMap, allTypesTwo.stringMap), true); - expect(mapEquals(allTypesOne.intMap, allTypesTwo.intMap), true); - expect(mapEquals(allTypesOne.enumMap, allTypesTwo.enumMap), true); + compareComplexLists(allTypesOne.list, allTypesTwo.list); + compareComplexLists(allTypesOne.stringList, allTypesTwo.stringList); + compareComplexLists(allTypesOne.boolList, allTypesTwo.boolList); + compareComplexLists(allTypesOne.doubleList, allTypesTwo.doubleList); + compareComplexLists(allTypesOne.intList, allTypesTwo.intList); + compareComplexLists(allTypesOne.enumList, allTypesTwo.enumList); + compareComplexLists(allTypesOne.objectList, allTypesTwo.objectList); + compareComplexLists(allTypesOne.listList, allTypesTwo.listList); + compareComplexLists(allTypesOne.mapList, allTypesTwo.mapList); + compareComplexMaps(allTypesOne.map, allTypesTwo.map); + compareComplexMaps(allTypesOne.stringMap, allTypesTwo.stringMap); + compareComplexMaps(allTypesOne.intMap, allTypesTwo.intMap); + compareComplexMaps(allTypesOne.enumMap, allTypesTwo.enumMap); + compareComplexMaps(allTypesOne.objectMap, allTypesTwo.objectMap); + compareComplexMaps(allTypesOne.listMap, allTypesTwo.listMap); + compareComplexMaps(allTypesOne.mapMap, allTypesTwo.mapMap); } void compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, @@ -119,35 +189,34 @@ void compareAllNullableTypes(AllNullableTypes? allNullableTypesOne, 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(listEquals(allNullableTypesOne.enumList, allNullableTypesTwo.enumList), - true); - for (int i = 0; - i < (allNullableTypesOne.recursiveClassList?.length ?? 0); - i++) { - compareAllNullableTypes(allNullableTypesOne.recursiveClassList?[i], - allNullableTypesTwo.recursiveClassList?[i]); - } - expect(mapEquals(allNullableTypesOne.map, allNullableTypesTwo.map), true); - expect( - mapEquals(allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap), - true); - expect( - mapEquals(allNullableTypesOne.intMap, allNullableTypesTwo.intMap), true); - expect(mapEquals(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap), - true); + compareComplexLists(allNullableTypesOne.list, allNullableTypesTwo.list); + compareComplexLists( + allNullableTypesOne.stringList, allNullableTypesTwo.stringList); + compareComplexLists( + allNullableTypesOne.boolList, allNullableTypesTwo.boolList); + compareComplexLists( + allNullableTypesOne.doubleList, allNullableTypesTwo.doubleList); + compareComplexLists(allNullableTypesOne.intList, allNullableTypesTwo.intList); + compareComplexLists( + allNullableTypesOne.enumList, allNullableTypesTwo.enumList); + compareComplexLists( + allNullableTypesOne.objectList, allNullableTypesTwo.objectList); + compareComplexLists( + allNullableTypesOne.listList, allNullableTypesTwo.listList); + compareComplexLists(allNullableTypesOne.recursiveClassList, + allNullableTypesTwo.recursiveClassList); + compareComplexLists(allNullableTypesOne.mapList, allNullableTypesTwo.mapList); + compareComplexMaps(allNullableTypesOne.map, allNullableTypesTwo.map); + compareComplexMaps( + allNullableTypesOne.stringMap, allNullableTypesTwo.stringMap); + compareComplexMaps(allNullableTypesOne.intMap, allNullableTypesTwo.intMap); + compareComplexMaps(allNullableTypesOne.enumMap, allNullableTypesTwo.enumMap); + compareComplexMaps( + allNullableTypesOne.objectMap, allNullableTypesTwo.objectMap); + compareComplexMaps(allNullableTypesOne.listMap, allNullableTypesTwo.listMap); + compareComplexMaps(allNullableTypesOne.mapMap, allNullableTypesTwo.mapMap); + compareComplexMaps(allNullableTypesOne.recursiveClassMap, + allNullableTypesTwo.recursiveClassMap); } void compareAllClassesWrapper( @@ -168,35 +237,13 @@ void compareAllClassesWrapper( for (int i = 0; i < (wrapperOne.classList.length); i++) { compareAllTypes(wrapperOne.classList[i], wrapperTwo.classList[i]); } - if (wrapperOne.nullableClassList != null && - wrapperTwo.nullableClassList != null) { - for (int i = 0; i < (wrapperOne.nullableClassList!.length); i++) { - compareAllNullableTypesWithoutRecursion( - wrapperOne.nullableClassList![i], wrapperTwo.nullableClassList![i]); - } - } else { - expect(wrapperOne.nullableClassList != null, - wrapperTwo.nullableClassList != null); - } - final Iterable wrapperOneKeys = wrapperOne.classMap.keys; - final Iterable wrapperTwoKeys = wrapperTwo.classMap.keys; - expect(wrapperOneKeys.length, wrapperTwoKeys.length); - for (final int? key in wrapperOneKeys) { - compareAllTypes(wrapperOne.classMap[key], wrapperTwo.classMap[key]); - } - if (wrapperOne.nullableClassMap != null && - wrapperTwo.nullableClassMap != null) { - final Iterable wrapperOneKeys = wrapperOne.nullableClassMap!.keys; - final Iterable wrapperTwoKeys = wrapperTwo.nullableClassMap!.keys; - expect(wrapperOneKeys.length, wrapperTwoKeys.length); - for (final int? key in wrapperOneKeys) { - compareAllNullableTypesWithoutRecursion( - wrapperOne.nullableClassMap![key], wrapperTwo.nullableClassMap![key]); - } - } else { - expect(wrapperOne.nullableClassMap != null, - wrapperTwo.nullableClassMap != null); + + for (int i = 0; i < (wrapperOne.nullableClassList?.length ?? 0); i++) { + compareAllNullableTypesWithoutRecursion( + wrapperOne.nullableClassList![i], wrapperTwo.nullableClassList![i]); } + compareComplexMaps(wrapperOne.classMap, wrapperTwo.classMap); + compareComplexMaps(wrapperOne.nullableClassMap, wrapperTwo.nullableClassMap); } final List nonNullList = [ @@ -477,11 +524,14 @@ final AllNullableTypesWithoutRecursion genericAllNullableTypesWithoutRecursion = enumList: enumList, objectList: list, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, objectMap: map, + listMap: listMap, + mapMap: mapMap, ); final List @@ -520,11 +570,16 @@ final AllTypes genericAllTypes = AllTypes( enumList: nonNullEnumList, objectList: nonNullList, listList: nonNullListList, + mapList: nonNullMapList, map: nonNullMap, stringMap: nonNullStringMap, intMap: nonNullIntMap, + // doubleMap: nonNullDoubleMap, + // boolMap: nonNullBoolMap, enumMap: nonNullEnumMap, objectMap: nonNullMap, + listMap: nonNullListMap, + mapMap: nonNullMapMap, ); final List allTypesClassList = [ @@ -557,11 +612,14 @@ final AllNullableTypes genericAllNullableTypes = AllNullableTypes( enumList: enumList, objectList: list, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, objectMap: map, + listMap: listMap, + mapMap: mapMap, ); final List nonNullAllNullableTypesList = [ @@ -609,12 +667,15 @@ final AllNullableTypes recursiveAllNullableTypes = AllNullableTypes( enumList: enumList, objectList: list, listList: listList, + mapList: mapList, recursiveClassList: allNullableTypesList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, objectMap: map, + listMap: listMap, + mapMap: mapMap, recursiveClassMap: allNullableTypesMap, ); 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 eac9d2452a64..c5ba2d8b0ca0 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 @@ -102,11 +102,14 @@ data class AllTypes( val enumList: List, val objectList: List, val listList: List>, + val mapList: List>, val map: Map, val stringMap: Map, val intMap: Map, val enumMap: Map, - val objectMap: Map + val objectMap: Map, + val listMap: Map>, + val mapMap: Map> ) { companion object { fun fromList(pigeonVar_list: List): AllTypes { @@ -130,11 +133,14 @@ data class AllTypes( val enumList = pigeonVar_list[17] as List val objectList = pigeonVar_list[18] as List val listList = pigeonVar_list[19] as List> - val map = pigeonVar_list[20] as Map - val stringMap = pigeonVar_list[21] as Map - val intMap = pigeonVar_list[22] as Map - val enumMap = pigeonVar_list[23] as Map - val objectMap = pigeonVar_list[24] as Map + val mapList = pigeonVar_list[20] as List> + val map = pigeonVar_list[21] as Map + val stringMap = pigeonVar_list[22] as Map + val intMap = pigeonVar_list[23] as Map + val enumMap = pigeonVar_list[24] as Map + val objectMap = pigeonVar_list[25] as Map + val listMap = pigeonVar_list[26] as Map> + val mapMap = pigeonVar_list[27] as Map> return AllTypes( aBool, anInt, @@ -156,11 +162,14 @@ data class AllTypes( enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, - objectMap) + objectMap, + listMap, + mapMap) } } @@ -186,11 +195,14 @@ data class AllTypes( enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ) } } @@ -222,12 +234,15 @@ data class AllNullableTypes( val enumList: List? = null, val objectList: List? = null, val listList: List?>? = null, + val mapList: List?>? = null, val recursiveClassList: List? = null, val map: Map? = null, val stringMap: Map? = null, val intMap: Map? = null, val enumMap: Map? = null, val objectMap: Map? = null, + val listMap: Map?>? = null, + val mapMap: Map?>? = null, val recursiveClassMap: Map? = null ) { companion object { @@ -253,13 +268,16 @@ data class AllNullableTypes( val enumList = pigeonVar_list[18] as List? val objectList = pigeonVar_list[19] as List? val listList = pigeonVar_list[20] as List?>? - val recursiveClassList = pigeonVar_list[21] as List? - val map = pigeonVar_list[22] as Map? - val stringMap = pigeonVar_list[23] as Map? - val intMap = pigeonVar_list[24] as Map? - val enumMap = pigeonVar_list[25] as Map? - val objectMap = pigeonVar_list[26] as Map? - val recursiveClassMap = pigeonVar_list[27] as Map? + val mapList = pigeonVar_list[21] as List?>? + val recursiveClassList = pigeonVar_list[22] as List? + val map = pigeonVar_list[23] as Map? + val stringMap = pigeonVar_list[24] as Map? + val intMap = pigeonVar_list[25] as Map? + val enumMap = pigeonVar_list[26] as Map? + val objectMap = pigeonVar_list[27] as Map? + val listMap = pigeonVar_list[28] as Map?>? + val mapMap = pigeonVar_list[29] as Map?>? + val recursiveClassMap = pigeonVar_list[30] as Map? return AllNullableTypes( aNullableBool, aNullableInt, @@ -282,12 +300,15 @@ data class AllNullableTypes( enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap) } } @@ -315,12 +336,15 @@ data class AllNullableTypes( enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap, ) } @@ -353,11 +377,14 @@ data class AllNullableTypesWithoutRecursion( val enumList: List? = null, val objectList: List? = null, val listList: List?>? = null, + val mapList: List?>? = null, val map: Map? = null, val stringMap: Map? = null, val intMap: Map? = null, val enumMap: Map? = null, - val objectMap: Map? = null + val objectMap: Map? = null, + val listMap: Map?>? = null, + val mapMap: Map?>? = null ) { companion object { fun fromList(pigeonVar_list: List): AllNullableTypesWithoutRecursion { @@ -381,11 +408,14 @@ data class AllNullableTypesWithoutRecursion( val enumList = pigeonVar_list[17] as List? val objectList = pigeonVar_list[18] as List? val listList = pigeonVar_list[19] as List?>? - val map = pigeonVar_list[20] as Map? - val stringMap = pigeonVar_list[21] as Map? - val intMap = pigeonVar_list[22] as Map? - val enumMap = pigeonVar_list[23] as Map? - val objectMap = pigeonVar_list[24] as Map? + val mapList = pigeonVar_list[20] as List?>? + val map = pigeonVar_list[21] as Map? + val stringMap = pigeonVar_list[22] as Map? + val intMap = pigeonVar_list[23] as Map? + val enumMap = pigeonVar_list[24] as Map? + val objectMap = pigeonVar_list[25] as Map? + val listMap = pigeonVar_list[26] as Map?>? + val mapMap = pigeonVar_list[27] as Map?>? return AllNullableTypesWithoutRecursion( aNullableBool, aNullableInt, @@ -407,11 +437,14 @@ data class AllNullableTypesWithoutRecursion( enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, - objectMap) + objectMap, + listMap, + mapMap) } } @@ -437,11 +470,14 @@ data class AllNullableTypesWithoutRecursion( enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ) } } 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 25c771ee576a..aa42535f718c 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 @@ -66,9 +66,12 @@ internal class AllDatatypesTest { assertEquals(firstTypes.intList, secondTypes.intList) assertEquals(firstTypes.stringList, secondTypes.stringList) assertEquals(firstTypes.listList, secondTypes.listList) + assertEquals(firstTypes.mapList, secondTypes.mapList) assertEquals(firstTypes.map, secondTypes.map) assertEquals(firstTypes.stringMap, secondTypes.stringMap) assertEquals(firstTypes.intMap, secondTypes.intMap) + assertEquals(firstTypes.listMap, secondTypes.listMap) + assertEquals(firstTypes.mapMap, secondTypes.mapMap) } @Test @@ -120,10 +123,13 @@ internal class AllDatatypesTest { doubleList = listOf(1.1, 2.2), objectList = listOf(1, 2, 3), listList = listOf(stringList, stringList.toList()), + mapList = listOf(mapOf("hello" to 1234), mapOf("hello" to 1234)), map = mapOf("hello" to 1234), stringMap = mapOf("hello" to "you"), intMap = mapOf(1L to 0L), - objectMap = mapOf("hello" to 1234)) + objectMap = mapOf("hello" to 1234), + listMap = mapOf(1L to stringList), + mapMap = mapOf(1L to mapOf())) val binaryMessenger = mockk() val api = FlutterIntegrationCoreApi(binaryMessenger) 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 adfdc9ea8edc..d35390a794cf 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 @@ -64,10 +64,13 @@ class AllDatatypesTests: XCTestCase { boolList: [true, false], objectList: ["string", 2], listList: [[true], [false]], + mapList: [["hello": 1234], ["hello": 1234]], map: ["hello": 1234], stringMap: ["hello": "you"], intMap: [1: 0], - objectMap: ["hello": 1234] + objectMap: ["hello": 1234], + listMap: [1234: ["string", 2]], + mapMap: [1234: ["hello": 1234]] ) let binaryMessenger = EchoBinaryMessenger(codec: CoreTestsPigeonCodec.shared) @@ -98,10 +101,25 @@ class AllDatatypesTests: XCTestCase { XCTAssert(equalsList(list, everything.listList![index])) } } + if res!.mapList != nil { + for (index, map) in res!.mapList!.enumerated() { + XCTAssert(equalsDictionary(map, everything.mapList![index])) + } + } XCTAssert(equalsDictionary(res!.map, everything.map)) XCTAssert(equalsDictionary(res!.stringMap, everything.stringMap)) XCTAssert(equalsDictionary(res!.intMap, everything.intMap)) XCTAssert(equalsDictionary(res!.objectMap, everything.objectMap)) + if res!.listMap != nil { + for (index, list) in res!.listMap! { + XCTAssert(equalsList(list, everything.listMap![index]!)) + } + } + if res!.mapMap != nil { + for (index, map) in res!.mapMap! { + XCTAssert(equalsDictionary(map, everything.mapMap![index]!)) + } + } expectation.fulfill() return case .failure(_): 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 0101cd8c0755..2b2001d6aa44 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 @@ -129,11 +129,14 @@ struct AllTypes { var enumList: [AnEnum] var objectList: [Any] var listList: [[Any?]] + var mapList: [[AnyHashable?: Any?]] var map: [AnyHashable?: Any?] var stringMap: [String: String] var intMap: [Int64: Int64] var enumMap: [AnEnum: AnEnum] var objectMap: [AnyHashable: Any] + var listMap: [Int64: [Any?]] + var mapMap: [Int64: [AnyHashable?: Any?]] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { @@ -157,11 +160,14 @@ struct AllTypes { let enumList = pigeonVar_list[17] as! [AnEnum] let objectList = pigeonVar_list[18] as! [Any] let listList = pigeonVar_list[19] as! [[Any?]] - let map = pigeonVar_list[20] as! [AnyHashable?: Any?] - let stringMap = pigeonVar_list[21] as! [String: String] - let intMap = pigeonVar_list[22] as! [Int64: Int64] - let enumMap = pigeonVar_list[23] as? [AnEnum: AnEnum] - let objectMap = pigeonVar_list[24] as! [AnyHashable: Any] + let mapList = pigeonVar_list[20] as! [[AnyHashable?: Any?]] + let map = pigeonVar_list[21] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[22] as! [String: String] + let intMap = pigeonVar_list[23] as! [Int64: Int64] + let enumMap = pigeonVar_list[24] as? [AnEnum: AnEnum] + let objectMap = pigeonVar_list[25] as! [AnyHashable: Any] + let listMap = pigeonVar_list[26] as! [Int64: [Any?]] + let mapMap = pigeonVar_list[27] as! [Int64: [AnyHashable?: Any?]] return AllTypes( aBool: aBool, @@ -184,11 +190,14 @@ struct AllTypes { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap!, - objectMap: objectMap + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -213,11 +222,14 @@ struct AllTypes { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ] } } @@ -248,12 +260,15 @@ class AllNullableTypes { enumList: [AnEnum?]? = nil, objectList: [Any?]? = nil, listList: [[Any?]?]? = nil, + mapList: [[AnyHashable?: Any?]?]? = nil, recursiveClassList: [AllNullableTypes?]? = nil, map: [AnyHashable?: Any?]? = nil, stringMap: [String?: String?]? = nil, intMap: [Int64?: Int64?]? = nil, enumMap: [AnEnum?: AnEnum?]? = nil, objectMap: [AnyHashable?: Any?]? = nil, + listMap: [Int64?: [Any?]?]? = nil, + mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, recursiveClassMap: [Int64?: AllNullableTypes?]? = nil ) { self.aNullableBool = aNullableBool @@ -277,12 +292,15 @@ class AllNullableTypes { self.enumList = enumList self.objectList = objectList self.listList = listList + self.mapList = mapList self.recursiveClassList = recursiveClassList self.map = map self.stringMap = stringMap self.intMap = intMap self.enumMap = enumMap self.objectMap = objectMap + self.listMap = listMap + self.mapMap = mapMap self.recursiveClassMap = recursiveClassMap } var aNullableBool: Bool? @@ -306,12 +324,15 @@ class AllNullableTypes { var enumList: [AnEnum?]? var objectList: [Any?]? var listList: [[Any?]?]? + var mapList: [[AnyHashable?: Any?]?]? var recursiveClassList: [AllNullableTypes?]? var map: [AnyHashable?: Any?]? var stringMap: [String?: String?]? var intMap: [Int64?: Int64?]? var enumMap: [AnEnum?: AnEnum?]? var objectMap: [AnyHashable?: Any?]? + var listMap: [Int64?: [Any?]?]? + var mapMap: [Int64?: [AnyHashable?: Any?]?]? var recursiveClassMap: [Int64?: AllNullableTypes?]? // swift-format-ignore: AlwaysUseLowerCamelCase @@ -337,13 +358,16 @@ class AllNullableTypes { let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[18]) let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) - let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[22]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[23]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[24]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[25] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[26]) - let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[27]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) + let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[26] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) + let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -367,12 +391,15 @@ class AllNullableTypes { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, recursiveClassList: recursiveClassList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, objectMap: objectMap, + listMap: listMap, + mapMap: mapMap, recursiveClassMap: recursiveClassMap ) } @@ -399,12 +426,15 @@ class AllNullableTypes { enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap, ] } @@ -436,11 +466,14 @@ struct AllNullableTypesWithoutRecursion { var enumList: [AnEnum?]? = nil var objectList: [Any?]? = nil var listList: [[Any?]?]? = nil + var mapList: [[AnyHashable?: Any?]?]? = nil var map: [AnyHashable?: Any?]? = nil var stringMap: [String?: String?]? = nil var intMap: [Int64?: Int64?]? = nil var enumMap: [AnEnum?: AnEnum?]? = nil var objectMap: [AnyHashable?: Any?]? = nil + var listMap: [Int64?: [Any?]?]? = nil + var mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { @@ -464,11 +497,14 @@ struct AllNullableTypesWithoutRecursion { let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[17]) let objectList: [Any?]? = nilOrValue(pigeonVar_list[18]) let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[20]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[21]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[22]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[23] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[24]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[20]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[21]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[22]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[23]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[24] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[25]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[26]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[27]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -491,11 +527,14 @@ struct AllNullableTypesWithoutRecursion { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, - objectMap: objectMap + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -520,11 +559,14 @@ struct AllNullableTypesWithoutRecursion { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ] } } 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 fd388faa3e78..5701f91c2355 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 @@ -96,11 +96,14 @@ struct _CoreTestsPigeonTestAllTypes { FlValue* enum_list; FlValue* object_list; FlValue* list_list; + FlValue* map_list; FlValue* map; FlValue* string_map; FlValue* int_map; FlValue* enum_map; FlValue* object_map; + FlValue* list_map; + FlValue* map_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllTypes, core_tests_pigeon_test_all_types, @@ -118,11 +121,14 @@ static void core_tests_pigeon_test_all_types_dispose(GObject* object) { g_clear_pointer(&self->enum_list, fl_value_unref); g_clear_pointer(&self->object_list, fl_value_unref); g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_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_clear_pointer(&self->enum_map, fl_value_unref); g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_types_parent_class) ->dispose(object); } @@ -145,8 +151,9 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( 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* enum_list, - FlValue* object_list, FlValue* list_list, FlValue* map, FlValue* string_map, - FlValue* int_map, FlValue* enum_map, FlValue* object_map) { + FlValue* object_list, FlValue* list_list, FlValue* map_list, FlValue* map, + FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_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; @@ -180,11 +187,14 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( self->enum_list = fl_value_ref(enum_list); self->object_list = fl_value_ref(object_list); self->list_list = fl_value_ref(list_list); + self->map_list = fl_value_ref(map_list); self->map = fl_value_ref(map); self->string_map = fl_value_ref(string_map); self->int_map = fl_value_ref(int_map); self->enum_map = fl_value_ref(enum_map); self->object_map = fl_value_ref(object_map); + self->list_map = fl_value_ref(list_map); + self->map_map = fl_value_ref(map_map); return self; } @@ -315,6 +325,12 @@ FlValue* core_tests_pigeon_test_all_types_get_list_list( return self->list_list; } +FlValue* core_tests_pigeon_test_all_types_get_map_list( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->map_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); @@ -345,6 +361,18 @@ FlValue* core_tests_pigeon_test_all_types_get_object_map( return self->object_map; } +FlValue* core_tests_pigeon_test_all_types_get_list_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->list_map; +} + +FlValue* core_tests_pigeon_test_all_types_get_map_map( + CoreTestsPigeonTestAllTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_TYPES(self), nullptr); + return self->map_map; +} + static FlValue* core_tests_pigeon_test_all_types_to_list( CoreTestsPigeonTestAllTypes* self) { FlValue* values = fl_value_new_list(); @@ -380,11 +408,14 @@ static FlValue* core_tests_pigeon_test_all_types_to_list( fl_value_append_take(values, fl_value_ref(self->enum_list)); fl_value_append_take(values, fl_value_ref(self->object_list)); fl_value_append_take(values, fl_value_ref(self->list_list)); + fl_value_append_take(values, fl_value_ref(self->map_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)); fl_value_append_take(values, fl_value_ref(self->enum_map)); fl_value_append_take(values, fl_value_ref(self->object_map)); + fl_value_append_take(values, fl_value_ref(self->list_map)); + fl_value_append_take(values, fl_value_ref(self->map_map)); return values; } @@ -440,21 +471,28 @@ core_tests_pigeon_test_all_types_new_from_list(FlValue* values) { FlValue* value19 = fl_value_get_list_value(values, 19); FlValue* list_list = value19; FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* map = value20; + FlValue* map_list = value20; FlValue* value21 = fl_value_get_list_value(values, 21); - FlValue* string_map = value21; + FlValue* map = value21; FlValue* value22 = fl_value_get_list_value(values, 22); - FlValue* int_map = value22; + FlValue* string_map = value22; FlValue* value23 = fl_value_get_list_value(values, 23); - FlValue* enum_map = value23; + FlValue* int_map = value23; FlValue* value24 = fl_value_get_list_value(values, 24); - FlValue* object_map = value24; + FlValue* enum_map = value24; + FlValue* value25 = fl_value_get_list_value(values, 25); + FlValue* object_map = value25; + FlValue* value26 = fl_value_get_list_value(values, 26); + FlValue* list_map = value26; + FlValue* value27 = fl_value_get_list_value(values, 27); + FlValue* map_map = value27; 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, enum_list, - object_list, list_list, map, string_map, int_map, enum_map, object_map); + object_list, list_list, map_list, map, string_map, int_map, enum_map, + object_map, list_map, map_map); } struct _CoreTestsPigeonTestAllNullableTypes { @@ -485,12 +523,15 @@ struct _CoreTestsPigeonTestAllNullableTypes { FlValue* enum_list; FlValue* object_list; FlValue* list_list; + FlValue* map_list; FlValue* recursive_class_list; FlValue* map; FlValue* string_map; FlValue* int_map; FlValue* enum_map; FlValue* object_map; + FlValue* list_map; + FlValue* map_map; FlValue* recursive_class_map; }; @@ -517,12 +558,15 @@ static void core_tests_pigeon_test_all_nullable_types_dispose(GObject* object) { g_clear_pointer(&self->enum_list, fl_value_unref); g_clear_pointer(&self->object_list, fl_value_unref); g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_list, fl_value_unref); g_clear_pointer(&self->recursive_class_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_clear_pointer(&self->enum_map, fl_value_unref); g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); g_clear_pointer(&self->recursive_class_map, fl_value_unref); G_OBJECT_CLASS(core_tests_pigeon_test_all_nullable_types_parent_class) ->dispose(object); @@ -551,9 +595,10 @@ core_tests_pigeon_test_all_nullable_types_new( CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, FlValue* bool_list, FlValue* enum_list, FlValue* object_list, - FlValue* list_list, FlValue* recursive_class_list, FlValue* map, - FlValue* string_map, FlValue* int_map, FlValue* enum_map, - FlValue* object_map, FlValue* recursive_class_map) { + FlValue* list_list, FlValue* map_list, FlValue* recursive_class_list, + FlValue* map, FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map, + FlValue* recursive_class_map) { CoreTestsPigeonTestAllNullableTypes* self = CORE_TESTS_PIGEON_TEST_ALL_NULLABLE_TYPES(g_object_new( core_tests_pigeon_test_all_nullable_types_get_type(), nullptr)); @@ -690,6 +735,11 @@ core_tests_pigeon_test_all_nullable_types_new( } else { self->list_list = nullptr; } + if (map_list != nullptr) { + self->map_list = fl_value_ref(map_list); + } else { + self->map_list = nullptr; + } if (recursive_class_list != nullptr) { self->recursive_class_list = fl_value_ref(recursive_class_list); } else { @@ -720,6 +770,16 @@ core_tests_pigeon_test_all_nullable_types_new( } else { self->object_map = nullptr; } + if (list_map != nullptr) { + self->list_map = fl_value_ref(list_map); + } else { + self->list_map = nullptr; + } + if (map_map != nullptr) { + self->map_map = fl_value_ref(map_map); + } else { + self->map_map = nullptr; + } if (recursive_class_map != nullptr) { self->recursive_class_map = fl_value_ref(recursive_class_map); } else { @@ -886,6 +946,13 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( return self->list_list; } +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_list( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->map_list; +} + FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_list( CoreTestsPigeonTestAllNullableTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), @@ -928,6 +995,20 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_object_map( return self->object_map; } +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->list_map; +} + +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_map( + CoreTestsPigeonTestAllNullableTypes* self) { + g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), + nullptr); + return self->map_map; +} + FlValue* core_tests_pigeon_test_all_nullable_types_get_recursive_class_map( CoreTestsPigeonTestAllNullableTypes* self) { g_return_val_if_fail(CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES(self), @@ -1018,6 +1099,9 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_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_list != nullptr + ? fl_value_ref(self->map_list) + : fl_value_new_null()); fl_value_append_take(values, self->recursive_class_list != nullptr ? fl_value_ref(self->recursive_class_list) : fl_value_new_null()); @@ -1035,6 +1119,12 @@ static FlValue* core_tests_pigeon_test_all_nullable_types_to_list( fl_value_append_take(values, self->object_map != nullptr ? fl_value_ref(self->object_map) : fl_value_new_null()); + fl_value_append_take(values, self->list_map != nullptr + ? fl_value_ref(self->list_map) + : fl_value_new_null()); + fl_value_append_take(values, self->map_map != nullptr + ? fl_value_ref(self->map_map) + : fl_value_new_null()); fl_value_append_take(values, self->recursive_class_map != nullptr ? fl_value_ref(self->recursive_class_map) : fl_value_new_null()); @@ -1174,39 +1264,54 @@ core_tests_pigeon_test_all_nullable_types_new_from_list(FlValue* values) { list_list = value20; } FlValue* value21 = fl_value_get_list_value(values, 21); - FlValue* recursive_class_list = nullptr; + FlValue* map_list = nullptr; if (fl_value_get_type(value21) != FL_VALUE_TYPE_NULL) { - recursive_class_list = value21; + map_list = value21; } FlValue* value22 = fl_value_get_list_value(values, 22); - FlValue* map = nullptr; + FlValue* recursive_class_list = nullptr; if (fl_value_get_type(value22) != FL_VALUE_TYPE_NULL) { - map = value22; + recursive_class_list = value22; } FlValue* value23 = fl_value_get_list_value(values, 23); - FlValue* string_map = nullptr; + FlValue* map = nullptr; if (fl_value_get_type(value23) != FL_VALUE_TYPE_NULL) { - string_map = value23; + map = value23; } FlValue* value24 = fl_value_get_list_value(values, 24); - FlValue* int_map = nullptr; + FlValue* string_map = nullptr; if (fl_value_get_type(value24) != FL_VALUE_TYPE_NULL) { - int_map = value24; + string_map = value24; } FlValue* value25 = fl_value_get_list_value(values, 25); - FlValue* enum_map = nullptr; + FlValue* int_map = nullptr; if (fl_value_get_type(value25) != FL_VALUE_TYPE_NULL) { - enum_map = value25; + int_map = value25; } FlValue* value26 = fl_value_get_list_value(values, 26); - FlValue* object_map = nullptr; + FlValue* enum_map = nullptr; if (fl_value_get_type(value26) != FL_VALUE_TYPE_NULL) { - object_map = value26; + enum_map = value26; } FlValue* value27 = fl_value_get_list_value(values, 27); - FlValue* recursive_class_map = nullptr; + FlValue* object_map = nullptr; if (fl_value_get_type(value27) != FL_VALUE_TYPE_NULL) { - recursive_class_map = value27; + object_map = value27; + } + FlValue* value28 = fl_value_get_list_value(values, 28); + FlValue* list_map = nullptr; + if (fl_value_get_type(value28) != FL_VALUE_TYPE_NULL) { + list_map = value28; + } + FlValue* value29 = fl_value_get_list_value(values, 29); + FlValue* map_map = nullptr; + if (fl_value_get_type(value29) != FL_VALUE_TYPE_NULL) { + map_map = value29; + } + FlValue* value30 = fl_value_get_list_value(values, 30); + FlValue* recursive_class_map = nullptr; + if (fl_value_get_type(value30) != FL_VALUE_TYPE_NULL) { + recursive_class_map = value30; } return core_tests_pigeon_test_all_nullable_types_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, @@ -1216,8 +1321,9 @@ core_tests_pigeon_test_all_nullable_types_new_from_list(FlValue* values) { 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, - enum_list, object_list, list_list, recursive_class_list, map, string_map, - int_map, enum_map, object_map, recursive_class_map); + enum_list, object_list, list_list, map_list, recursive_class_list, map, + string_map, int_map, enum_map, object_map, list_map, map_map, + recursive_class_map); } struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { @@ -1247,11 +1353,14 @@ struct _CoreTestsPigeonTestAllNullableTypesWithoutRecursion { FlValue* enum_list; FlValue* object_list; FlValue* list_list; + FlValue* map_list; FlValue* map; FlValue* string_map; FlValue* int_map; FlValue* enum_map; FlValue* object_map; + FlValue* list_map; + FlValue* map_map; }; G_DEFINE_TYPE(CoreTestsPigeonTestAllNullableTypesWithoutRecursion, @@ -1278,11 +1387,14 @@ static void core_tests_pigeon_test_all_nullable_types_without_recursion_dispose( g_clear_pointer(&self->enum_list, fl_value_unref); g_clear_pointer(&self->object_list, fl_value_unref); g_clear_pointer(&self->list_list, fl_value_unref); + g_clear_pointer(&self->map_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_clear_pointer(&self->enum_map, fl_value_unref); g_clear_pointer(&self->object_map, fl_value_unref); + g_clear_pointer(&self->list_map, fl_value_unref); + g_clear_pointer(&self->map_map, fl_value_unref); G_OBJECT_CLASS( core_tests_pigeon_test_all_nullable_types_without_recursion_parent_class) ->dispose(object); @@ -1311,8 +1423,9 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, FlValue* bool_list, FlValue* enum_list, FlValue* object_list, - FlValue* list_list, FlValue* map, FlValue* string_map, FlValue* int_map, - FlValue* enum_map, FlValue* object_map) { + FlValue* list_list, FlValue* map_list, FlValue* map, FlValue* string_map, + FlValue* int_map, FlValue* enum_map, FlValue* object_map, FlValue* list_map, + FlValue* map_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(), @@ -1444,6 +1557,11 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( } else { self->list_list = nullptr; } + if (map_list != nullptr) { + self->map_list = fl_value_ref(map_list); + } else { + self->map_list = nullptr; + } if (map != nullptr) { self->map = fl_value_ref(map); } else { @@ -1469,6 +1587,16 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( } else { self->object_map = nullptr; } + if (list_map != nullptr) { + self->list_map = fl_value_ref(list_map); + } else { + self->list_map = nullptr; + } + if (map_map != nullptr) { + self->map_map = fl_value_ref(map_map); + } else { + self->map_map = nullptr; + } return self; } @@ -1655,6 +1783,15 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_list( return self->list_list; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->map_list; +} + FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_map( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { g_return_val_if_fail( @@ -1699,6 +1836,24 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_map( return self->object_map; } +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->list_map; +} + +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { + g_return_val_if_fail( + CORE_TESTS_PIGEON_TEST_IS_ALL_NULLABLE_TYPES_WITHOUT_RECURSION(self), + nullptr); + return self->map_map; +} + static FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* self) { @@ -1778,6 +1933,9 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_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_list != nullptr + ? fl_value_ref(self->map_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 @@ -1792,6 +1950,12 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_to_list( fl_value_append_take(values, self->object_map != nullptr ? fl_value_ref(self->object_map) : fl_value_new_null()); + fl_value_append_take(values, self->list_map != nullptr + ? fl_value_ref(self->list_map) + : fl_value_new_null()); + fl_value_append_take(values, self->map_map != nullptr + ? fl_value_ref(self->map_map) + : fl_value_new_null()); return values; } @@ -1923,29 +2087,44 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new_from_list( list_list = value19; } FlValue* value20 = fl_value_get_list_value(values, 20); - FlValue* map = nullptr; + FlValue* map_list = nullptr; if (fl_value_get_type(value20) != FL_VALUE_TYPE_NULL) { - map = value20; + map_list = value20; } FlValue* value21 = fl_value_get_list_value(values, 21); - FlValue* string_map = nullptr; + FlValue* map = nullptr; if (fl_value_get_type(value21) != FL_VALUE_TYPE_NULL) { - string_map = value21; + map = value21; } FlValue* value22 = fl_value_get_list_value(values, 22); - FlValue* int_map = nullptr; + FlValue* string_map = nullptr; if (fl_value_get_type(value22) != FL_VALUE_TYPE_NULL) { - int_map = value22; + string_map = value22; } FlValue* value23 = fl_value_get_list_value(values, 23); - FlValue* enum_map = nullptr; + FlValue* int_map = nullptr; if (fl_value_get_type(value23) != FL_VALUE_TYPE_NULL) { - enum_map = value23; + int_map = value23; } FlValue* value24 = fl_value_get_list_value(values, 24); - FlValue* object_map = nullptr; + FlValue* enum_map = nullptr; if (fl_value_get_type(value24) != FL_VALUE_TYPE_NULL) { - object_map = value24; + enum_map = value24; + } + FlValue* value25 = fl_value_get_list_value(values, 25); + FlValue* object_map = nullptr; + if (fl_value_get_type(value25) != FL_VALUE_TYPE_NULL) { + object_map = value25; + } + FlValue* value26 = fl_value_get_list_value(values, 26); + FlValue* list_map = nullptr; + if (fl_value_get_type(value26) != FL_VALUE_TYPE_NULL) { + list_map = value26; + } + FlValue* value27 = fl_value_get_list_value(values, 27); + FlValue* map_map = nullptr; + if (fl_value_get_type(value27) != FL_VALUE_TYPE_NULL) { + map_map = value27; } return core_tests_pigeon_test_all_nullable_types_without_recursion_new( a_nullable_bool, a_nullable_int, a_nullable_int64, a_nullable_double, @@ -1955,7 +2134,8 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new_from_list( 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, enum_list, object_list, - list_list, map, string_map, int_map, enum_map, object_map); + list_list, map_list, map, string_map, int_map, enum_map, object_map, + list_map, map_map); } struct _CoreTestsPigeonTestAllClassesWrapper { 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 94e6eb35d0ea..6cb79ba18548 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 @@ -105,11 +105,14 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllTypes, * enum_list: field in this object. * object_list: field in this object. * list_list: field in this object. + * map_list: field in this object. * map: field in this object. * string_map: field in this object. * int_map: field in this object. * enum_map: field in this object. * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. * * Creates a new #AllTypes object. * @@ -125,8 +128,9 @@ CoreTestsPigeonTestAllTypes* core_tests_pigeon_test_all_types_new( 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* enum_list, - FlValue* object_list, FlValue* list_list, FlValue* map, FlValue* string_map, - FlValue* int_map, FlValue* enum_map, FlValue* object_map); + FlValue* object_list, FlValue* list_list, FlValue* map_list, FlValue* map, + FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map); /** * core_tests_pigeon_test_all_types_get_a_bool @@ -353,6 +357,17 @@ FlValue* core_tests_pigeon_test_all_types_get_object_list( FlValue* core_tests_pigeon_test_all_types_get_list_list( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_map_list + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_map_list( + CoreTestsPigeonTestAllTypes* object); + /** * core_tests_pigeon_test_all_types_get_map * @object: a #CoreTestsPigeonTestAllTypes. @@ -408,6 +423,28 @@ FlValue* core_tests_pigeon_test_all_types_get_enum_map( FlValue* core_tests_pigeon_test_all_types_get_object_map( CoreTestsPigeonTestAllTypes* object); +/** + * core_tests_pigeon_test_all_types_get_list_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_list_map( + CoreTestsPigeonTestAllTypes* object); + +/** + * core_tests_pigeon_test_all_types_get_map_map + * @object: a #CoreTestsPigeonTestAllTypes. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_types_get_map_map( + CoreTestsPigeonTestAllTypes* object); + /** * CoreTestsPigeonTestAllNullableTypes: * @@ -445,12 +482,15 @@ G_DECLARE_FINAL_TYPE(CoreTestsPigeonTestAllNullableTypes, * enum_list: field in this object. * object_list: field in this object. * list_list: field in this object. + * map_list: field in this object. * recursive_class_list: field in this object. * map: field in this object. * string_map: field in this object. * int_map: field in this object. * enum_map: field in this object. * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. * recursive_class_map: field in this object. * * Creates a new #AllNullableTypes object. @@ -471,9 +511,10 @@ core_tests_pigeon_test_all_nullable_types_new( CoreTestsPigeonTestAllNullableTypes* all_nullable_types, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, FlValue* bool_list, FlValue* enum_list, FlValue* object_list, - FlValue* list_list, FlValue* recursive_class_list, FlValue* map, - FlValue* string_map, FlValue* int_map, FlValue* enum_map, - FlValue* object_map, FlValue* recursive_class_map); + FlValue* list_list, FlValue* map_list, FlValue* recursive_class_list, + FlValue* map, FlValue* string_map, FlValue* int_map, FlValue* enum_map, + FlValue* object_map, FlValue* list_map, FlValue* map_map, + FlValue* recursive_class_map); /** * core_tests_pigeon_test_all_nullable_types_get_a_nullable_bool @@ -717,6 +758,17 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_object_list( FlValue* core_tests_pigeon_test_all_nullable_types_get_list_list( CoreTestsPigeonTestAllNullableTypes* object); +/** + * core_tests_pigeon_test_all_nullable_types_get_map_list + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_list( + CoreTestsPigeonTestAllNullableTypes* object); + /** * core_tests_pigeon_test_all_nullable_types_get_recursive_class_list * @object: a #CoreTestsPigeonTestAllNullableTypes. @@ -783,6 +835,28 @@ FlValue* core_tests_pigeon_test_all_nullable_types_get_enum_map( FlValue* core_tests_pigeon_test_all_nullable_types_get_object_map( CoreTestsPigeonTestAllNullableTypes* object); +/** + * core_tests_pigeon_test_all_nullable_types_get_list_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_list_map( + CoreTestsPigeonTestAllNullableTypes* object); + +/** + * core_tests_pigeon_test_all_nullable_types_get_map_map + * @object: a #CoreTestsPigeonTestAllNullableTypes. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* core_tests_pigeon_test_all_nullable_types_get_map_map( + CoreTestsPigeonTestAllNullableTypes* object); + /** * core_tests_pigeon_test_all_nullable_types_get_recursive_class_map * @object: a #CoreTestsPigeonTestAllNullableTypes. @@ -833,11 +907,14 @@ G_DECLARE_FINAL_TYPE( * enum_list: field in this object. * object_list: field in this object. * list_list: field in this object. + * map_list: field in this object. * map: field in this object. * string_map: field in this object. * int_map: field in this object. * enum_map: field in this object. * object_map: field in this object. + * list_map: field in this object. + * map_map: field in this object. * * Creates a new #AllNullableTypesWithoutRecursion object. * @@ -856,8 +933,9 @@ core_tests_pigeon_test_all_nullable_types_without_recursion_new( const gchar* a_nullable_string, FlValue* a_nullable_object, FlValue* list, FlValue* string_list, FlValue* int_list, FlValue* double_list, FlValue* bool_list, FlValue* enum_list, FlValue* object_list, - FlValue* list_list, FlValue* map, FlValue* string_map, FlValue* int_map, - FlValue* enum_map, FlValue* object_map); + FlValue* list_list, FlValue* map_list, FlValue* map, FlValue* string_map, + FlValue* int_map, FlValue* enum_map, FlValue* object_map, FlValue* list_map, + FlValue* map_map); /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_a_nullable_bool @@ -1106,6 +1184,18 @@ 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_list + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the mapList field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_list( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + /** * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. @@ -1165,6 +1255,30 @@ FlValue* core_tests_pigeon_test_all_nullable_types_without_recursion_get_object_map( CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the listMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_list_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + +/** + * core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map + * @object: a #CoreTestsPigeonTestAllNullableTypesWithoutRecursion. + * + * Gets the value of the mapMap field of @object. + * + * Returns: the field value. + */ +FlValue* +core_tests_pigeon_test_all_nullable_types_without_recursion_get_map_map( + CoreTestsPigeonTestAllNullableTypesWithoutRecursion* object); + /** * CoreTestsPigeonTestAllClassesWrapper: * 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 9f1ef2fbf494..14938e9980f0 100644 --- a/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc +++ b/packages/pigeon/platform_tests/test_plugin/linux/test_plugin.cc @@ -278,7 +278,7 @@ create_nested_nullable_string(const gchar* nullable_string, 0, nullptr, 0, nullptr, nullptr, nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr); + nullptr, nullptr, nullptr, nullptr); FlValue* classList = fl_value_new_list(); FlValue* classMap = fl_value_new_map(); g_autoptr(CoreTestsPigeonTestAllClassesWrapper) wrapper = @@ -298,7 +298,8 @@ send_multiple_nullable_types(gboolean* a_nullable_bool, int64_t* a_nullable_int, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, - nullptr, nullptr, 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); } @@ -314,7 +315,7 @@ send_multiple_nullable_types_without_recursion(gboolean* a_nullable_bool, nullptr, 0, nullptr, 0, nullptr, 0, nullptr, nullptr, a_nullable_string, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, nullptr, 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); } 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 0101cd8c0755..2b2001d6aa44 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 @@ -129,11 +129,14 @@ struct AllTypes { var enumList: [AnEnum] var objectList: [Any] var listList: [[Any?]] + var mapList: [[AnyHashable?: Any?]] var map: [AnyHashable?: Any?] var stringMap: [String: String] var intMap: [Int64: Int64] var enumMap: [AnEnum: AnEnum] var objectMap: [AnyHashable: Any] + var listMap: [Int64: [Any?]] + var mapMap: [Int64: [AnyHashable?: Any?]] // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllTypes? { @@ -157,11 +160,14 @@ struct AllTypes { let enumList = pigeonVar_list[17] as! [AnEnum] let objectList = pigeonVar_list[18] as! [Any] let listList = pigeonVar_list[19] as! [[Any?]] - let map = pigeonVar_list[20] as! [AnyHashable?: Any?] - let stringMap = pigeonVar_list[21] as! [String: String] - let intMap = pigeonVar_list[22] as! [Int64: Int64] - let enumMap = pigeonVar_list[23] as? [AnEnum: AnEnum] - let objectMap = pigeonVar_list[24] as! [AnyHashable: Any] + let mapList = pigeonVar_list[20] as! [[AnyHashable?: Any?]] + let map = pigeonVar_list[21] as! [AnyHashable?: Any?] + let stringMap = pigeonVar_list[22] as! [String: String] + let intMap = pigeonVar_list[23] as! [Int64: Int64] + let enumMap = pigeonVar_list[24] as? [AnEnum: AnEnum] + let objectMap = pigeonVar_list[25] as! [AnyHashable: Any] + let listMap = pigeonVar_list[26] as! [Int64: [Any?]] + let mapMap = pigeonVar_list[27] as! [Int64: [AnyHashable?: Any?]] return AllTypes( aBool: aBool, @@ -184,11 +190,14 @@ struct AllTypes { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap!, - objectMap: objectMap + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -213,11 +222,14 @@ struct AllTypes { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ] } } @@ -248,12 +260,15 @@ class AllNullableTypes { enumList: [AnEnum?]? = nil, objectList: [Any?]? = nil, listList: [[Any?]?]? = nil, + mapList: [[AnyHashable?: Any?]?]? = nil, recursiveClassList: [AllNullableTypes?]? = nil, map: [AnyHashable?: Any?]? = nil, stringMap: [String?: String?]? = nil, intMap: [Int64?: Int64?]? = nil, enumMap: [AnEnum?: AnEnum?]? = nil, objectMap: [AnyHashable?: Any?]? = nil, + listMap: [Int64?: [Any?]?]? = nil, + mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil, recursiveClassMap: [Int64?: AllNullableTypes?]? = nil ) { self.aNullableBool = aNullableBool @@ -277,12 +292,15 @@ class AllNullableTypes { self.enumList = enumList self.objectList = objectList self.listList = listList + self.mapList = mapList self.recursiveClassList = recursiveClassList self.map = map self.stringMap = stringMap self.intMap = intMap self.enumMap = enumMap self.objectMap = objectMap + self.listMap = listMap + self.mapMap = mapMap self.recursiveClassMap = recursiveClassMap } var aNullableBool: Bool? @@ -306,12 +324,15 @@ class AllNullableTypes { var enumList: [AnEnum?]? var objectList: [Any?]? var listList: [[Any?]?]? + var mapList: [[AnyHashable?: Any?]?]? var recursiveClassList: [AllNullableTypes?]? var map: [AnyHashable?: Any?]? var stringMap: [String?: String?]? var intMap: [Int64?: Int64?]? var enumMap: [AnEnum?: AnEnum?]? var objectMap: [AnyHashable?: Any?]? + var listMap: [Int64?: [Any?]?]? + var mapMap: [Int64?: [AnyHashable?: Any?]?]? var recursiveClassMap: [Int64?: AllNullableTypes?]? // swift-format-ignore: AlwaysUseLowerCamelCase @@ -337,13 +358,16 @@ class AllNullableTypes { let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[18]) let objectList: [Any?]? = nilOrValue(pigeonVar_list[19]) let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[20]) - let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[21]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[22]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[23]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[24]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[25] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[26]) - let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[27]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[21]) + let recursiveClassList: [AllNullableTypes?]? = nilOrValue(pigeonVar_list[22]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[23]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[24]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[25]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[26] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[27]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[28]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[29]) + let recursiveClassMap: [Int64?: AllNullableTypes?]? = nilOrValue(pigeonVar_list[30]) return AllNullableTypes( aNullableBool: aNullableBool, @@ -367,12 +391,15 @@ class AllNullableTypes { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, recursiveClassList: recursiveClassList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, objectMap: objectMap, + listMap: listMap, + mapMap: mapMap, recursiveClassMap: recursiveClassMap ) } @@ -399,12 +426,15 @@ class AllNullableTypes { enumList, objectList, listList, + mapList, recursiveClassList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, recursiveClassMap, ] } @@ -436,11 +466,14 @@ struct AllNullableTypesWithoutRecursion { var enumList: [AnEnum?]? = nil var objectList: [Any?]? = nil var listList: [[Any?]?]? = nil + var mapList: [[AnyHashable?: Any?]?]? = nil var map: [AnyHashable?: Any?]? = nil var stringMap: [String?: String?]? = nil var intMap: [Int64?: Int64?]? = nil var enumMap: [AnEnum?: AnEnum?]? = nil var objectMap: [AnyHashable?: Any?]? = nil + var listMap: [Int64?: [Any?]?]? = nil + var mapMap: [Int64?: [AnyHashable?: Any?]?]? = nil // swift-format-ignore: AlwaysUseLowerCamelCase static func fromList(_ pigeonVar_list: [Any?]) -> AllNullableTypesWithoutRecursion? { @@ -464,11 +497,14 @@ struct AllNullableTypesWithoutRecursion { let enumList: [AnEnum?]? = nilOrValue(pigeonVar_list[17]) let objectList: [Any?]? = nilOrValue(pigeonVar_list[18]) let listList: [[Any?]?]? = nilOrValue(pigeonVar_list[19]) - let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[20]) - let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[21]) - let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[22]) - let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[23] as? [AnEnum?: AnEnum?] - let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[24]) + let mapList: [[AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[20]) + let map: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[21]) + let stringMap: [String?: String?]? = nilOrValue(pigeonVar_list[22]) + let intMap: [Int64?: Int64?]? = nilOrValue(pigeonVar_list[23]) + let enumMap: [AnEnum?: AnEnum?]? = pigeonVar_list[24] as? [AnEnum?: AnEnum?] + let objectMap: [AnyHashable?: Any?]? = nilOrValue(pigeonVar_list[25]) + let listMap: [Int64?: [Any?]?]? = nilOrValue(pigeonVar_list[26]) + let mapMap: [Int64?: [AnyHashable?: Any?]?]? = nilOrValue(pigeonVar_list[27]) return AllNullableTypesWithoutRecursion( aNullableBool: aNullableBool, @@ -491,11 +527,14 @@ struct AllNullableTypesWithoutRecursion { enumList: enumList, objectList: objectList, listList: listList, + mapList: mapList, map: map, stringMap: stringMap, intMap: intMap, enumMap: enumMap, - objectMap: objectMap + objectMap: objectMap, + listMap: listMap, + mapMap: mapMap ) } func toList() -> [Any?] { @@ -520,11 +559,14 @@ struct AllNullableTypesWithoutRecursion { enumList, objectList, listList, + mapList, map, stringMap, intMap, enumMap, objectMap, + listMap, + mapMap, ] } } 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 c6f293b3d07a..c47e3a16e2e2 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 @@ -84,9 +84,11 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, const EncodableList& bool_list, const EncodableList& enum_list, const EncodableList& object_list, - const EncodableList& list_list, const EncodableMap& map, + const EncodableList& list_list, + const EncodableList& map_list, const EncodableMap& map, const EncodableMap& string_map, const EncodableMap& int_map, - const EncodableMap& enum_map, const EncodableMap& object_map) + const EncodableMap& enum_map, const EncodableMap& object_map, + const EncodableMap& list_map, const EncodableMap& map_map) : a_bool_(a_bool), an_int_(an_int), an_int64_(an_int64), @@ -107,11 +109,14 @@ AllTypes::AllTypes(bool a_bool, int64_t an_int, int64_t an_int64, enum_list_(enum_list), object_list_(object_list), list_list_(list_list), + map_list_(map_list), map_(map), string_map_(string_map), int_map_(int_map), enum_map_(enum_map), - object_map_(object_map) {} + object_map_(object_map), + list_map_(list_map), + map_map_(map_map) {} bool AllTypes::a_bool() const { return a_bool_; } @@ -229,6 +234,12 @@ void AllTypes::set_list_list(const EncodableList& value_arg) { list_list_ = value_arg; } +const EncodableList& AllTypes::map_list() const { return map_list_; } + +void AllTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} + const EncodableMap& AllTypes::map() const { return map_; } void AllTypes::set_map(const EncodableMap& value_arg) { map_ = value_arg; } @@ -257,9 +268,21 @@ void AllTypes::set_object_map(const EncodableMap& value_arg) { object_map_ = value_arg; } +const EncodableMap& AllTypes::list_map() const { return list_map_; } + +void AllTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap& AllTypes::map_map() const { return map_map_; } + +void AllTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} + EncodableList AllTypes::ToEncodableList() const { EncodableList list; - list.reserve(25); + list.reserve(28); list.push_back(EncodableValue(a_bool_)); list.push_back(EncodableValue(an_int_)); list.push_back(EncodableValue(an_int64_)); @@ -280,11 +303,14 @@ EncodableList AllTypes::ToEncodableList() const { list.push_back(EncodableValue(enum_list_)); list.push_back(EncodableValue(object_list_)); list.push_back(EncodableValue(list_list_)); + list.push_back(EncodableValue(map_list_)); list.push_back(EncodableValue(map_)); list.push_back(EncodableValue(string_map_)); list.push_back(EncodableValue(int_map_)); list.push_back(EncodableValue(enum_map_)); list.push_back(EncodableValue(object_map_)); + list.push_back(EncodableValue(list_map_)); + list.push_back(EncodableValue(map_map_)); return list; } @@ -304,9 +330,10 @@ AllTypes AllTypes::FromEncodableList(const EncodableList& list) { std::get(list[14]), std::get(list[15]), std::get(list[16]), std::get(list[17]), std::get(list[18]), std::get(list[19]), - std::get(list[20]), std::get(list[21]), + std::get(list[20]), std::get(list[21]), std::get(list[22]), std::get(list[23]), - std::get(list[24])); + std::get(list[24]), std::get(list[25]), + std::get(list[26]), std::get(list[27])); return decoded; } @@ -328,10 +355,12 @@ AllNullableTypes::AllNullableTypes( const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, const EncodableList* enum_list, const EncodableList* object_list, - const EncodableList* list_list, const EncodableList* recursive_class_list, - const EncodableMap* map, const EncodableMap* string_map, - const EncodableMap* int_map, const EncodableMap* enum_map, - const EncodableMap* object_map, const EncodableMap* recursive_class_map) + const EncodableList* list_list, const EncodableList* map_list, + const EncodableList* recursive_class_list, const EncodableMap* map, + const EncodableMap* string_map, const EncodableMap* int_map, + const EncodableMap* enum_map, const EncodableMap* object_map, + const EncodableMap* list_map, const EncodableMap* map_map, + const EncodableMap* recursive_class_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) @@ -388,6 +417,8 @@ AllNullableTypes::AllNullableTypes( : std::nullopt), list_list_(list_list ? std::optional(*list_list) : std::nullopt), + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), recursive_class_list_(recursive_class_list ? std::optional( *recursive_class_list) : std::nullopt), @@ -399,6 +430,9 @@ AllNullableTypes::AllNullableTypes( : std::nullopt), object_map_(object_map ? std::optional(*object_map) : std::nullopt), + list_map_(list_map ? std::optional(*list_map) + : std::nullopt), + map_map_(map_map ? std::optional(*map_map) : std::nullopt), recursive_class_map_(recursive_class_map ? std::optional( *recursive_class_map) : std::nullopt) {} @@ -473,6 +507,8 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) list_list_(other.list_list_ ? std::optional(*other.list_list_) : std::nullopt), + map_list_(other.map_list_ ? std::optional(*other.map_list_) + : std::nullopt), recursive_class_list_( other.recursive_class_list_ ? std::optional(*other.recursive_class_list_) @@ -489,6 +525,10 @@ AllNullableTypes::AllNullableTypes(const AllNullableTypes& other) object_map_(other.object_map_ ? std::optional(*other.object_map_) : std::nullopt), + list_map_(other.list_map_ ? std::optional(*other.list_map_) + : std::nullopt), + map_map_(other.map_map_ ? std::optional(*other.map_map_) + : std::nullopt), recursive_class_map_( other.recursive_class_map_ ? std::optional(*other.recursive_class_map_) @@ -519,12 +559,15 @@ AllNullableTypes& AllNullableTypes::operator=(const AllNullableTypes& other) { enum_list_ = other.enum_list_; object_list_ = other.object_list_; list_list_ = other.list_list_; + map_list_ = other.map_list_; recursive_class_list_ = other.recursive_class_list_; map_ = other.map_; string_map_ = other.string_map_; int_map_ = other.int_map_; enum_map_ = other.enum_map_; object_map_ = other.object_map_; + list_map_ = other.list_map_; + map_map_ = other.map_map_; recursive_class_map_ = other.recursive_class_map_; return *this; } @@ -814,6 +857,19 @@ void AllNullableTypes::set_list_list(const EncodableList& value_arg) { list_list_ = value_arg; } +const EncodableList* AllNullableTypes::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} + +void AllNullableTypes::set_map_list(const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_map_list(const EncodableList& value_arg) { + map_list_ = value_arg; +} + const EncodableList* AllNullableTypes::recursive_class_list() const { return recursive_class_list_ ? &(*recursive_class_list_) : nullptr; } @@ -892,6 +948,31 @@ void AllNullableTypes::set_object_map(const EncodableMap& value_arg) { object_map_ = value_arg; } +const EncodableMap* AllNullableTypes::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypes::set_list_map(const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_list_map(const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypes::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypes::set_map_map(const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypes::set_map_map(const EncodableMap& value_arg) { + map_map_ = value_arg; +} + const EncodableMap* AllNullableTypes::recursive_class_map() const { return recursive_class_map_ ? &(*recursive_class_map_) : nullptr; } @@ -907,7 +988,7 @@ void AllNullableTypes::set_recursive_class_map(const EncodableMap& value_arg) { EncodableList AllNullableTypes::ToEncodableList() const { EncodableList list; - list.reserve(28); + list.reserve(31); list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) @@ -950,6 +1031,7 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(object_list_ ? EncodableValue(*object_list_) : EncodableValue()); list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_list_) : EncodableValue()); list.push_back(recursive_class_list_ ? EncodableValue(*recursive_class_list_) : EncodableValue()); list.push_back(map_ ? EncodableValue(*map_) : EncodableValue()); @@ -957,6 +1039,8 @@ EncodableList AllNullableTypes::ToEncodableList() const { list.push_back(int_map_ ? EncodableValue(*int_map_) : EncodableValue()); list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); list.push_back(recursive_class_map_ ? EncodableValue(*recursive_class_map_) : EncodableValue()); return list; @@ -1058,32 +1142,44 @@ AllNullableTypes AllNullableTypes::FromEncodableList( if (!encodable_list_list.IsNull()) { decoded.set_list_list(std::get(encodable_list_list)); } - auto& encodable_recursive_class_list = list[21]; + auto& encodable_map_list = list[21]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_recursive_class_list = list[22]; if (!encodable_recursive_class_list.IsNull()) { decoded.set_recursive_class_list( std::get(encodable_recursive_class_list)); } - auto& encodable_map = list[22]; + auto& encodable_map = list[23]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } - auto& encodable_string_map = list[23]; + auto& encodable_string_map = list[24]; if (!encodable_string_map.IsNull()) { decoded.set_string_map(std::get(encodable_string_map)); } - auto& encodable_int_map = list[24]; + auto& encodable_int_map = list[25]; if (!encodable_int_map.IsNull()) { decoded.set_int_map(std::get(encodable_int_map)); } - auto& encodable_enum_map = list[25]; + auto& encodable_enum_map = list[26]; if (!encodable_enum_map.IsNull()) { decoded.set_enum_map(std::get(encodable_enum_map)); } - auto& encodable_object_map = list[26]; + auto& encodable_object_map = list[27]; if (!encodable_object_map.IsNull()) { decoded.set_object_map(std::get(encodable_object_map)); } - auto& encodable_recursive_class_map = list[27]; + auto& encodable_list_map = list[28]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[29]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } + auto& encodable_recursive_class_map = list[30]; if (!encodable_recursive_class_map.IsNull()) { decoded.set_recursive_class_map( std::get(encodable_recursive_class_map)); @@ -1108,9 +1204,11 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( const EncodableList* string_list, const EncodableList* int_list, const EncodableList* double_list, const EncodableList* bool_list, const EncodableList* enum_list, const EncodableList* object_list, - const EncodableList* list_list, const EncodableMap* map, - const EncodableMap* string_map, const EncodableMap* int_map, - const EncodableMap* enum_map, const EncodableMap* object_map) + const EncodableList* list_list, const EncodableList* map_list, + const EncodableMap* map, const EncodableMap* string_map, + const EncodableMap* int_map, const EncodableMap* enum_map, + const EncodableMap* object_map, const EncodableMap* list_map, + const EncodableMap* map_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) @@ -1163,6 +1261,8 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( : std::nullopt), list_list_(list_list ? std::optional(*list_list) : std::nullopt), + map_list_(map_list ? std::optional(*map_list) + : std::nullopt), map_(map ? std::optional(*map) : std::nullopt), string_map_(string_map ? std::optional(*string_map) : std::nullopt), @@ -1170,7 +1270,11 @@ AllNullableTypesWithoutRecursion::AllNullableTypesWithoutRecursion( enum_map_(enum_map ? std::optional(*enum_map) : std::nullopt), object_map_(object_map ? std::optional(*object_map) - : std::nullopt) {} + : std::nullopt), + list_map_(list_map ? std::optional(*list_map) + : std::nullopt), + map_map_(map_map ? std::optional(*map_map) : std::nullopt) { +} const bool* AllNullableTypesWithoutRecursion::a_nullable_bool() const { return a_nullable_bool_ ? &(*a_nullable_bool_) : nullptr; @@ -1475,6 +1579,21 @@ void AllNullableTypesWithoutRecursion::set_list_list( list_list_ = value_arg; } +const EncodableList* AllNullableTypesWithoutRecursion::map_list() const { + return map_list_ ? &(*map_list_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList* value_arg) { + map_list_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_list( + const EncodableList& value_arg) { + map_list_ = value_arg; +} + const EncodableMap* AllNullableTypesWithoutRecursion::map() const { return map_ ? &(*map_) : nullptr; } @@ -1546,9 +1665,38 @@ void AllNullableTypesWithoutRecursion::set_object_map( object_map_ = value_arg; } +const EncodableMap* AllNullableTypesWithoutRecursion::list_map() const { + return list_map_ ? &(*list_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap* value_arg) { + list_map_ = + value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_list_map( + const EncodableMap& value_arg) { + list_map_ = value_arg; +} + +const EncodableMap* AllNullableTypesWithoutRecursion::map_map() const { + return map_map_ ? &(*map_map_) : nullptr; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap* value_arg) { + map_map_ = value_arg ? std::optional(*value_arg) : std::nullopt; +} + +void AllNullableTypesWithoutRecursion::set_map_map( + const EncodableMap& value_arg) { + map_map_ = value_arg; +} + EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { EncodableList list; - list.reserve(25); + list.reserve(28); list.push_back(a_nullable_bool_ ? EncodableValue(*a_nullable_bool_) : EncodableValue()); list.push_back(a_nullable_int_ ? EncodableValue(*a_nullable_int_) @@ -1588,11 +1736,14 @@ EncodableList AllNullableTypesWithoutRecursion::ToEncodableList() const { list.push_back(object_list_ ? EncodableValue(*object_list_) : EncodableValue()); list.push_back(list_list_ ? EncodableValue(*list_list_) : EncodableValue()); + list.push_back(map_list_ ? EncodableValue(*map_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()); list.push_back(enum_map_ ? EncodableValue(*enum_map_) : EncodableValue()); list.push_back(object_map_ ? EncodableValue(*object_map_) : EncodableValue()); + list.push_back(list_map_ ? EncodableValue(*list_map_) : EncodableValue()); + list.push_back(map_map_ ? EncodableValue(*map_map_) : EncodableValue()); return list; } @@ -1687,26 +1838,38 @@ AllNullableTypesWithoutRecursion::FromEncodableList(const EncodableList& list) { if (!encodable_list_list.IsNull()) { decoded.set_list_list(std::get(encodable_list_list)); } - auto& encodable_map = list[20]; + auto& encodable_map_list = list[20]; + if (!encodable_map_list.IsNull()) { + decoded.set_map_list(std::get(encodable_map_list)); + } + auto& encodable_map = list[21]; if (!encodable_map.IsNull()) { decoded.set_map(std::get(encodable_map)); } - auto& encodable_string_map = list[21]; + auto& encodable_string_map = list[22]; if (!encodable_string_map.IsNull()) { decoded.set_string_map(std::get(encodable_string_map)); } - auto& encodable_int_map = list[22]; + auto& encodable_int_map = list[23]; if (!encodable_int_map.IsNull()) { decoded.set_int_map(std::get(encodable_int_map)); } - auto& encodable_enum_map = list[23]; + auto& encodable_enum_map = list[24]; if (!encodable_enum_map.IsNull()) { decoded.set_enum_map(std::get(encodable_enum_map)); } - auto& encodable_object_map = list[24]; + auto& encodable_object_map = list[25]; if (!encodable_object_map.IsNull()) { decoded.set_object_map(std::get(encodable_object_map)); } + auto& encodable_list_map = list[26]; + if (!encodable_list_map.IsNull()) { + decoded.set_list_map(std::get(encodable_list_map)); + } + auto& encodable_map_map = list[27]; + if (!encodable_map_map.IsNull()) { + decoded.set_map_map(std::get(encodable_map_map)); + } return decoded; } 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 a73e01e439a0..7f19e1a19cba 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 @@ -123,11 +123,14 @@ class AllTypes { const flutter::EncodableList& enum_list, const flutter::EncodableList& object_list, const flutter::EncodableList& list_list, + const flutter::EncodableList& map_list, const flutter::EncodableMap& map, const flutter::EncodableMap& string_map, const flutter::EncodableMap& int_map, const flutter::EncodableMap& enum_map, - const flutter::EncodableMap& object_map); + const flutter::EncodableMap& object_map, + const flutter::EncodableMap& list_map, + const flutter::EncodableMap& map_map); bool a_bool() const; void set_a_bool(bool value_arg); @@ -189,6 +192,9 @@ class AllTypes { const flutter::EncodableList& list_list() const; void set_list_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList& map_list() const; + void set_map_list(const flutter::EncodableList& value_arg); + const flutter::EncodableMap& map() const; void set_map(const flutter::EncodableMap& value_arg); @@ -204,6 +210,12 @@ class AllTypes { const flutter::EncodableMap& object_map() const; void set_object_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap& list_map() const; + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap& map_map() const; + void set_map_map(const flutter::EncodableMap& value_arg); + private: static AllTypes FromEncodableList(const flutter::EncodableList& list); flutter::EncodableList ToEncodableList() const; @@ -235,11 +247,14 @@ class AllTypes { flutter::EncodableList enum_list_; flutter::EncodableList object_list_; flutter::EncodableList list_list_; + flutter::EncodableList map_list_; flutter::EncodableMap map_; flutter::EncodableMap string_map_; flutter::EncodableMap int_map_; flutter::EncodableMap enum_map_; flutter::EncodableMap object_map_; + flutter::EncodableMap list_map_; + flutter::EncodableMap map_map_; }; // A class containing all supported nullable types. @@ -270,11 +285,14 @@ class AllNullableTypes { const flutter::EncodableList* enum_list, const flutter::EncodableList* object_list, const flutter::EncodableList* list_list, + const flutter::EncodableList* map_list, const flutter::EncodableList* recursive_class_list, const flutter::EncodableMap* map, const flutter::EncodableMap* string_map, const flutter::EncodableMap* int_map, const flutter::EncodableMap* enum_map, const flutter::EncodableMap* object_map, + const flutter::EncodableMap* list_map, + const flutter::EncodableMap* map_map, const flutter::EncodableMap* recursive_class_map); ~AllNullableTypes() = default; @@ -366,6 +384,10 @@ class AllNullableTypes { void set_list_list(const flutter::EncodableList* value_arg); void set_list_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* map_list() const; + void set_map_list(const flutter::EncodableList* value_arg); + void set_map_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* recursive_class_list() const; void set_recursive_class_list(const flutter::EncodableList* value_arg); void set_recursive_class_list(const flutter::EncodableList& value_arg); @@ -390,6 +412,14 @@ class AllNullableTypes { void set_object_map(const flutter::EncodableMap* value_arg); void set_object_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* list_map() const; + void set_list_map(const flutter::EncodableMap* value_arg); + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* map_map() const; + void set_map_map(const flutter::EncodableMap* value_arg); + void set_map_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* recursive_class_map() const; void set_recursive_class_map(const flutter::EncodableMap* value_arg); void set_recursive_class_map(const flutter::EncodableMap& value_arg); @@ -426,12 +456,15 @@ class AllNullableTypes { std::optional enum_list_; std::optional object_list_; std::optional list_list_; + std::optional map_list_; std::optional recursive_class_list_; std::optional map_; std::optional string_map_; std::optional int_map_; std::optional enum_map_; std::optional object_map_; + std::optional list_map_; + std::optional map_map_; std::optional recursive_class_map_; }; @@ -463,11 +496,14 @@ class AllNullableTypesWithoutRecursion { const flutter::EncodableList* bool_list, const flutter::EncodableList* enum_list, const flutter::EncodableList* object_list, - const flutter::EncodableList* list_list, const flutter::EncodableMap* map, + const flutter::EncodableList* list_list, + const flutter::EncodableList* map_list, const flutter::EncodableMap* map, const flutter::EncodableMap* string_map, const flutter::EncodableMap* int_map, const flutter::EncodableMap* enum_map, - const flutter::EncodableMap* object_map); + const flutter::EncodableMap* object_map, + const flutter::EncodableMap* list_map, + const flutter::EncodableMap* map_map); const bool* a_nullable_bool() const; void set_a_nullable_bool(const bool* value_arg); @@ -549,6 +585,10 @@ class AllNullableTypesWithoutRecursion { void set_list_list(const flutter::EncodableList* value_arg); void set_list_list(const flutter::EncodableList& value_arg); + const flutter::EncodableList* map_list() const; + void set_map_list(const flutter::EncodableList* value_arg); + void set_map_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); @@ -569,6 +609,14 @@ class AllNullableTypesWithoutRecursion { void set_object_map(const flutter::EncodableMap* value_arg); void set_object_map(const flutter::EncodableMap& value_arg); + const flutter::EncodableMap* list_map() const; + void set_list_map(const flutter::EncodableMap* value_arg); + void set_list_map(const flutter::EncodableMap& value_arg); + + const flutter::EncodableMap* map_map() const; + void set_map_map(const flutter::EncodableMap* value_arg); + void set_map_map(const flutter::EncodableMap& value_arg); + private: static AllNullableTypesWithoutRecursion FromEncodableList( const flutter::EncodableList& list); @@ -601,11 +649,14 @@ class AllNullableTypesWithoutRecursion { std::optional enum_list_; std::optional object_list_; std::optional list_list_; + std::optional map_list_; std::optional map_; std::optional string_map_; std::optional int_map_; std::optional enum_map_; std::optional object_map_; + std::optional list_map_; + std::optional map_map_; }; // A class for testing nested class handling.