-
Notifications
You must be signed in to change notification settings - Fork 37
protobuf: Enable all conformance tests #473
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 4 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
4a063b3
protobuf: Fix proto2 compilation
Jozott00 e46cfa2
pb: Enable proto2 conformance tests
Jozott00 f84146f
pb: Enable proto2 editions conformance tests
Jozott00 156eae8
pb: Enable editions2023 conformance tests
Jozott00 f92ad95
pb: Address PR comments
Jozott00 369df88
ci: Fix protobuf conformance change check
Jozott00 b800523
ci: Fix protobuf conformance change check
Jozott00 7174e2f
ci: Fix flaky float printing
Jozott00 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
204 changes: 204 additions & 0 deletions
204
...in-multiplatform/com/google/protobuf_test_messages/edition2023/TestMessagesEdition2023.kt
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,204 @@ | ||
@file:OptIn(ExperimentalRpcApi::class, InternalRpcApi::class) | ||
package com.google.protobuf_test_messages.edition2023 | ||
|
||
import kotlin.jvm.JvmInline | ||
import kotlinx.rpc.internal.utils.* | ||
|
||
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf_test_messages.edition2023.ComplexMessageInternal.CODEC::class) | ||
interface ComplexMessage { | ||
val d: Int? | ||
|
||
companion object | ||
} | ||
|
||
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023Internal.CODEC::class) | ||
interface TestAllTypesEdition2023 { | ||
val optionalInt32: Int? | ||
val optionalInt64: Long? | ||
val optionalUint32: UInt? | ||
val optionalUint64: ULong? | ||
val optionalSint32: Int? | ||
val optionalSint64: Long? | ||
val optionalFixed32: UInt? | ||
val optionalFixed64: ULong? | ||
val optionalSfixed32: Int? | ||
val optionalSfixed64: Long? | ||
val optionalFloat: Float? | ||
val optionalDouble: Double? | ||
val optionalBool: Boolean? | ||
val optionalString: String? | ||
val optionalBytes: ByteArray? | ||
val optionalNestedMessage: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedMessage | ||
val optionalForeignMessage: com.google.protobuf_test_messages.edition2023.ForeignMessageEdition2023 | ||
val optionalNestedEnum: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum? | ||
val optionalForeignEnum: com.google.protobuf_test_messages.edition2023.ForeignEnumEdition2023? | ||
val optionalStringPiece: String? | ||
val optionalCord: String? | ||
val recursiveMessage: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023 | ||
val repeatedInt32: List<kotlin.Int> | ||
val repeatedInt64: List<kotlin.Long> | ||
val repeatedUint32: List<kotlin.UInt> | ||
val repeatedUint64: List<kotlin.ULong> | ||
val repeatedSint32: List<kotlin.Int> | ||
val repeatedSint64: List<kotlin.Long> | ||
val repeatedFixed32: List<kotlin.UInt> | ||
val repeatedFixed64: List<kotlin.ULong> | ||
val repeatedSfixed32: List<kotlin.Int> | ||
val repeatedSfixed64: List<kotlin.Long> | ||
val repeatedFloat: List<kotlin.Float> | ||
val repeatedDouble: List<kotlin.Double> | ||
val repeatedBool: List<kotlin.Boolean> | ||
val repeatedString: List<kotlin.String> | ||
val repeatedBytes: List<kotlin.ByteArray> | ||
val repeatedNestedMessage: List<com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedMessage> | ||
val repeatedForeignMessage: List<com.google.protobuf_test_messages.edition2023.ForeignMessageEdition2023> | ||
val repeatedNestedEnum: List<com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum> | ||
val repeatedForeignEnum: List<com.google.protobuf_test_messages.edition2023.ForeignEnumEdition2023> | ||
val repeatedStringPiece: List<kotlin.String> | ||
val repeatedCord: List<kotlin.String> | ||
val packedInt32: List<kotlin.Int> | ||
val packedInt64: List<kotlin.Long> | ||
val packedUint32: List<kotlin.UInt> | ||
val packedUint64: List<kotlin.ULong> | ||
val packedSint32: List<kotlin.Int> | ||
val packedSint64: List<kotlin.Long> | ||
val packedFixed32: List<kotlin.UInt> | ||
val packedFixed64: List<kotlin.ULong> | ||
val packedSfixed32: List<kotlin.Int> | ||
val packedSfixed64: List<kotlin.Long> | ||
val packedFloat: List<kotlin.Float> | ||
val packedDouble: List<kotlin.Double> | ||
val packedBool: List<kotlin.Boolean> | ||
val packedNestedEnum: List<com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum> | ||
val unpackedInt32: List<kotlin.Int> | ||
val unpackedInt64: List<kotlin.Long> | ||
val unpackedUint32: List<kotlin.UInt> | ||
val unpackedUint64: List<kotlin.ULong> | ||
val unpackedSint32: List<kotlin.Int> | ||
val unpackedSint64: List<kotlin.Long> | ||
val unpackedFixed32: List<kotlin.UInt> | ||
val unpackedFixed64: List<kotlin.ULong> | ||
val unpackedSfixed32: List<kotlin.Int> | ||
val unpackedSfixed64: List<kotlin.Long> | ||
val unpackedFloat: List<kotlin.Float> | ||
val unpackedDouble: List<kotlin.Double> | ||
val unpackedBool: List<kotlin.Boolean> | ||
val unpackedNestedEnum: List<com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum> | ||
val mapInt32Int32: Map<kotlin.Int, kotlin.Int> | ||
val mapInt64Int64: Map<kotlin.Long, kotlin.Long> | ||
val mapUint32Uint32: Map<kotlin.UInt, kotlin.UInt> | ||
val mapUint64Uint64: Map<kotlin.ULong, kotlin.ULong> | ||
val mapSint32Sint32: Map<kotlin.Int, kotlin.Int> | ||
val mapSint64Sint64: Map<kotlin.Long, kotlin.Long> | ||
val mapFixed32Fixed32: Map<kotlin.UInt, kotlin.UInt> | ||
val mapFixed64Fixed64: Map<kotlin.ULong, kotlin.ULong> | ||
val mapSfixed32Sfixed32: Map<kotlin.Int, kotlin.Int> | ||
val mapSfixed64Sfixed64: Map<kotlin.Long, kotlin.Long> | ||
val mapInt32Float: Map<kotlin.Int, kotlin.Float> | ||
val mapInt32Double: Map<kotlin.Int, kotlin.Double> | ||
val mapBoolBool: Map<kotlin.Boolean, kotlin.Boolean> | ||
val mapStringString: Map<kotlin.String, kotlin.String> | ||
val mapStringBytes: Map<kotlin.String, kotlin.ByteArray> | ||
val mapStringNestedMessage: Map<kotlin.String, com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedMessage> | ||
val mapStringForeignMessage: Map<kotlin.String, com.google.protobuf_test_messages.edition2023.ForeignMessageEdition2023> | ||
val mapStringNestedEnum: Map<kotlin.String, com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum> | ||
val mapStringForeignEnum: Map<kotlin.String, com.google.protobuf_test_messages.edition2023.ForeignEnumEdition2023> | ||
val groupliketype: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.GroupLikeType | ||
val delimitedField: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.GroupLikeType | ||
val oneofField: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.OneofField? | ||
|
||
sealed interface OneofField { | ||
@JvmInline | ||
value class OneofUint32(val value: UInt): OneofField | ||
|
||
@JvmInline | ||
value class OneofNestedMessage( | ||
val value: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedMessage, | ||
): OneofField | ||
|
||
@JvmInline | ||
value class OneofString(val value: String): OneofField | ||
|
||
@JvmInline | ||
value class OneofBytes(val value: ByteArray): OneofField | ||
|
||
@JvmInline | ||
value class OneofBool(val value: Boolean): OneofField | ||
|
||
@JvmInline | ||
value class OneofUint64(val value: ULong): OneofField | ||
|
||
@JvmInline | ||
value class OneofFloat(val value: Float): OneofField | ||
|
||
@JvmInline | ||
value class OneofDouble(val value: Double): OneofField | ||
|
||
@JvmInline | ||
value class OneofEnum( | ||
val value: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023.NestedEnum, | ||
): OneofField | ||
} | ||
|
||
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023Internal.NestedMessageInternal.CODEC::class) | ||
interface NestedMessage { | ||
val a: Int? | ||
val corecursive: com.google.protobuf_test_messages.edition2023.TestAllTypesEdition2023 | ||
|
||
companion object | ||
} | ||
|
||
interface GroupLikeType { | ||
val groupInt32: Int? | ||
val groupUint32: UInt? | ||
|
||
companion object | ||
} | ||
|
||
sealed class NestedEnum(open val number: Int) { | ||
object FOO: NestedEnum(number = 0) | ||
|
||
object BAR: NestedEnum(number = 1) | ||
|
||
object BAZ: NestedEnum(number = 2) | ||
|
||
object NEG: NestedEnum(number = -1) | ||
|
||
data class UNRECOGNIZED(override val number: Int): NestedEnum(number) | ||
|
||
companion object { | ||
val entries: List<NestedEnum> by lazy { listOf(NEG, FOO, BAR, BAZ) } | ||
} | ||
} | ||
|
||
companion object | ||
} | ||
|
||
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf_test_messages.edition2023.ForeignMessageEdition2023Internal.CODEC::class) | ||
interface ForeignMessageEdition2023 { | ||
val c: Int? | ||
|
||
companion object | ||
} | ||
|
||
@kotlinx.rpc.grpc.codec.WithCodec(com.google.protobuf_test_messages.edition2023.GroupLikeTypeInternal.CODEC::class) | ||
interface GroupLikeType { | ||
val c: Int? | ||
|
||
companion object | ||
} | ||
|
||
sealed class ForeignEnumEdition2023(open val number: Int) { | ||
object FOREIGN_FOO: ForeignEnumEdition2023(number = 0) | ||
|
||
object FOREIGN_BAR: ForeignEnumEdition2023(number = 1) | ||
|
||
object FOREIGN_BAZ: ForeignEnumEdition2023(number = 2) | ||
|
||
data class UNRECOGNIZED(override val number: Int): ForeignEnumEdition2023(number) | ||
|
||
companion object { | ||
val entries: List<ForeignEnumEdition2023> by lazy { listOf(FOREIGN_FOO, FOREIGN_BAR, FOREIGN_BAZ) } | ||
} | ||
} | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.