Merge branch 'master' into fix_deprecated_is_pod

This commit is contained in:
Adam Cozzette 2020-11-23 16:47:29 -08:00 committed by GitHub
commit e65887ad0e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1185 changed files with 94213 additions and 63738 deletions

3
.bazelignore Normal file
View File

@ -0,0 +1,3 @@
# These are fetched as external repositories.
third_party/benchmark
third_party/googletest

View File

@ -11,8 +11,8 @@ mergeable:
regex: 'release notes: yes' regex: 'release notes: yes'
message: 'Please include release notes: yes' message: 'Please include release notes: yes'
- must_include: - must_include:
regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby)' regex: '^(c#|c\+\+|cleanup|conformance tests|integration|java|javascript|go|objective-c|php|python|ruby|bazel|cmake|protoc)'
message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: cleanup, conformance tests, integration.' message: 'Please include at least a language label (e.g., c++, java, python). Or apply one of the following labels: bazel, cmake, cleanup, conformance tests, integration, protoc.'
- must_include: - must_include:
regex: 'release notes: no' regex: 'release notes: no'
message: 'Please include release notes: no' message: 'Please include release notes: no'

16
.github/workflows/codespell.yml vendored Normal file
View File

@ -0,0 +1,16 @@
# GitHub Action to automate the identification of common misspellings in text files.
# https://github.com/codespell-project/actions-codespell
# https://github.com/codespell-project/codespell
name: codespell
on: [push, pull_request]
jobs:
codespell:
name: Check for spelling errors
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: codespell-project/actions-codespell@master
with:
check_filenames: true
skip: ./.git,./conformance/third_party,*.snk,*.pb,*.pb.cc,*.pb.h,./src/google/protobuf/testdata,./objectivec/Tests,./python/compatibility_tests/v2.5.0/tests/google/protobuf/internal
ignore_words_list: "alow,alse,ba,cleare,copyable,cloneable,dedup,dur,errorprone,files',fo,fundementals,hel,importd,inout,leapyear,nd,ois,ons,parseable,process',te,testof,ue,unparseable,wasn,wee,gae,keyserver,objext,od"

11
.gitignore vendored
View File

@ -57,6 +57,7 @@ python/**/*.egg
python/.eggs/ python/.eggs/
python/.tox python/.tox
python/build/ python/build/
python/docs/_build/
src/js_embed src/js_embed
src/protoc src/protoc
@ -103,7 +104,7 @@ build_msvc
# needed to trigger "pod install" to rerun the preinstall commands. # needed to trigger "pod install" to rerun the preinstall commands.
Pods/ Pods/
# Comformance test output # Conformance test output
conformance/.libs/ conformance/.libs/
conformance/com/ conformance/com/
conformance/conformance-cpp conformance/conformance-cpp
@ -136,19 +137,24 @@ conformance/*.class
# php test output # php test output
composer.lock composer.lock
php/tests/.phpunit.result.cache
php/tests/generated/ php/tests/generated/
php/tests/old_protoc php/tests/old_protoc
php/tests/phpunit-9.phar
php/tests/protobuf/ php/tests/protobuf/
php/tests/core php/tests/core
php/tests/vgcore* php/tests/vgcore*
php/tests/multirequest.result php/tests/multirequest.result
php/tests/nohup.out php/tests/nohup.out
php/tests/.phpunit.result.cache
php/tests/phpunit-*
php/ext/google/protobuf/.libs/ php/ext/google/protobuf/.libs/
php/ext/google/protobuf/Makefile.fragments php/ext/google/protobuf/Makefile.fragments
php/ext/google/protobuf/Makefile.global php/ext/google/protobuf/Makefile.global
php/ext/google/protobuf/Makefile.objects php/ext/google/protobuf/Makefile.objects
php/ext/google/protobuf/acinclude.m4 php/ext/google/protobuf/acinclude.m4
php/ext/google/protobuf/build/ php/ext/google/protobuf/build/
php/ext/google/protobuf/bundled_php.c
php/ext/google/protobuf/config.h php/ext/google/protobuf/config.h
php/ext/google/protobuf/config.h.in~ php/ext/google/protobuf/config.h.in~
php/ext/google/protobuf/config.nice php/ext/google/protobuf/config.nice
@ -208,3 +214,6 @@ cmake/cmake-build-debug/
# IntelliJ # IntelliJ
.idea .idea
*.iml *.iml
# BenchmarkDotNet
BenchmarkDotNet.Artifacts/

22
.readthedocs.yml Normal file
View File

@ -0,0 +1,22 @@
# .readthedocs.yml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
# Required
version: 2
sphinx:
configuration: python/docs/conf.py
fail_on_warning: false
# Setup build requirements for docs.
# Use conda so that we can install the latest libprotobuf package without
# having to build from scratch just for docs builds.
conda:
environment: python/docs/environment.yml
python:
version: 3.7
install:
- method: setuptools
path: python

368
BUILD
View File

@ -1,9 +1,8 @@
# Bazel (https://bazel.build/) BUILD file for Protobuf. # Bazel (https://bazel.build/) BUILD file for Protobuf.
load("@bazel_skylib//rules:common_settings.bzl", "string_flag")
load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library") load("@rules_cc//cc:defs.bzl", "cc_binary", "cc_library", "cc_test", "objc_library", native_cc_proto_library = "cc_proto_library")
load("@rules_java//java:defs.bzl", "java_library")
load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library") load("@rules_proto//proto:defs.bzl", "proto_lang_toolchain", "proto_library")
load("@rules_proto//proto/private:native.bzl", "native_proto_common")
load("@rules_python//python:defs.bzl", "py_library") load("@rules_python//python:defs.bzl", "py_library")
load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test") load(":cc_proto_blacklist_test.bzl", "cc_proto_blacklist_test")
@ -12,16 +11,41 @@ licenses(["notice"])
exports_files(["LICENSE"]) exports_files(["LICENSE"])
################################################################################ ################################################################################
# Java 9 configuration # build configuration
################################################################################ ################################################################################
# TODO(yannic): Remove in 3.14.0.
string_flag(
name = "incompatible_use_com_google_googletest",
build_setting_default = "true",
values = ["true", "false"]
)
config_setting( config_setting(
name = "jdk9", name = "use_com_google_googletest",
values = { flag_values = {
"java_toolchain": "@bazel_tools//tools/jdk:toolchain_jdk9", "//:incompatible_use_com_google_googletest": "true"
}, },
) )
GTEST = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest",
],
"//conditions:default": [
"//external:gtest",
],
})
GTEST_MAIN = select({
"//:use_com_google_googletest": [
"@com_google_googletest//:gtest_main",
],
"//conditions:default": [
"//external:gtest_main",
],
})
################################################################################ ################################################################################
# ZLIB configuration # ZLIB configuration
################################################################################ ################################################################################
@ -70,6 +94,10 @@ load(":compiler_config_setting.bzl", "create_compiler_config_setting")
create_compiler_config_setting( create_compiler_config_setting(
name = "msvc", name = "msvc",
value = "msvc-cl", value = "msvc-cl",
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
config_setting( config_setting(
@ -77,6 +105,10 @@ config_setting(
values = { values = {
"crosstool_top": "//external:android/crosstool", "crosstool_top": "//external:android/crosstool",
}, },
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
config_setting( config_setting(
@ -84,6 +116,10 @@ config_setting(
values = { values = {
"crosstool_top": "@androidndk//:toolchain-libcpp", "crosstool_top": "@androidndk//:toolchain-libcpp",
}, },
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
config_setting( config_setting(
@ -91,6 +127,10 @@ config_setting(
values = { values = {
"crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp", "crosstool_top": "@androidndk//:toolchain-gnu-libstdcpp",
}, },
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
# Android and MSVC builds do not need to link in a separate pthread library. # Android and MSVC builds do not need to link in a separate pthread library.
@ -110,6 +150,7 @@ LINK_OPTS = select({
load( load(
":protobuf.bzl", ":protobuf.bzl",
"adapt_proto_library",
"cc_proto_library", "cc_proto_library",
"internal_copied_filegroup", "internal_copied_filegroup",
"internal_gen_well_known_protos_java", "internal_gen_well_known_protos_java",
@ -123,6 +164,7 @@ cc_library(
# AUTOGEN(protobuf_lite_srcs) # AUTOGEN(protobuf_lite_srcs)
"src/google/protobuf/any_lite.cc", "src/google/protobuf/any_lite.cc",
"src/google/protobuf/arena.cc", "src/google/protobuf/arena.cc",
"src/google/protobuf/arenastring.cc",
"src/google/protobuf/extension_set.cc", "src/google/protobuf/extension_set.cc",
"src/google/protobuf/generated_enum_util.cc", "src/google/protobuf/generated_enum_util.cc",
"src/google/protobuf/generated_message_table_driven_lite.cc", "src/google/protobuf/generated_message_table_driven_lite.cc",
@ -134,6 +176,7 @@ cc_library(
"src/google/protobuf/io/zero_copy_stream.cc", "src/google/protobuf/io/zero_copy_stream.cc",
"src/google/protobuf/io/zero_copy_stream_impl.cc", "src/google/protobuf/io/zero_copy_stream_impl.cc",
"src/google/protobuf/io/zero_copy_stream_impl_lite.cc", "src/google/protobuf/io/zero_copy_stream_impl_lite.cc",
"src/google/protobuf/map.cc",
"src/google/protobuf/message_lite.cc", "src/google/protobuf/message_lite.cc",
"src/google/protobuf/parse_context.cc", "src/google/protobuf/parse_context.cc",
"src/google/protobuf/repeated_field.cc", "src/google/protobuf/repeated_field.cc",
@ -286,13 +329,15 @@ filegroup(
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
cc_proto_library( adapt_proto_library(
name = "cc_wkt_protos_genproto",
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
visibility = ["//visibility:public"],
)
cc_library(
name = "cc_wkt_protos", name = "cc_wkt_protos",
srcs = WELL_KNOWN_PROTOS, deprecation = "Only for backward compatibility. Do not use.",
include = "src",
default_runtime = ":protobuf",
internal_bootstrap_hack = 1,
protoc = ":protoc",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
@ -324,7 +369,15 @@ cc_proto_library(
cc_proto_blacklist_test( cc_proto_blacklist_test(
name = "cc_proto_blacklist_test", name = "cc_proto_blacklist_test",
deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] deps = [proto + "_cc_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
tags = [
# Exclude this target from wildcard expansion (//...). Due to
# https://github.com/bazelbuild/bazel/issues/10590, this test has to
# be nominated using the `@com_google_protobuf//` prefix. We do that,
# e.g., in kokoro/linux/bazel/build.sh.
# See also https://github.com/protocolbuffers/protobuf/pull/7096.
"manual",
],
) )
################################################################################ ################################################################################
@ -442,7 +495,6 @@ RELATIVE_LITE_TEST_PROTOS = [
"google/protobuf/unittest_import_lite.proto", "google/protobuf/unittest_import_lite.proto",
"google/protobuf/unittest_import_public_lite.proto", "google/protobuf/unittest_import_public_lite.proto",
"google/protobuf/unittest_lite.proto", "google/protobuf/unittest_lite.proto",
"google/protobuf/unittest_no_arena_lite.proto",
] ]
LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS] LITE_TEST_PROTOS = ["src/" + s for s in RELATIVE_LITE_TEST_PROTOS]
@ -469,8 +521,6 @@ RELATIVE_TEST_PROTOS = [
"google/protobuf/unittest_lite_imports_nonlite.proto", "google/protobuf/unittest_lite_imports_nonlite.proto",
"google/protobuf/unittest_mset.proto", "google/protobuf/unittest_mset.proto",
"google/protobuf/unittest_mset_wire_format.proto", "google/protobuf/unittest_mset_wire_format.proto",
"google/protobuf/unittest_no_arena.proto",
"google/protobuf/unittest_no_arena_import.proto",
"google/protobuf/unittest_no_field_presence.proto", "google/protobuf/unittest_no_field_presence.proto",
"google/protobuf/unittest_no_generic_services.proto", "google/protobuf/unittest_no_generic_services.proto",
"google/protobuf/unittest_optimize_for.proto", "google/protobuf/unittest_optimize_for.proto",
@ -480,6 +530,7 @@ RELATIVE_TEST_PROTOS = [
"google/protobuf/unittest_proto3_arena.proto", "google/protobuf/unittest_proto3_arena.proto",
"google/protobuf/unittest_proto3_arena_lite.proto", "google/protobuf/unittest_proto3_arena_lite.proto",
"google/protobuf/unittest_proto3_lite.proto", "google/protobuf/unittest_proto3_lite.proto",
"google/protobuf/unittest_proto3_optional.proto",
"google/protobuf/unittest_well_known_types.proto", "google/protobuf/unittest_well_known_types.proto",
"google/protobuf/util/internal/testdata/anys.proto", "google/protobuf/util/internal/testdata/anys.proto",
"google/protobuf/util/internal/testdata/books.proto", "google/protobuf/util/internal/testdata/books.proto",
@ -529,8 +580,7 @@ cc_binary(
deps = [ deps = [
":protobuf", ":protobuf",
":protoc_lib", ":protoc_lib",
"//external:gtest", ] + GTEST,
],
) )
cc_test( cc_test(
@ -542,8 +592,7 @@ cc_test(
], ],
deps = [ deps = [
":protobuf_lite", ":protobuf_lite",
"//external:gtest_main", ] + GTEST_MAIN,
],
) )
cc_test( cc_test(
@ -646,151 +695,49 @@ cc_test(
":cc_test_protos", ":cc_test_protos",
":protobuf", ":protobuf",
":protoc_lib", ":protoc_lib",
"//external:gtest_main", ] + PROTOBUF_DEPS + GTEST_MAIN,
] + PROTOBUF_DEPS,
) )
################################################################################ ################################################################################
# Java support # Java support
################################################################################ ################################################################################
internal_gen_well_known_protos_java( internal_gen_well_known_protos_java(
srcs = WELL_KNOWN_PROTOS, name = "gen_well_known_protos_java",
deps = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
visibility = [
"//java:__subpackages__",
],
) )
java_library( alias(
name = "protobuf_java", name = "protobuf_java",
srcs = glob([ actual = "//java/core",
"java/core/src/main/java/com/google/protobuf/*.java",
]) + [
":gen_well_known_protos_java",
],
javacopts = select({
"//:jdk9": ["--add-modules=jdk.unsupported"],
"//conditions:default": [
"-source 7",
"-target 7",
],
}),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
java_library( alias(
name = "protobuf_javalite", name = "protobuf_javalite",
srcs = [ actual = "//java/lite",
# Keep in sync with java/lite/pom.xml
"java/core/src/main/java/com/google/protobuf/AbstractMessageLite.java",
"java/core/src/main/java/com/google/protobuf/AbstractParser.java",
"java/core/src/main/java/com/google/protobuf/AbstractProtobufList.java",
"java/core/src/main/java/com/google/protobuf/AllocatedBuffer.java",
"java/core/src/main/java/com/google/protobuf/Android.java",
"java/core/src/main/java/com/google/protobuf/ArrayDecoders.java",
"java/core/src/main/java/com/google/protobuf/BinaryReader.java",
"java/core/src/main/java/com/google/protobuf/BinaryWriter.java",
"java/core/src/main/java/com/google/protobuf/BooleanArrayList.java",
"java/core/src/main/java/com/google/protobuf/BufferAllocator.java",
"java/core/src/main/java/com/google/protobuf/ByteBufferWriter.java",
"java/core/src/main/java/com/google/protobuf/ByteOutput.java",
"java/core/src/main/java/com/google/protobuf/ByteString.java",
"java/core/src/main/java/com/google/protobuf/CodedInputStream.java",
"java/core/src/main/java/com/google/protobuf/CodedInputStreamReader.java",
"java/core/src/main/java/com/google/protobuf/CodedOutputStream.java",
"java/core/src/main/java/com/google/protobuf/CodedOutputStreamWriter.java",
"java/core/src/main/java/com/google/protobuf/DoubleArrayList.java",
"java/core/src/main/java/com/google/protobuf/ExperimentalApi.java",
"java/core/src/main/java/com/google/protobuf/ExtensionLite.java",
"java/core/src/main/java/com/google/protobuf/ExtensionRegistryFactory.java",
"java/core/src/main/java/com/google/protobuf/ExtensionRegistryLite.java",
"java/core/src/main/java/com/google/protobuf/ExtensionSchema.java",
"java/core/src/main/java/com/google/protobuf/ExtensionSchemaLite.java",
"java/core/src/main/java/com/google/protobuf/ExtensionSchemas.java",
"java/core/src/main/java/com/google/protobuf/FieldInfo.java",
"java/core/src/main/java/com/google/protobuf/FieldSet.java",
"java/core/src/main/java/com/google/protobuf/FieldType.java",
"java/core/src/main/java/com/google/protobuf/FloatArrayList.java",
"java/core/src/main/java/com/google/protobuf/GeneratedMessageInfoFactory.java",
"java/core/src/main/java/com/google/protobuf/GeneratedMessageLite.java",
"java/core/src/main/java/com/google/protobuf/IntArrayList.java",
"java/core/src/main/java/com/google/protobuf/Internal.java",
"java/core/src/main/java/com/google/protobuf/InvalidProtocolBufferException.java",
"java/core/src/main/java/com/google/protobuf/IterableByteBufferInputStream.java",
"java/core/src/main/java/com/google/protobuf/JavaType.java",
"java/core/src/main/java/com/google/protobuf/LazyField.java",
"java/core/src/main/java/com/google/protobuf/LazyFieldLite.java",
"java/core/src/main/java/com/google/protobuf/LazyStringArrayList.java",
"java/core/src/main/java/com/google/protobuf/LazyStringList.java",
"java/core/src/main/java/com/google/protobuf/ListFieldSchema.java",
"java/core/src/main/java/com/google/protobuf/LongArrayList.java",
"java/core/src/main/java/com/google/protobuf/ManifestSchemaFactory.java",
"java/core/src/main/java/com/google/protobuf/MapEntryLite.java",
"java/core/src/main/java/com/google/protobuf/MapFieldLite.java",
"java/core/src/main/java/com/google/protobuf/MapFieldSchema.java",
"java/core/src/main/java/com/google/protobuf/MapFieldSchemaLite.java",
"java/core/src/main/java/com/google/protobuf/MapFieldSchemas.java",
"java/core/src/main/java/com/google/protobuf/MessageInfo.java",
"java/core/src/main/java/com/google/protobuf/MessageInfoFactory.java",
"java/core/src/main/java/com/google/protobuf/MessageLite.java",
"java/core/src/main/java/com/google/protobuf/MessageLiteOrBuilder.java",
"java/core/src/main/java/com/google/protobuf/MessageLiteToString.java",
"java/core/src/main/java/com/google/protobuf/MessageSchema.java",
"java/core/src/main/java/com/google/protobuf/MessageSetSchema.java",
"java/core/src/main/java/com/google/protobuf/MutabilityOracle.java",
"java/core/src/main/java/com/google/protobuf/NewInstanceSchema.java",
"java/core/src/main/java/com/google/protobuf/NewInstanceSchemaLite.java",
"java/core/src/main/java/com/google/protobuf/NewInstanceSchemas.java",
"java/core/src/main/java/com/google/protobuf/NioByteString.java",
"java/core/src/main/java/com/google/protobuf/OneofInfo.java",
"java/core/src/main/java/com/google/protobuf/Parser.java",
"java/core/src/main/java/com/google/protobuf/PrimitiveNonBoxingCollection.java",
"java/core/src/main/java/com/google/protobuf/ProtoSyntax.java",
"java/core/src/main/java/com/google/protobuf/Protobuf.java",
"java/core/src/main/java/com/google/protobuf/ProtobufArrayList.java",
"java/core/src/main/java/com/google/protobuf/ProtobufLists.java",
"java/core/src/main/java/com/google/protobuf/ProtocolStringList.java",
"java/core/src/main/java/com/google/protobuf/RawMessageInfo.java",
"java/core/src/main/java/com/google/protobuf/Reader.java",
"java/core/src/main/java/com/google/protobuf/RopeByteString.java",
"java/core/src/main/java/com/google/protobuf/Schema.java",
"java/core/src/main/java/com/google/protobuf/SchemaFactory.java",
"java/core/src/main/java/com/google/protobuf/SchemaUtil.java",
"java/core/src/main/java/com/google/protobuf/SmallSortedMap.java",
"java/core/src/main/java/com/google/protobuf/StructuralMessageInfo.java",
"java/core/src/main/java/com/google/protobuf/TextFormatEscaper.java",
"java/core/src/main/java/com/google/protobuf/UninitializedMessageException.java",
"java/core/src/main/java/com/google/protobuf/UnknownFieldSchema.java",
"java/core/src/main/java/com/google/protobuf/UnknownFieldSetLite.java",
"java/core/src/main/java/com/google/protobuf/UnknownFieldSetLiteSchema.java",
"java/core/src/main/java/com/google/protobuf/UnmodifiableLazyStringList.java",
"java/core/src/main/java/com/google/protobuf/UnsafeUtil.java",
"java/core/src/main/java/com/google/protobuf/Utf8.java",
"java/core/src/main/java/com/google/protobuf/WireFormat.java",
"java/core/src/main/java/com/google/protobuf/Writer.java",
],
javacopts = select({
"//:jdk9": ["--add-modules=jdk.unsupported"],
"//conditions:default": [
"-source 7",
"-target 7",
],
}),
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
java_library( alias(
name = "protobuf_java_util", name = "protobuf_java_util",
srcs = glob([ actual = "//java/util",
"java/util/src/main/java/com/google/protobuf/util/*.java", visibility = ["//visibility:public"],
]), )
javacopts = [
"-source 7", alias(
"-target 7", name = "java_toolchain",
], actual = "//java/core:toolchain",
visibility = ["//visibility:public"],
)
alias(
name = "javalite_toolchain",
actual = "//java/lite:toolchain",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
deps = [
"protobuf_java",
"//external:error_prone_annotations",
"//external:gson",
"//external:guava",
],
) )
################################################################################ ################################################################################
@ -801,10 +748,9 @@ py_library(
name = "python_srcs", name = "python_srcs",
srcs = glob( srcs = glob(
[ [
"python/google/**/*.py", "python/google/protobuf/**/*.py",
], ],
exclude = [ exclude = [
"python/google/protobuf/**/__init__.py",
"python/google/protobuf/internal/*_test.py", "python/google/protobuf/internal/*_test.py",
"python/google/protobuf/internal/test_util.py", "python/google/protobuf/internal/test_util.py",
], ],
@ -819,6 +765,13 @@ cc_binary(
copts = COPTS + [ copts = COPTS + [
"-DPYTHON_PROTO2_CPP_IMPL_V2", "-DPYTHON_PROTO2_CPP_IMPL_V2",
], ],
tags = [
# Exclude this target from wildcard expansion (//...) because it may
# not even be buildable. It will be built if it is needed according
# to :use_fast_cpp_protos.
# https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
"manual",
],
linkshared = 1, linkshared = 1,
linkstatic = 1, linkstatic = 1,
deps = select({ deps = select({
@ -843,6 +796,13 @@ cc_binary(
"python/", "python/",
"src/", "src/",
], ],
tags = [
# Exclude this target from wildcard expansion (//...) because it may
# not even be buildable. It will be built if it is needed according
# to :use_fast_cpp_protos.
# https://docs.bazel.build/versions/master/be/common-definitions.html#common-attributes
"manual",
],
linkshared = 1, linkshared = 1,
linkstatic = 1, linkstatic = 1,
deps = [ deps = [
@ -859,6 +819,10 @@ config_setting(
values = { values = {
"define": "use_fast_cpp_protos=true", "define": "use_fast_cpp_protos=true",
}, },
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
config_setting( config_setting(
@ -866,6 +830,10 @@ config_setting(
values = { values = {
"define": "allow_oversize_protos=true", "define": "allow_oversize_protos=true",
}, },
visibility = [
# Public, but Protobuf only visibility.
"//:__subpackages__",
],
) )
# Copy the builtin proto files from src/google/protobuf to # Copy the builtin proto files from src/google/protobuf to
@ -897,7 +865,6 @@ py_proto_library(
}), }),
default_runtime = "", default_runtime = "",
protoc = ":protoc", protoc = ":protoc",
py_extra_srcs = glob(["python/**/__init__.py"]),
py_libs = [ py_libs = [
":python_srcs", ":python_srcs",
"@six//:six", "@six//:six",
@ -999,114 +966,23 @@ cc_library(
], ],
) )
# Note: We use `native_proto_common` here because we depend on an implementation-detail of
# `proto_lang_toolchain`, which may not be available on `proto_common`.
reject_blacklisted_files = hasattr(native_proto_common, "proto_lang_toolchain_rejects_files_do_not_use_or_we_will_break_you_without_mercy")
cc_toolchain_blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()] if reject_blacklisted_files else [":well_known_protos"]
proto_lang_toolchain( proto_lang_toolchain(
name = "cc_toolchain", name = "cc_toolchain",
blacklisted_protos = cc_toolchain_blacklisted_protos, blacklisted_protos = [proto + "_proto" for proto in WELL_KNOWN_PROTO_MAP.keys()],
command_line = "--cpp_out=$(OUT)", command_line = "--cpp_out=$(OUT)",
runtime = ":protobuf", runtime = ":protobuf",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
proto_lang_toolchain( alias(
name = "java_toolchain", name = "objectivec",
command_line = "--java_out=$(OUT)", actual = "//objectivec",
runtime = ":protobuf_java",
visibility = ["//visibility:public"],
)
proto_lang_toolchain(
name = "javalite_toolchain",
command_line = "--java_out=lite:$(OUT)",
runtime = ":protobuf_javalite",
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )
alias( alias(
name = "objectivec",
actual = ":protobuf_objc",
visibility = ["//visibility:public"],
)
objc_library(
name = "protobuf_objc", name = "protobuf_objc",
hdrs = [ actual = "//objectivec",
"objectivec/GPBArray.h",
"objectivec/GPBBootstrap.h",
"objectivec/GPBCodedInputStream.h",
"objectivec/GPBCodedOutputStream.h",
"objectivec/GPBDescriptor.h",
"objectivec/GPBDictionary.h",
"objectivec/GPBExtensionInternals.h",
"objectivec/GPBExtensionRegistry.h",
"objectivec/GPBMessage.h",
"objectivec/GPBProtocolBuffers.h",
"objectivec/GPBProtocolBuffers_RuntimeSupport.h",
"objectivec/GPBRootObject.h",
"objectivec/GPBRuntimeTypes.h",
"objectivec/GPBUnknownField.h",
"objectivec/GPBUnknownFieldSet.h",
"objectivec/GPBUtilities.h",
"objectivec/GPBWellKnownTypes.h",
"objectivec/GPBWireFormat.h",
"objectivec/google/protobuf/Any.pbobjc.h",
"objectivec/google/protobuf/Api.pbobjc.h",
"objectivec/google/protobuf/Duration.pbobjc.h",
"objectivec/google/protobuf/Empty.pbobjc.h",
"objectivec/google/protobuf/FieldMask.pbobjc.h",
"objectivec/google/protobuf/SourceContext.pbobjc.h",
"objectivec/google/protobuf/Struct.pbobjc.h",
"objectivec/google/protobuf/Timestamp.pbobjc.h",
"objectivec/google/protobuf/Type.pbobjc.h",
"objectivec/google/protobuf/Wrappers.pbobjc.h",
# Package private headers, but exposed because the generated sources
# need to use them.
"objectivec/GPBArray_PackagePrivate.h",
"objectivec/GPBCodedInputStream_PackagePrivate.h",
"objectivec/GPBCodedOutputStream_PackagePrivate.h",
"objectivec/GPBDescriptor_PackagePrivate.h",
"objectivec/GPBDictionary_PackagePrivate.h",
"objectivec/GPBMessage_PackagePrivate.h",
"objectivec/GPBRootObject_PackagePrivate.h",
"objectivec/GPBUnknownFieldSet_PackagePrivate.h",
"objectivec/GPBUnknownField_PackagePrivate.h",
"objectivec/GPBUtilities_PackagePrivate.h",
],
copts = [
"-Wno-vla",
],
includes = [
"objectivec",
],
non_arc_srcs = [
"objectivec/GPBArray.m",
"objectivec/GPBCodedInputStream.m",
"objectivec/GPBCodedOutputStream.m",
"objectivec/GPBDescriptor.m",
"objectivec/GPBDictionary.m",
"objectivec/GPBExtensionInternals.m",
"objectivec/GPBExtensionRegistry.m",
"objectivec/GPBMessage.m",
"objectivec/GPBRootObject.m",
"objectivec/GPBUnknownField.m",
"objectivec/GPBUnknownFieldSet.m",
"objectivec/GPBUtilities.m",
"objectivec/GPBWellKnownTypes.m",
"objectivec/GPBWireFormat.m",
"objectivec/google/protobuf/Any.pbobjc.m",
"objectivec/google/protobuf/Api.pbobjc.m",
"objectivec/google/protobuf/Duration.pbobjc.m",
"objectivec/google/protobuf/Empty.pbobjc.m",
"objectivec/google/protobuf/FieldMask.pbobjc.m",
"objectivec/google/protobuf/SourceContext.pbobjc.m",
"objectivec/google/protobuf/Struct.pbobjc.m",
"objectivec/google/protobuf/Timestamp.pbobjc.m",
"objectivec/google/protobuf/Type.pbobjc.m",
"objectivec/google/protobuf/Wrappers.pbobjc.m",
],
visibility = ["//visibility:public"], visibility = ["//visibility:public"],
) )

View File

@ -1,3 +1,320 @@
Unreleased Changes (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C++
* MessageDifferencer: fixed bug when using custom ignore with multiple
unknown fields
* Use init_seg in MSVC to push initialization to an earlier phase.
* Runtime no longer triggers -Wsign-compare warnings.
* Fixed -Wtautological-constant-out-of-range-compare warning.
* DynamicCastToGenerated works for nullptr input for even if RTTI is disabled
* Arena is refactored and optimized.
* Clarified/specified that the exact value of Arena::SpaceAllocated() is an
implementation detail users must not rely on. It should not be used in
unit tests.
* Change the signature of Any::PackFrom() to return false on error.
Java
* Avoid possible UnsupportedOperationException when using CodedInputSteam
with a direct ByteBuffer.
* Make Durations.comparator() and Timestamps.comparator() Serializable.
* Add more detailed error information for dynamic message field type
validation failure
Python
* Provided an override for the reverse() method that will reverse the internal
collection directly instead of using the other methods of the BaseContainer.
2020-11-11 version 3.14.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Protocol Compiler
* The proto compiler no longer requires a .proto filename when it is not
generating code.
* Added flag `--deterministic_output` to `protoc --encode=...`.
* Fixed deadlock when using google.protobuf.Any embedded in aggregate options.
C++
* Arenas are now unconditionally enabled. cc_enable_arenas no longer has
any effect.
* Removed inlined string support, which is incompatible with arenas.
* Fix a memory corruption bug in reflection when mixing optional and
non-optional fields.
* Make SpaceUsed() calculation more thorough for map fields.
* Add stack overflow protection for text format with unknown field values.
* FieldPath::FollowAll() now returns a bool to signal if an out-of-bounds
error was encountered.
* Performance improvements for Map.
* Minor formatting fix when dumping a descriptor to .proto format with
DebugString.
* UBSAN fix in RepeatedField (#2073).
* When running under ASAN, skip a test that makes huge allocations.
* Fixed a crash that could happen when creating more than 256 extensions in
a single message.
* Fix a crash in BuildFile when passing in invalid descriptor proto.
* Parser security fix when operating with CodedInputStream.
* Warn against the use of AllowUnknownExtension.
* Migrated to C++11 for-range loops instead of index-based loops where
possible. This fixes a lot of warnings when compiling with -Wsign-compare.
* Fix segment fault for proto3 optional (#7805)
* Adds a CMake option to build `libprotoc` separately (#7949)
Java
* Bugfix in mergeFrom() when a oneof has multiple message fields.
* Fix RopeByteString.RopeInputStream.read() returning -1 when told to read
0 bytes when not at EOF.
* Redefine remove(Object) on primitive repeated field Lists to avoid
autoboxing.
* Support "\u" escapes in textformat string literals.
* Trailing empty spaces are no longer ignored for FieldMask.
* Fix FieldMaskUtil.subtract to recursively remove mask.
* Mark enums with `@java.lang.Deprecated` if the proto enum has option
`deprecated = true;`.
* Adding forgotten duration.proto to the lite library (#7738)
Python
* Print google.protobuf.NullValue as null instead of "NULL_VALUE" when it is
used outside WKT Value/Struct.
* Fix bug occurring when attempting to deep copy an enum type in python 3.
* Add a setuptools extension for generating Python protobufs (#7783)
* Remove uses of pkg_resources in non-namespace packages. (#7902)
* [bazel/py] Omit google/__init__.py from the Protobuf runtime. (#7908)
* Removed the unnecessary setuptools package dependency for Python package (#7511)
* Fix PyUnknownFields memory leak (#7928)
PHP
* Added support for "==" to the PHP C extension (#7883)
* Added `==` operators for Map and Array. (#7900)
* Native C well-known types (#7944)
* Optimized away hex2bin() call in generated code (#8006)
* New version of upb, and a new hash function wyhash in third_party. (#8000)
* add missing hasOneof method to check presence of oneof fields (#8003)
Go:
* Update go_package options to reference google.golang.org/protobuf module.
C#:
* annotate ByteString.CopyFrom(ReadOnlySpan<byte>) as SecuritySafeCritical (#7701)
* Fix C# optional field reflection when there are regular fields too (#7705)
* Fix parsing negative Int32Value that crosses segment boundary (#8035)
Javascript:
* JS: parse (un)packed fields conditionally (#7379)
2020-07-14 version 3.13.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
PHP:
* The C extension is completely rewritten. The new C extension has significantly
better parsing performance and fixes a handful of conformance issues. It will
also make it easier to add support for more features like proto2 and proto3 presence.
* The new C extension does not support PHP 5.x. PHP 5.x users can still use pure-PHP.
C++:
* Removed deprecated unsafe arena string accessors
* Enabled heterogeneous lookup for std::string keys in maps.
* Removed implicit conversion from StringPiece to std::string
* Fix use-after-destroy bug when the Map is allocated in the arena.
* Improved the randomness of map ordering
* Added stack overflow protection for text format with unknown fields
* Use std::hash for proto maps to help with portability.
* Added more Windows macros to proto whitelist.
* Arena constructors for map entry messages are now marked "explicit"
(for regular messages they were already explicit).
* Fix subtle aliasing bug in RepeatedField::Add
* Fix mismatch between MapEntry ByteSize and Serialize with respect to unset
fields.
Python:
* JSON format conformance fixes:
* Reject lowercase t for Timestamp json format.
* Print full_name directly for extensions (no camelCase).
* Reject boolean values for integer fields.
* Reject NaN, Infinity, -Infinity that is not quoted.
* Base64 fixes for bytes fields: accept URL-safe base64 and missing padding.
* Bugfix for fields/files named "async" or "await".
* Improved the error message when AttributeError is returned from __getattr__
in EnumTypeWrapper.
Java:
* Fixed a bug where setting optional proto3 enums with setFooValue() would
not mark the value as present.
* Add Subtract function to FieldMaskUtil.
C#:
* Dropped support for netstandard1.0 (replaced by support for netstandard1.1).
This was required to modernize the parsing stack to use the `Span<byte>`
type internally. (#7351)
* Add `ParseFrom(ReadOnlySequence<byte>)` method to enable GC friendly
parsing with reduced allocations and buffer copies. (#7351)
* Add support for serialization directly to a `IBufferWriter<byte>` or
to a `Span<byte>` to enable GC friendly serialization.
The new API is available as extension methods on the `IMessage` type. (#7576)
* Add `GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE` define to make
generated code compatible with old C# compilers (pre-roslyn compilers
from .NET framework and old versions of mono) that do not support
ref structs. Users that are still on a legacy stack that does
not support C# 7.2 compiler might need to use the new define
in their projects to be able to build the newly generated code. (#7490)
* Due to the major overhaul of parsing and serialization internals (#7351 and #7576),
it is recommended to regenerate your generated code to achieve the best
performance (the legacy generated code will still work, but might incur
a slight performance penalty).
2020-07-28 version 3.12.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
This release contains no significant changes, but exists because 3.12.3 was
mistakenly tagged at the wrong commit.
2020-06-01 version 3.12.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Objective-C
* Tweak the union used for Extensions to support old generated code. #7573
2020-05-26 version 3.12.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C++
* Simplified the template export macros to fix the build for mingw32. (#7539)
Objective-C
* Fix for the :protobuf_objc target in the Bazel BUILD file. (#7538)
2020-05-20 version 3.12.1 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Ruby
* Re-add binary gems for Ruby 2.3 and 2.4. These are EOL upstream, however
many people still use them and dropping support will require more
coordination.
2020-05-12 version 3.12.0 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
Protocol Compiler
* [experimental] Singular, non-message typed fields in proto3 now support
presence tracking. This is enabled by adding the "optional" field label and
passing the --experimental_allow_proto3_optional flag to protoc.
* For usage info, see docs/field_presence.md.
* During this experimental phase, code generators should update to support
proto3 presence, see docs/implementing_proto3_presence.md for instructions.
* Allow duplicate symbol names when multiple descriptor sets are passed on
the command-line, to match the behavior when multiple .proto files are passed.
* Deterministic `protoc --descriptor_set_out` (#7175)
C++
* [experimental] Added proto3 presence support.
* New descriptor APIs to support proto3 presence.
* Enable Arenas by default on all .proto files.
* Documented that users are not allowed to subclass Message or MessageLite.
* Mark generated classes as final; inheriting from protos is strongly discouraged.
* Add stack overflow protection for text format with unknown fields.
* Add accessors for map key and value FieldDescriptors.
* Add FieldMaskUtil::FromFieldNumbers().
* MessageDifferencer: use ParsePartial() on Any fields so the diff does not
fail when there are missing required fields.
* ReflectionOps::Merge(): lookup messages in the right factory, if it can.
* Added Descriptor::WellKnownTypes enum and Descriptor::well_known_type()
accessor as an easier way of determining if a message is a Well-Known Type.
* Optimized RepeatedField::Add() when it is used in a loop.
* Made proto move/swap more efficient.
* De-virtualize the GetArena() method in MessageLite.
* Improves performance of json_stream_parser.cc by factor 1000 (#7230)
* bug: #7076 undefine Windows OUT and OPTIONAL macros (#7087)
* Fixed a bug in FieldDescriptor::DebugString() that would erroneously print
an "optional" label for a field in a oneof.
* Fix bug in parsing bool extensions that assumed they are always 1 byte.
* Fix off-by-one error in FieldOptions::ByteSize() when extensions are present.
* Clarified the comments to show an example of the difference between
Descriptor::extension and DescriptorPool::FindAllExtensions.
* Add a compiler option 'code_size' to force optimize_for=code_size on all
protos where this is possible.
Java
* [experimental] Added proto3 presence support.
* Mark java enum _VALUE constants as @Deprecated if the enum field is deprecated
* reduce <clinit> size for enums with allow_alias set to true.
* Sort map fields alphabetically by the field's key when printing textproto.
* Fixed a bug in map sorting that appeared in -rc1 and -rc2 (#7508).
* TextFormat.merge() handles Any as top level type.
* Throw a descriptive IllegalArgumentException when calling
getValueDescriptor() on enum special value UNRECOGNIZED instead of
ArrayIndexOutOfBoundsException.
* Fixed an issue with JsonFormat.printer() where setting printingEnumsAsInts()
would override the configuration passed into includingDefaultValueFields().
* Implement overrides of indexOf() and contains() on primitive lists returned
for repeated fields to avoid autoboxing the list contents.
* Add overload to FieldMaskUtil.fromStringList that accepts a descriptor.
* [bazel] Move Java runtime/toolchains into //java (#7190)
Python
* [experimental] Added proto3 presence support.
* [experimental] fast import protobuf module, only works with cpp generated code linked in.
* Truncate 'float' fields to 4 bytes of precision in setters for pure-Python
implementation (C++ extension was already doing this).
* Fixed a memory leak in C++ bindings.
* Added a deprecation warning when code tries to create Descriptor objects
directly.
* Fix unintended comparison between bytes and string in descriptor.py.
* Avoid printing excess digits for float fields in TextFormat.
* Remove Python 2.5 syntax compatibility from the proto compiler generated _pb2.py module code.
* Drop 3.3, 3.4 and use single version docker images for all python tests (#7396)
JavaScript
* Fix js message pivot selection (#6813)
PHP
* Persistent Descriptor Pool (#6899)
* Implement lazy loading of php class for proto messages (#6911)
* Correct @return in Any.unpack docblock (#7089)
* Ignore unknown enum value when ignore_unknown specified (#7455)
Ruby
* [experimental] Implemented proto3 presence for Ruby. (#7406)
* Stop building binary gems for ruby <2.5 (#7453)
* Fix for wrappers with a zero value (#7195)
* Fix for JSON serialization of 0/empty-valued wrapper types (#7198)
* Call "Class#new" over rb_class_new_instance in decoding (#7352)
* Build extensions for Ruby 2.7 (#7027)
* assigning 'nil' to submessage should clear the field. (#7397)
C#
* [experimental] Add support for proto3 presence fields in C# (#7382)
* Mark GetOption API as obsolete and expose the "GetOptions()" method on descriptors instead (#7491)
* Remove Has/Clear members for C# message fields in proto2 (#7429)
* Enforce recursion depth checking for unknown fields (#7132)
* Fix conformance test failures for Google.Protobuf (#6910)
* Cleanup various bits of Google.Protobuf (#6674)
* Fix latest ArgumentException for C# extensions (#6938)
* Remove unnecessary branch from ReadTag (#7289)
Objective-C
* [experimental] ObjC Proto3 optional support (#7421)
* Block subclassing of generated classes (#7124)
* Use references to Obj C classes instead of names in descriptors. (#7026)
* Revisit how the WKTs are bundled with ObjC. (#7173)
Other
* Add a proto_lang_toolchain for javalite (#6882)
* [bazel] Update gtest and deprecate //external:{gtest,gtest_main} (#7237)
* Add application note for explicit presence tracking. (#7390)
* Howto doc for implementing proto3 presence in a code generator. (#7407)
2020-02-14 version 3.11.4 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C#
* Fix latest ArgumentException for C# extensions (#7188)
* Enforce recursion depth checking for unknown fields (#7210)
Ruby
* Fix wrappers with a zero value (#7195)
* Fix JSON serialization of 0/empty-valued wrapper types (#7198)
2020-01-31 version 3.11.3 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
C++
* Add OUT and OPTIONAL to windows portability files (#7087)
PHP
* Refactored ulong to zend_ulong for php7.4 compatibility (#7147)
* Call register_class before getClass from desc to fix segfault (#7077)
2019-12-10 version 3.11.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript) 2019-12-10 version 3.11.2 (C++/Java/Python/PHP/Objective-C/C#/Ruby/JavaScript)
PHP PHP

View File

@ -78,6 +78,7 @@ csharp_EXTRA_DIST= \
csharp/protos/unittest_import.proto \ csharp/protos/unittest_import.proto \
csharp/protos/unittest_issues.proto \ csharp/protos/unittest_issues.proto \
csharp/protos/unittest_proto3.proto \ csharp/protos/unittest_proto3.proto \
csharp/protos/unittest_selfreferential_options.proto \
csharp/protos/unittest.proto \ csharp/protos/unittest.proto \
csharp/src/AddressBook/AddPerson.cs \ csharp/src/AddressBook/AddPerson.cs \
csharp/src/AddressBook/Addressbook.cs \ csharp/src/AddressBook/Addressbook.cs \
@ -85,20 +86,25 @@ csharp_EXTRA_DIST= \
csharp/src/AddressBook/ListPeople.cs \ csharp/src/AddressBook/ListPeople.cs \
csharp/src/AddressBook/Program.cs \ csharp/src/AddressBook/Program.cs \
csharp/src/AddressBook/SampleUsage.cs \ csharp/src/AddressBook/SampleUsage.cs \
csharp/src/Google.Protobuf.Benchmarks/BenchmarkDatasetConfig.cs \
csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \ csharp/src/Google.Protobuf.Benchmarks/BenchmarkMessage1Proto3.cs \
csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \ csharp/src/Google.Protobuf.Benchmarks/Benchmarks.cs \
csharp/src/Google.Protobuf.Benchmarks/ByteStringBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \ csharp/src/Google.Protobuf.Benchmarks/Google.Protobuf.Benchmarks.csproj \
csharp/src/Google.Protobuf.Benchmarks/GoogleMessageBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/ParseMessagesBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/ParseRawPrimitivesBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/Program.cs \ csharp/src/Google.Protobuf.Benchmarks/Program.cs \
csharp/src/Google.Protobuf.Benchmarks/SerializationBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/SerializationConfig.cs \
csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \ csharp/src/Google.Protobuf.Benchmarks/wrapper_benchmark_messages.proto \
csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \ csharp/src/Google.Protobuf.Benchmarks/WrapperBenchmarkMessages.cs \
csharp/src/Google.Protobuf.Benchmarks/WriteMessagesBenchmark.cs \
csharp/src/Google.Protobuf.Benchmarks/WriteRawPrimitivesBenchmark.cs \
csharp/src/Google.Protobuf.Conformance/Conformance.cs \ csharp/src/Google.Protobuf.Conformance/Conformance.cs \
csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \ csharp/src/Google.Protobuf.Conformance/Google.Protobuf.Conformance.csproj \
csharp/src/Google.Protobuf.Conformance/Program.cs \ csharp/src/Google.Protobuf.Conformance/Program.cs \
csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \ csharp/src/Google.Protobuf.JsonDump/Google.Protobuf.JsonDump.csproj \
csharp/src/Google.Protobuf.JsonDump/Program.cs \ csharp/src/Google.Protobuf.JsonDump/Program.cs \
csharp/src/Google.Protobuf.Test/Buffers/ArrayBufferWriter.cs \
csharp/src/Google.Protobuf.Test/ByteStringTest.cs \ csharp/src/Google.Protobuf.Test/ByteStringTest.cs \
csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \ csharp/src/Google.Protobuf.Test/CodedInputStreamExtensions.cs \
csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \ csharp/src/Google.Protobuf.Test/CodedInputStreamTest.cs \
@ -121,6 +127,11 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \ csharp/src/Google.Protobuf.Test/JsonFormatterTest.cs \
csharp/src/Google.Protobuf.Test/JsonParserTest.cs \ csharp/src/Google.Protobuf.Test/JsonParserTest.cs \
csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \ csharp/src/Google.Protobuf.Test/JsonTokenizerTest.cs \
csharp/src/Google.Protobuf.Test/LegacyGeneratedCodeTest.cs \
csharp/src/Google.Protobuf.Test/MessageParsingHelpers.cs \
csharp/src/Google.Protobuf.Test/Proto3OptionalTest.cs \
csharp/src/Google.Protobuf.Test/ReadOnlySequenceFactory.cs \
csharp/src/Google.Protobuf.Test/RefStructCompatibilityTest.cs \
csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/CustomOptionsTest.cs \
csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/DescriptorDeclarationTest.cs \
csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \ csharp/src/Google.Protobuf.Test/Reflection/DescriptorsTest.cs \
@ -147,6 +158,8 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestImport.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestIssues.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestProto3Optional.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestSelfreferentialOptions.cs \
csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \ csharp/src/Google.Protobuf.Test.TestProtos/UnittestWellKnownTypes.cs \
csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \ csharp/src/Google.Protobuf.Test.TestProtos/Unittest.cs \
csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \ csharp/src/Google.Protobuf.Test/WellKnownTypes/AnyTest.cs \
@ -159,6 +172,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf.sln \ csharp/src/Google.Protobuf.sln \
csharp/src/Google.Protobuf/ByteArray.cs \ csharp/src/Google.Protobuf/ByteArray.cs \
csharp/src/Google.Protobuf/ByteString.cs \ csharp/src/Google.Protobuf/ByteString.cs \
csharp/src/Google.Protobuf/ByteStringAsync.cs \
csharp/src/Google.Protobuf/CodedInputStream.cs \ csharp/src/Google.Protobuf/CodedInputStream.cs \
csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \ csharp/src/Google.Protobuf/CodedOutputStream.ComputeSize.cs \
csharp/src/Google.Protobuf/CodedOutputStream.cs \ csharp/src/Google.Protobuf/CodedOutputStream.cs \
@ -179,6 +193,7 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/FieldMaskTree.cs \ csharp/src/Google.Protobuf/FieldMaskTree.cs \
csharp/src/Google.Protobuf/FrameworkPortability.cs \ csharp/src/Google.Protobuf/FrameworkPortability.cs \
csharp/src/Google.Protobuf/Google.Protobuf.csproj \ csharp/src/Google.Protobuf/Google.Protobuf.csproj \
csharp/src/Google.Protobuf/IBufferMessage.cs \
csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \ csharp/src/Google.Protobuf/ICustomDiagnosticMessage.cs \
csharp/src/Google.Protobuf/IDeepCloneable.cs \ csharp/src/Google.Protobuf/IDeepCloneable.cs \
csharp/src/Google.Protobuf/IExtendableMessage.cs \ csharp/src/Google.Protobuf/IExtendableMessage.cs \
@ -193,7 +208,13 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/MessageExtensions.cs \ csharp/src/Google.Protobuf/MessageExtensions.cs \
csharp/src/Google.Protobuf/MessageParser.cs \ csharp/src/Google.Protobuf/MessageParser.cs \
csharp/src/Google.Protobuf/ObjectIntPair.cs \ csharp/src/Google.Protobuf/ObjectIntPair.cs \
csharp/src/Google.Protobuf/ParseContext.cs \
csharp/src/Google.Protobuf/ParserInternalState.cs \
csharp/src/Google.Protobuf/ParsingPrimitives.cs \
csharp/src/Google.Protobuf/ParsingPrimitivesMessages.cs \
csharp/src/Google.Protobuf/ParsingPrimitivesWrappers.cs \
csharp/src/Google.Protobuf/ProtoPreconditions.cs \ csharp/src/Google.Protobuf/ProtoPreconditions.cs \
csharp/src/Google.Protobuf/SegmentedBufferHelper.cs \
csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \ csharp/src/Google.Protobuf/Properties/AssemblyInfo.cs \
csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \ csharp/src/Google.Protobuf/Reflection/CustomOptions.cs \
csharp/src/Google.Protobuf/Reflection/Descriptor.cs \ csharp/src/Google.Protobuf/Reflection/Descriptor.cs \
@ -243,12 +264,19 @@ csharp_EXTRA_DIST= \
csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \ csharp/src/Google.Protobuf/WellKnownTypes/Wrappers.cs \
csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \ csharp/src/Google.Protobuf/WellKnownTypes/WrappersPartial.cs \
csharp/src/Google.Protobuf/WireFormat.cs \ csharp/src/Google.Protobuf/WireFormat.cs \
csharp/src/Google.Protobuf/WritingPrimitivesMessages.cs \
csharp/src/Google.Protobuf/WritingPrimitives.cs \
csharp/src/Google.Protobuf/WriterInternalState.cs \
csharp/src/Google.Protobuf/WriteContext.cs \
csharp/src/Google.Protobuf/WriteBufferHelper.cs \
csharp/src/Google.Protobuf/UnknownField.cs \ csharp/src/Google.Protobuf/UnknownField.cs \
csharp/src/Google.Protobuf/UnknownFieldSet.cs csharp/src/Google.Protobuf/UnknownFieldSet.cs \
csharp/src/Google.Protobuf/UnsafeByteOperations.cs
java_EXTRA_DIST= \ java_EXTRA_DIST= \
java/README.md \ java/README.md \
java/bom/pom.xml \ java/bom/pom.xml \
java/core/BUILD \
java/core/generate-sources-build.xml \ java/core/generate-sources-build.xml \
java/core/generate-test-sources-build.xml \ java/core/generate-test-sources-build.xml \
java/core/pom.xml \ java/core/pom.xml \
@ -504,6 +532,7 @@ java_EXTRA_DIST=
java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \ java/core/src/test/proto/com/google/protobuf/test_extra_interfaces.proto \
java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \ java/core/src/test/proto/com/google/protobuf/wrappers_test.proto \
java/lite.md \ java/lite.md \
java/lite/BUILD \
java/lite/generate-sources-build.xml \ java/lite/generate-sources-build.xml \
java/lite/generate-test-sources-build.xml \ java/lite/generate-test-sources-build.xml \
java/lite/lite.awk \ java/lite/lite.awk \
@ -512,6 +541,7 @@ java_EXTRA_DIST=
java/lite/src/test/java/com/google/protobuf/LiteTest.java \ java/lite/src/test/java/com/google/protobuf/LiteTest.java \
java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \ java/lite/src/test/java/com/google/protobuf/Proto2MessageLiteInfoFactory.java \
java/pom.xml \ java/pom.xml \
java/util/BUILD \
java/util/pom.xml \ java/util/pom.xml \
java/util/src/main/java/com/google/protobuf/util/Durations.java \ java/util/src/main/java/com/google/protobuf/util/Durations.java \
java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \ java/util/src/main/java/com/google/protobuf/util/FieldMaskTree.java \
@ -524,13 +554,14 @@ java_EXTRA_DIST=
java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskTreeTest.java \
java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/FieldMaskUtilTest.java \
java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \ java/util/src/test/java/com/google/protobuf/util/JsonFormatTest.java \
java/util/src/test/java/com/google/protobuf/util/StructsTest.java \ java/util/src/test/java/com/google/protobuf/util/StructsTest.java \
java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \ java/util/src/test/java/com/google/protobuf/util/TimeUtilTest.java \
java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \ java/util/src/test/java/com/google/protobuf/util/ValuesTest.java \
java/util/src/test/proto/com/google/protobuf/util/json_test.proto java/util/src/test/proto/com/google/protobuf/util/json_test.proto
objectivec_EXTRA_DIST= \ objectivec_EXTRA_DIST= \
objectivec/.clang-format \ objectivec/.clang-format \
objectivec/BUILD \
objectivec/DevTools/check_version_stamps.sh \ objectivec/DevTools/check_version_stamps.sh \
objectivec/DevTools/compile_testing_protos.sh \ objectivec/DevTools/compile_testing_protos.sh \
objectivec/DevTools/full_mac_build.sh \ objectivec/DevTools/full_mac_build.sh \
@ -538,25 +569,19 @@ objectivec_EXTRA_DIST= \
objectivec/DevTools/pddm_tests.py \ objectivec/DevTools/pddm_tests.py \
objectivec/generate_well_known_types.sh \ objectivec/generate_well_known_types.sh \
objectivec/google/protobuf/Any.pbobjc.h \ objectivec/google/protobuf/Any.pbobjc.h \
objectivec/google/protobuf/Any.pbobjc.m \
objectivec/google/protobuf/Api.pbobjc.h \ objectivec/google/protobuf/Api.pbobjc.h \
objectivec/google/protobuf/Api.pbobjc.m \
objectivec/google/protobuf/Duration.pbobjc.h \ objectivec/google/protobuf/Duration.pbobjc.h \
objectivec/google/protobuf/Duration.pbobjc.m \
objectivec/google/protobuf/Empty.pbobjc.h \ objectivec/google/protobuf/Empty.pbobjc.h \
objectivec/google/protobuf/Empty.pbobjc.m \
objectivec/google/protobuf/FieldMask.pbobjc.h \ objectivec/google/protobuf/FieldMask.pbobjc.h \
objectivec/google/protobuf/FieldMask.pbobjc.m \
objectivec/google/protobuf/SourceContext.pbobjc.h \ objectivec/google/protobuf/SourceContext.pbobjc.h \
objectivec/google/protobuf/SourceContext.pbobjc.m \
objectivec/google/protobuf/Struct.pbobjc.h \ objectivec/google/protobuf/Struct.pbobjc.h \
objectivec/google/protobuf/Struct.pbobjc.m \
objectivec/google/protobuf/Timestamp.pbobjc.h \ objectivec/google/protobuf/Timestamp.pbobjc.h \
objectivec/google/protobuf/Timestamp.pbobjc.m \
objectivec/google/protobuf/Type.pbobjc.h \ objectivec/google/protobuf/Type.pbobjc.h \
objectivec/google/protobuf/Type.pbobjc.m \
objectivec/google/protobuf/Wrappers.pbobjc.h \ objectivec/google/protobuf/Wrappers.pbobjc.h \
objectivec/google/protobuf/Wrappers.pbobjc.m \ objectivec/GPBAny.pbobjc.h \
objectivec/GPBAny.pbobjc.m \
objectivec/GPBApi.pbobjc.h \
objectivec/GPBApi.pbobjc.m \
objectivec/GPBArray.h \ objectivec/GPBArray.h \
objectivec/GPBArray.m \ objectivec/GPBArray.m \
objectivec/GPBArray_PackagePrivate.h \ objectivec/GPBArray_PackagePrivate.h \
@ -573,10 +598,16 @@ objectivec_EXTRA_DIST= \
objectivec/GPBDictionary.h \ objectivec/GPBDictionary.h \
objectivec/GPBDictionary.m \ objectivec/GPBDictionary.m \
objectivec/GPBDictionary_PackagePrivate.h \ objectivec/GPBDictionary_PackagePrivate.h \
objectivec/GPBDuration.pbobjc.h \
objectivec/GPBDuration.pbobjc.m \
objectivec/GPBEmpty.pbobjc.h \
objectivec/GPBEmpty.pbobjc.m \
objectivec/GPBExtensionInternals.h \ objectivec/GPBExtensionInternals.h \
objectivec/GPBExtensionInternals.m \ objectivec/GPBExtensionInternals.m \
objectivec/GPBExtensionRegistry.h \ objectivec/GPBExtensionRegistry.h \
objectivec/GPBExtensionRegistry.m \ objectivec/GPBExtensionRegistry.m \
objectivec/GPBFieldMask.pbobjc.h \
objectivec/GPBFieldMask.pbobjc.m \
objectivec/GPBMessage.h \ objectivec/GPBMessage.h \
objectivec/GPBMessage.m \ objectivec/GPBMessage.m \
objectivec/GPBMessage_PackagePrivate.h \ objectivec/GPBMessage_PackagePrivate.h \
@ -587,6 +618,14 @@ objectivec_EXTRA_DIST= \
objectivec/GPBRootObject.m \ objectivec/GPBRootObject.m \
objectivec/GPBRootObject_PackagePrivate.h \ objectivec/GPBRootObject_PackagePrivate.h \
objectivec/GPBRuntimeTypes.h \ objectivec/GPBRuntimeTypes.h \
objectivec/GPBSourceContext.pbobjc.h \
objectivec/GPBSourceContext.pbobjc.m \
objectivec/GPBStruct.pbobjc.h \
objectivec/GPBStruct.pbobjc.m \
objectivec/GPBTimestamp.pbobjc.h \
objectivec/GPBTimestamp.pbobjc.m \
objectivec/GPBType.pbobjc.h \
objectivec/GPBType.pbobjc.m \
objectivec/GPBUnknownField.h \ objectivec/GPBUnknownField.h \
objectivec/GPBUnknownField.m \ objectivec/GPBUnknownField.m \
objectivec/GPBUnknownField_PackagePrivate.h \ objectivec/GPBUnknownField_PackagePrivate.h \
@ -600,6 +639,8 @@ objectivec_EXTRA_DIST= \
objectivec/GPBWellKnownTypes.m \ objectivec/GPBWellKnownTypes.m \
objectivec/GPBWireFormat.h \ objectivec/GPBWireFormat.h \
objectivec/GPBWireFormat.m \ objectivec/GPBWireFormat.m \
objectivec/GPBWrappers.pbobjc.h \
objectivec/GPBWrappers.pbobjc.m \
objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \ objectivec/ProtocolBuffers_iOS.xcodeproj/project.pbxproj \
objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \ objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/contents.xcworkspacedata \
objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \ objectivec/ProtocolBuffers_iOS.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist \
@ -730,24 +771,30 @@ php_EXTRA_DIST= \
composer.json \ composer.json \
php/README.md \ php/README.md \
php/composer.json \ php/composer.json \
php/ext/google/protobuf/arena.c \
php/ext/google/protobuf/arena.h \
php/ext/google/protobuf/array.c \ php/ext/google/protobuf/array.c \
php/ext/google/protobuf/builtin_descriptors.inc \ php/ext/google/protobuf/array.h \
php/ext/google/protobuf/config.m4 \ php/ext/google/protobuf/config.m4 \
php/ext/google/protobuf/convert.c \
php/ext/google/protobuf/convert.h \
php/ext/google/protobuf/def.c \ php/ext/google/protobuf/def.c \
php/ext/google/protobuf/encode_decode.c \ php/ext/google/protobuf/def.h \
php/ext/google/protobuf/map.c \ php/ext/google/protobuf/map.c \
php/ext/google/protobuf/map.h \
php/ext/google/protobuf/message.c \ php/ext/google/protobuf/message.c \
php/ext/google/protobuf/message.h \
php/ext/google/protobuf/names.c \
php/ext/google/protobuf/names.h \
php/ext/google/protobuf/package.xml \ php/ext/google/protobuf/package.xml \
php/ext/google/protobuf/php-upb.c \
php/ext/google/protobuf/php-upb.h \
php/ext/google/protobuf/protobuf.c \ php/ext/google/protobuf/protobuf.c \
php/ext/google/protobuf/protobuf.h \ php/ext/google/protobuf/protobuf.h \
php/ext/google/protobuf/storage.c \ php/ext/google/protobuf/wkt.inc \
php/ext/google/protobuf/type_check.c \
php/ext/google/protobuf/upb.c \
php/ext/google/protobuf/upb.h \
php/ext/google/protobuf/utf8.c \
php/ext/google/protobuf/utf8.h \
php/generate_descriptor_protos.sh \ php/generate_descriptor_protos.sh \
php/phpunit.xml \ php/phpunit.xml \
php/prepare_c_extension.sh \
php/release.sh \ php/release.sh \
php/src/GPBMetadata/Google/Protobuf/Any.php \ php/src/GPBMetadata/Google/Protobuf/Any.php \
php/src/GPBMetadata/Google/Protobuf/Api.php \ php/src/GPBMetadata/Google/Protobuf/Api.php \
@ -783,6 +830,7 @@ php_EXTRA_DIST= \
php/src/Google/Protobuf/GPBEmpty.php \ php/src/Google/Protobuf/GPBEmpty.php \
php/src/Google/Protobuf/Int32Value.php \ php/src/Google/Protobuf/Int32Value.php \
php/src/Google/Protobuf/Int64Value.php \ php/src/Google/Protobuf/Int64Value.php \
php/src/Google/Protobuf/Internal/AnyBase.php \
php/src/Google/Protobuf/Internal/CodedInputStream.php \ php/src/Google/Protobuf/Internal/CodedInputStream.php \
php/src/Google/Protobuf/Internal/CodedOutputStream.php \ php/src/Google/Protobuf/Internal/CodedOutputStream.php \
php/src/Google/Protobuf/Internal/Descriptor.php \ php/src/Google/Protobuf/Internal/Descriptor.php \
@ -842,6 +890,7 @@ php_EXTRA_DIST= \
php/src/Google/Protobuf/Internal/ServiceOptions.php \ php/src/Google/Protobuf/Internal/ServiceOptions.php \
php/src/Google/Protobuf/Internal/SourceCodeInfo.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo.php \
php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \ php/src/Google/Protobuf/Internal/SourceCodeInfo/Location.php \
php/src/Google/Protobuf/Internal/TimestampBase.php \
php/src/Google/Protobuf/Internal/UninterpretedOption.php \ php/src/Google/Protobuf/Internal/UninterpretedOption.php \
php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \ php/src/Google/Protobuf/Internal/UninterpretedOption/NamePart.php \
php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \ php/src/Google/Protobuf/Internal/DescriptorProto_ExtensionRange.php \
@ -872,22 +921,23 @@ php_EXTRA_DIST= \
php/src/Google/Protobuf/UInt64Value.php \ php/src/Google/Protobuf/UInt64Value.php \
php/src/Google/Protobuf/Value.php \ php/src/Google/Protobuf/Value.php \
php/src/phpdoc.dist.xml \ php/src/phpdoc.dist.xml \
php/tests/array_test.php \ php/tests/ArrayTest.php \
php/tests/autoload.php \ php/tests/autoload.php \
php/tests/bootstrap_phpunit.php \ php/tests/bootstrap_phpunit.php \
php/tests/compatibility_test.sh \ php/tests/compatibility_test.sh \
php/tests/compile_extension.sh \ php/tests/compile_extension.sh \
php/tests/descriptors_test.php \ php/tests/DescriptorsTest.php \
php/tests/encode_decode_test.php \ php/tests/EncodeDecodeTest.php \
php/tests/gdb_test.sh \ php/tests/gdb_test.sh \
php/tests/generated_class_test.php \ php/tests/generate_protos.sh \
php/tests/generated_phpdoc_test.php \ php/tests/GeneratedClassTest.php \
php/tests/generated_service_test.php \ php/tests/GeneratedPhpdocTest.php \
php/tests/map_field_test.php \ php/tests/GeneratedServiceTest.php \
php/tests/MapFieldTest.php \
php/tests/memory_leak_test.php \ php/tests/memory_leak_test.php \
php/tests/multirequest.php \ php/tests/multirequest.php \
php/tests/multirequest.sh \ php/tests/multirequest.sh \
php/tests/php_implementation_test.php \ php/tests/PhpImplementationTest.php \
php/tests/proto/empty/echo.proto \ php/tests/proto/empty/echo.proto \
php/tests/proto/test.proto \ php/tests/proto/test.proto \
php/tests/proto/test_descriptors.proto \ php/tests/proto/test_descriptors.proto \
@ -910,8 +960,9 @@ php_EXTRA_DIST= \
php/tests/test_base.php \ php/tests/test_base.php \
php/tests/test_util.php \ php/tests/test_util.php \
php/tests/undefined_test.php \ php/tests/undefined_test.php \
php/tests/well_known_test.php \ php/tests/valgrind.supp \
php/tests/wrapper_type_setters_test.php php/tests/WellKnownTest.php \
php/tests/WrapperTypeSettersTest.php
python_EXTRA_DIST= \ python_EXTRA_DIST= \
python/MANIFEST.in \ python/MANIFEST.in \
@ -963,6 +1014,7 @@ python_EXTRA_DIST= \
python/google/protobuf/internal/service_reflection_test.py \ python/google/protobuf/internal/service_reflection_test.py \
python/google/protobuf/internal/symbol_database_test.py \ python/google/protobuf/internal/symbol_database_test.py \
python/google/protobuf/internal/test_bad_identifiers.proto \ python/google/protobuf/internal/test_bad_identifiers.proto \
python/google/protobuf/internal/test_proto3_optional.proto \
python/google/protobuf/internal/test_util.py \ python/google/protobuf/internal/test_util.py \
python/google/protobuf/internal/testing_refleaks.py \ python/google/protobuf/internal/testing_refleaks.py \
python/google/protobuf/internal/text_encoding_test.py \ python/google/protobuf/internal/text_encoding_test.py \
@ -1177,6 +1229,10 @@ js_EXTRA_DIST= \
js/data.proto \ js/data.proto \
js/debug.js \ js/debug.js \
js/debug_test.js \ js/debug_test.js \
js/experimental/runtime/kernel/message_set.js \
js/experimental/runtime/kernel/message_set_test.js \
js/experimental/runtime/kernel/tag.js \
js/experimental/runtime/kernel/tag_test.js \
js/gulpfile.js \ js/gulpfile.js \
js/jasmine.json \ js/jasmine.json \
js/map.js \ js/map.js \
@ -1202,7 +1258,79 @@ js_EXTRA_DIST= \
js/test15.proto \ js/test15.proto \
js/test_bootstrap.js \ js/test_bootstrap.js \
js/testbinary.proto \ js/testbinary.proto \
js/testempty.proto js/testempty.proto \
js/testlargenumbers.proto \
js/experimental/runtime/testing/jasmine_protobuf.js \
js/experimental/runtime/testing/ensure_custom_equality_test.js \
js/experimental/runtime/testing/binary/test_message.js \
js/experimental/runtime/kernel/writer_test.js \
js/experimental/runtime/kernel/writer.js \
js/experimental/runtime/kernel/wire_type.js \
js/experimental/runtime/kernel/uint8arrays_test.js \
js/experimental/runtime/kernel/uint8arrays.js \
js/experimental/runtime/kernel/uint32_test_pairs.js \
js/experimental/runtime/kernel/typed_arrays_test.js \
js/experimental/runtime/kernel/typed_arrays.js \
js/experimental/runtime/kernel/textencoding_test.js \
js/experimental/runtime/kernel/textencoding.js \
js/experimental/runtime/kernel/storage.js \
js/experimental/runtime/kernel/sint64_test_pairs.js \
js/experimental/runtime/kernel/sint32_test_pairs.js \
js/experimental/runtime/kernel/sfixed64_test_pairs.js \
js/experimental/runtime/kernel/sfixed32_test_pairs.js \
js/experimental/runtime/kernel/reader_test.js \
js/experimental/runtime/kernel/reader.js \
js/experimental/runtime/kernel/packed_uint32_test_pairs.js \
js/experimental/runtime/kernel/packed_sint64_test_pairs.js \
js/experimental/runtime/kernel/packed_sint32_test_pairs.js \
js/experimental/runtime/kernel/packed_sfixed64_test_pairs.js \
js/experimental/runtime/kernel/packed_sfixed32_test_pairs.js \
js/experimental/runtime/kernel/packed_int64_test_pairs.js \
js/experimental/runtime/kernel/packed_int32_test_pairs.js \
js/experimental/runtime/kernel/packed_float_test_pairs.js \
js/experimental/runtime/kernel/packed_fixed32_test_pairs.js \
js/experimental/runtime/kernel/packed_double_test_pairs.js \
js/experimental/runtime/kernel/packed_bool_test_pairs.js \
js/experimental/runtime/kernel/kernel_test.js \
js/experimental/runtime/kernel/kernel_repeated_test.js \
js/experimental/runtime/kernel/kernel_compatibility_test.js \
js/experimental/runtime/kernel/kernel.js \
js/experimental/runtime/kernel/internal_message.js \
js/experimental/runtime/kernel/int64_test_pairs.js \
js/experimental/runtime/kernel/int32_test_pairs.js \
js/experimental/runtime/kernel/indexer_test.js \
js/experimental/runtime/kernel/indexer.js \
js/experimental/runtime/kernel/float_test_pairs.js \
js/experimental/runtime/kernel/fixed32_test_pairs.js \
js/experimental/runtime/kernel/field.js \
js/experimental/runtime/kernel/double_test_pairs.js \
js/experimental/runtime/kernel/conformance/wire_format.js \
js/experimental/runtime/kernel/conformance/test_all_types_proto3.js \
js/experimental/runtime/kernel/conformance/test_all_types_proto2.js \
js/experimental/runtime/kernel/conformance/conformance_testee_runner_node.js \
js/experimental/runtime/kernel/conformance/conformance_testee.js \
js/experimental/runtime/kernel/conformance/conformance_response.js \
js/experimental/runtime/kernel/conformance/conformance_request.js \
js/experimental/runtime/kernel/buffer_decoder_test.js \
js/experimental/runtime/kernel/buffer_decoder_helper.js \
js/experimental/runtime/kernel/buffer_decoder.js \
js/experimental/runtime/kernel/bool_test_pairs.js \
js/experimental/runtime/kernel/binary_storage_test.js \
js/experimental/runtime/kernel/binary_storage.js \
js/experimental/runtime/internal/checks_test.js \
js/experimental/runtime/internal/checks.js \
js/experimental/runtime/int64_test.js \
js/experimental/runtime/int64.js \
js/experimental/runtime/bytestring_test.js \
js/experimental/runtime/bytestring_internal.js \
js/experimental/runtime/bytestring.js \
js/experimental/benchmarks/code_size/kernel/popular_types.js \
js/experimental/benchmarks/code_size/kernel/all_types.js \
js/experimental/benchmarks/code_size/code_size_base.js \
js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto3.js \
js/experimental/benchmarks/code_size/apps_jspb/popular_types_proto2.js \
js/experimental/benchmarks/code_size/apps_jspb/all_types_proto3.js \
js/experimental/benchmarks/code_size/apps_jspb/all_types_proto2.js
all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST) all_EXTRA_DIST=$(csharp_EXTRA_DIST) $(java_EXTRA_DIST) $(objectivec_EXTRA_DIST) $(php_EXTRA_DIST) $(python_EXTRA_DIST) $(ruby_EXTRA_DIST) $(js_EXTRA_DIST)
@ -1218,7 +1346,7 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
WORKSPACE \ WORKSPACE \
cmake/CMakeLists.txt \ cmake/CMakeLists.txt \
cmake/README.md \ cmake/README.md \
cmake/conformance.cmake \ cmake/conformance.cmake \
cmake/examples.cmake \ cmake/examples.cmake \
cmake/extract_includes.bat.in \ cmake/extract_includes.bat.in \
cmake/install.cmake \ cmake/install.cmake \
@ -1235,6 +1363,8 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
cmake/tests.cmake \ cmake/tests.cmake \
cmake/version.rc.in \ cmake/version.rc.in \
compiler_config_setting.bzl \ compiler_config_setting.bzl \
build_files_updated_unittest.sh \
cc_proto_blacklist_test.bzl \
editors/README.txt \ editors/README.txt \
editors/proto.vim \ editors/proto.vim \
editors/protobuf-mode.el \ editors/protobuf-mode.el \
@ -1265,6 +1395,8 @@ EXTRA_DIST = $(@DIST_LANG@_EXTRA_DIST) \
python/release/wheel/README.md \ python/release/wheel/README.md \
third_party/six.BUILD \ third_party/six.BUILD \
third_party/zlib.BUILD \ third_party/zlib.BUILD \
third_party/wyhash/LICENSE \
third_party/wyhash/wyhash.h \
util/python/BUILD util/python/BUILD

View File

@ -1,6 +1,6 @@
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Protobuf-C++' s.name = 'Protobuf-C++'
s.version = '3.11.2' s.version = '3.14.0'
s.summary = 'Protocol Buffers v3 runtime library for C++.' s.summary = 'Protocol Buffers v3 runtime library for C++.'
s.homepage = 'https://github.com/google/protobuf' s.homepage = 'https://github.com/google/protobuf'
s.license = '3-Clause BSD License' s.license = '3-Clause BSD License'

View File

@ -5,28 +5,27 @@
# dependent projects use the :git notation to refer to the library. # dependent projects use the :git notation to refer to the library.
Pod::Spec.new do |s| Pod::Spec.new do |s|
s.name = 'Protobuf' s.name = 'Protobuf'
s.version = '3.11.2' s.version = '3.14.0'
s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.' s.summary = 'Protocol Buffers v.3 runtime library for Objective-C.'
s.homepage = 'https://github.com/protocolbuffers/protobuf' s.homepage = 'https://github.com/protocolbuffers/protobuf'
s.license = '3-Clause BSD License' s.license = '3-Clause BSD License'
s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' } s.authors = { 'The Protocol Buffers contributors' => 'protobuf@googlegroups.com' }
s.cocoapods_version = '>= 1.0' s.cocoapods_version = '>= 1.0'
s.module_name = 'protobuf'
s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git', s.source = { :git => 'https://github.com/protocolbuffers/protobuf.git',
:tag => "v#{s.version}" } :tag => "v#{s.version}" }
s.source_files = 'objectivec/*.{h,m}', s.source_files = 'objectivec/*.{h,m}',
'objectivec/google/protobuf/Any.pbobjc.{h,m}', 'objectivec/google/protobuf/Any.pbobjc.h',
'objectivec/google/protobuf/Api.pbobjc.{h,m}', 'objectivec/google/protobuf/Api.pbobjc.h',
'objectivec/google/protobuf/Duration.pbobjc.{h,m}', 'objectivec/google/protobuf/Duration.pbobjc.h',
'objectivec/google/protobuf/Empty.pbobjc.{h,m}', 'objectivec/google/protobuf/Empty.pbobjc.h',
'objectivec/google/protobuf/FieldMask.pbobjc.{h,m}', 'objectivec/google/protobuf/FieldMask.pbobjc.h',
'objectivec/google/protobuf/SourceContext.pbobjc.{h,m}', 'objectivec/google/protobuf/SourceContext.pbobjc.h',
'objectivec/google/protobuf/Struct.pbobjc.{h,m}', 'objectivec/google/protobuf/Struct.pbobjc.h',
'objectivec/google/protobuf/Timestamp.pbobjc.{h,m}', 'objectivec/google/protobuf/Timestamp.pbobjc.h',
'objectivec/google/protobuf/Type.pbobjc.{h,m}', 'objectivec/google/protobuf/Type.pbobjc.h',
'objectivec/google/protobuf/Wrappers.pbobjc.{h,m}' 'objectivec/google/protobuf/Wrappers.pbobjc.h'
# The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be # The following would cause duplicate symbol definitions. GPBProtocolBuffers is expected to be
# left out, as it's an umbrella implementation file. # left out, as it's an umbrella implementation file.
s.exclude_files = 'objectivec/GPBProtocolBuffers.m' s.exclude_files = 'objectivec/GPBProtocolBuffers.m'
@ -35,7 +34,7 @@ Pod::Spec.new do |s|
s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } s.user_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' } s.pod_target_xcconfig = { 'GCC_PREPROCESSOR_DEFINITIONS' => '$(inherited) GPB_USE_PROTOBUF_FRAMEWORK_IMPORTS=1' }
s.ios.deployment_target = '7.0' s.ios.deployment_target = '9.0'
s.osx.deployment_target = '10.9' s.osx.deployment_target = '10.9'
s.tvos.deployment_target = '9.0' s.tvos.deployment_target = '9.0'
s.watchos.deployment_target = '2.0' s.watchos.deployment_target = '2.0'

View File

@ -56,12 +56,12 @@ how to install protobuf runtime for that specific language:
|--------------------------------------|-------------------------------------------------------------|--------|-------|---------| |--------------------------------------|-------------------------------------------------------------|--------|-------|---------|
| C++ (include C++ runtime and protoc) | [src](src) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcpp_distcheck%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-bazel.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fbazel%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-dist_install.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fdist_install%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp_distcheck%2Fcontinuous) | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf) | | C++ (include C++ runtime and protoc) | [src](src) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcpp_distcheck%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-bazel.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fbazel%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-dist_install.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fdist_install%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-cpp_distcheck.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fcpp_distcheck%2Fcontinuous) | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf) |
| Java | [java](java) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_compatibility%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_jdk7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_jdk7%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_oracle7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_oracle7%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_linkage_monitor.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_linkage_monitor%2Fcontinuous) | | | | Java | [java](java) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_compatibility%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_jdk7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_jdk7%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_oracle7.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_oracle7%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-java_linkage_monitor.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjava_linkage_monitor%2Fcontinuous) | | |
| Python | [python](python) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python33.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython33%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python34.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython34%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_compatibility%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python33_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython33_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python34_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython34_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fpython_release%2Fcontinuous) | | Python | [python](python) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python_compatibility.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_compatibility%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python27_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython27_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python35_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython35_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python36_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython36_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python37_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython37_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python_cpp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_cpp%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fpython_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-python-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fpython_release%2Fcontinuous) |
| Objective-C | [objectivec](objectivec) | | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_cocoapods_integration.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_cocoapods_integration%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_debug.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_debug%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_release%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_osx.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_osx%2Fcontinuous) | | | Objective-C | [objectivec](objectivec) | | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_cocoapods_integration.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_cocoapods_integration%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_debug.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_debug%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_ios_release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_ios_release%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-objectivec_osx.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fobjectivec_osx%2Fcontinuous) | |
| C# | [csharp](csharp) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-csharp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcsharp%2Fcontinuous) | | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-csharp-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fcsharp_release%2Fcontinuous) | | C# | [csharp](csharp) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-csharp.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fcsharp%2Fcontinuous) | | [![Build status](https://ci.appveyor.com/api/projects/status/73ctee6ua4w2ruin?svg=true)](https://ci.appveyor.com/project/protobuf/protobuf)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/windows-csharp-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fwindows%2Fcsharp_release%2Fcontinuous) |
| JavaScript | [js](js) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjavascript%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fjavascript%2Fcontinuous) | | | JavaScript | [js](js) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fjavascript%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-javascript.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fjavascript%2Fcontinuous) | |
| Ruby | [ruby](ruby) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby23%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby24%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby25%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby26%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby23%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby24%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby25%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby26%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby_release%2Fcontinuous) | | | Ruby | [ruby](ruby) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby23%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby24%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby25%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby26%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fruby_release%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby23.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby23%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby24.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby24%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby25.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby25%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby26.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby26%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-ruby-release.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fruby_release%2Fcontinuous) | |
| Go | [golang/protobuf](https://github.com/golang/protobuf) | | | | | Go | [protocolbuffers/protobuf-go](https://github.com/protocolbuffers/protobuf-go) | | | |
| PHP | [php](php) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-php_all.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fphp_all%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-32-bit.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2F32-bit%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php5.6_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp5.6_mac%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php7.0_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp7.0_mac%2Fcontinuous) | | | PHP | [php](php) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-php_all.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2Fphp_all%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/linux-32-bit.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fubuntu%2F32-bit%2Fcontinuous) | [![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php5.6_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp5.6_mac%2Fcontinuous)<br/>[![Build status](https://storage.googleapis.com/protobuf-kokoro-results/status-badge/macos-php7.0_mac.png)](https://fusion.corp.google.com/projectanalysis/current/KOKORO/prod:protobuf%2Fgithub%2Fmaster%2Fmacos%2Fphp7.0_mac%2Fcontinuous) | |
| Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | [![Build Status](https://travis-ci.org/dart-lang/protobuf.svg?branch=master)](https://travis-ci.org/dart-lang/protobuf) | | | | Dart | [dart-lang/protobuf](https://github.com/dart-lang/protobuf) | [![Build Status](https://travis-ci.org/dart-lang/protobuf.svg?branch=master)](https://travis-ci.org/dart-lang/protobuf) | | |

View File

@ -1,13 +1,20 @@
workspace(name = "com_google_protobuf") workspace(name = "com_google_protobuf")
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
local_repository( local_repository(
name = "com_google_protobuf_examples", name = "com_google_protobuf_examples",
path = "examples", path = "examples",
) )
local_repository( http_archive(
name = "submodule_gmock", name = "com_google_googletest",
path = "third_party/googletest", sha256 = "9dc9157a9a1551ec7a7e43daea9a694a0bb5fb8bec81235d8a1e6ef64c716dcb",
strip_prefix = "googletest-release-1.10.0",
urls = [
"https://mirror.bazel.build/github.com/google/googletest/archive/release-1.10.0.tar.gz",
"https://github.com/google/googletest/archive/release-1.10.0.tar.gz",
],
) )
load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive") load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
@ -22,14 +29,16 @@ bind(
actual = "//util/python:python_headers", actual = "//util/python:python_headers",
) )
# TODO(yannic): Remove in 3.14.0.
bind( bind(
name = "gtest", name = "gtest",
actual = "@submodule_gmock//:gtest", actual = "@com_google_googletest//:gtest",
) )
# TODO(yannic): Remove in 3.14.0.
bind( bind(
name = "gtest_main", name = "gtest_main",
actual = "@submodule_gmock//:gtest_main", actual = "@com_google_googletest//:gtest_main",
) )
jvm_maven_import_external( jvm_maven_import_external(

View File

@ -135,7 +135,7 @@ $ make go
### PHP ### PHP
We have two version of php protobuf implemention: pure php, php with c extension. To run these version benchmark, you need to: We have two version of php protobuf implementation: pure php, php with c extension. To run these version benchmark, you need to:
#### Pure PHP #### Pure PHP
``` ```
$ make php $ make php

View File

@ -1,3 +1,33 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Benchmark messages for proto2. // Benchmark messages for proto2.
syntax = "proto2"; syntax = "proto2";

View File

@ -1,3 +1,33 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// Benchmark messages for proto3. // Benchmark messages for proto3.
syntax = "proto3"; syntax = "proto3";

View File

@ -1,3 +1,35 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
// Benchmark messages for proto2. // Benchmark messages for proto2.
syntax = "proto2"; syntax = "proto2";

View File

@ -1,5 +1,39 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_1.proto"; import "datasets/google_message3/benchmark_message3_1.proto";
import "datasets/google_message3/benchmark_message3_2.proto"; import "datasets/google_message3/benchmark_message3_2.proto";
import "datasets/google_message3/benchmark_message3_3.proto"; import "datasets/google_message3/benchmark_message3_3.proto";
@ -7,7 +41,6 @@ import "datasets/google_message3/benchmark_message3_4.proto";
import "datasets/google_message3/benchmark_message3_5.proto"; import "datasets/google_message3/benchmark_message3_5.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -531,4 +564,3 @@ extend .benchmarks.google_message3.Message16945 {
repeated .benchmarks.google_message3.Message0 field17617 = 1080; repeated .benchmarks.google_message3.Message0 field17617 = 1080;
repeated int32 field17618 = 1084; repeated int32 field17618 = 1084;
} }

View File

@ -1,11 +1,44 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_2.proto"; import "datasets/google_message3/benchmark_message3_2.proto";
import "datasets/google_message3/benchmark_message3_3.proto"; import "datasets/google_message3/benchmark_message3_3.proto";
import "datasets/google_message3/benchmark_message3_5.proto"; import "datasets/google_message3/benchmark_message3_5.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -100,15 +133,13 @@ message Message36876 {
optional int32 field37047 = 115; optional int32 field37047 = 115;
optional int32 field37048 = 157; optional int32 field37048 = 157;
} }
repeated group Message36878 = 168 { repeated group Message36878 = 168 {}
}
repeated group Message36879 = 55 { repeated group Message36879 = 55 {
required string field37050 = 56; required string field37050 = 56;
optional int32 field37051 = 69; optional int32 field37051 = 69;
} }
repeated .benchmarks.google_message3.UnusedEmptyMessage field36984 = 78; repeated .benchmarks.google_message3.UnusedEmptyMessage field36984 = 78;
optional group Message36880 = 137 { optional group Message36880 = 137 {}
}
optional uint64 field36986 = 59; optional uint64 field36986 = 59;
optional bytes field36987 = 121; optional bytes field36987 = 121;
optional .benchmarks.google_message3.UnusedEmptyMessage field36988 = 2; optional .benchmarks.google_message3.UnusedEmptyMessage field36988 = 2;
@ -124,11 +155,9 @@ message Message36876 {
optional int32 field36998 = 47; optional int32 field36998 = 47;
optional int32 field36999 = 48; optional int32 field36999 = 48;
optional .benchmarks.google_message3.UnusedEmptyMessage field37000 = 68; optional .benchmarks.google_message3.UnusedEmptyMessage field37000 = 68;
repeated group Message36881 = 23 { repeated group Message36881 = 23 {}
}
optional .benchmarks.google_message3.Message4144 field37002 = 125; optional .benchmarks.google_message3.Message4144 field37002 = 125;
repeated group Message36882 = 35 { repeated group Message36882 = 35 {}
}
optional .benchmarks.google_message3.UnusedEmptyMessage field37004 = 49; optional .benchmarks.google_message3.UnusedEmptyMessage field37004 = 49;
optional .benchmarks.google_message3.Message18921 field37005 = 52; optional .benchmarks.google_message3.Message18921 field37005 = 52;
optional .benchmarks.google_message3.Message36858 field37006 = 46; optional .benchmarks.google_message3.Message36858 field37006 = 46;
@ -141,20 +170,15 @@ message Message36876 {
optional .benchmarks.google_message3.Message0 field37013 = 143; optional .benchmarks.google_message3.Message0 field37013 = 143;
optional .benchmarks.google_message3.UnusedEmptyMessage field37014 = 53; optional .benchmarks.google_message3.UnusedEmptyMessage field37014 = 53;
optional .benchmarks.google_message3.Message36869 field37015 = 15; optional .benchmarks.google_message3.Message36869 field37015 = 15;
optional group Message36883 = 3 { optional group Message36883 = 3 {}
} repeated group Message36884 = 16 {}
repeated group Message36884 = 16 { repeated group Message36885 = 27 {}
} optional group Message36886 = 32 {}
repeated group Message36885 = 27 {
}
optional group Message36886 = 32 {
}
repeated .benchmarks.google_message3.UnusedEnum field37020 = 71; repeated .benchmarks.google_message3.UnusedEnum field37020 = 71;
repeated int32 field37021 = 70; repeated int32 field37021 = 70;
optional .benchmarks.google_message3.UnusedEmptyMessage field37022 = 66; optional .benchmarks.google_message3.UnusedEmptyMessage field37022 = 66;
optional .benchmarks.google_message3.Message13090 field37023 = 67; optional .benchmarks.google_message3.Message13090 field37023 = 67;
optional group Message36887 = 62 { optional group Message36887 = 62 {}
}
repeated .benchmarks.google_message3.Message10155 field37025 = 50; repeated .benchmarks.google_message3.Message10155 field37025 = 50;
repeated .benchmarks.google_message3.Message11874 field37026 = 151; repeated .benchmarks.google_message3.Message11874 field37026 = 151;
optional string field37027 = 12; optional string field37027 = 12;
@ -202,8 +226,7 @@ message Message36876 {
optional int32 field37118 = 160; optional int32 field37118 = 160;
repeated string field37119 = 161; repeated string field37119 = 161;
} }
repeated group Message36910 = 119 { repeated group Message36910 = 119 {}
}
optional group Message36911 = 126 { optional group Message36911 = 126 {
optional .benchmarks.google_message3.UnusedEmptyMessage field37121 = 127; optional .benchmarks.google_message3.UnusedEmptyMessage field37121 = 127;
optional .benchmarks.google_message3.Message35538 field37122 = 130; optional .benchmarks.google_message3.Message35538 field37122 = 130;
@ -217,11 +240,9 @@ message Message36876 {
optional .benchmarks.google_message3.UnusedEmptyMessage field37042 = 155; optional .benchmarks.google_message3.UnusedEmptyMessage field37042 = 155;
} }
message Message1328 { message Message1328 {}
}
message Message6850 { message Message6850 {}
}
message Message6863 { message Message6863 {
optional .benchmarks.google_message3.Enum6858 field6931 = 1; optional .benchmarks.google_message3.Enum6858 field6931 = 1;
@ -259,8 +280,7 @@ message Message6863 {
optional bool field6963 = 34; optional bool field6963 = 34;
} }
message Message6871 { message Message6871 {}
}
message Message7547 { message Message7547 {
required bytes field7549 = 1; required bytes field7549 = 1;
@ -282,8 +302,7 @@ message Message7648 {
optional bool field7680 = 12; optional bool field7680 = 12;
} }
message Message7865 { message Message7865 {}
}
message Message7928 { message Message7928 {
optional string field7940 = 1; optional string field7940 = 1;
@ -1277,4 +1296,3 @@ message Message16945 {
optional .benchmarks.google_message3.Message16945 field17025 = 22068132; optional .benchmarks.google_message3.Message16945 field17025 = 22068132;
} }
} }

View File

@ -1,11 +1,44 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_3.proto"; import "datasets/google_message3/benchmark_message3_3.proto";
import "datasets/google_message3/benchmark_message3_4.proto"; import "datasets/google_message3/benchmark_message3_4.proto";
import "datasets/google_message3/benchmark_message3_5.proto"; import "datasets/google_message3/benchmark_message3_5.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -79,8 +112,7 @@ message Message24391 {
repeated string field24655 = 6; repeated string field24655 = 6;
} }
message Message27454 { message Message27454 {}
}
message Message27357 { message Message27357 {
optional string field27410 = 1; optional string field27410 = 1;
@ -162,8 +194,7 @@ message Message36869 {
} }
message Message33968 { message Message33968 {
repeated group Message33969 = 1 { repeated group Message33969 = 1 {}
}
repeated .benchmarks.google_message3.Message33958 field33989 = 3; repeated .benchmarks.google_message3.Message33958 field33989 = 3;
optional .benchmarks.google_message3.UnusedEmptyMessage field33990 = 106; optional .benchmarks.google_message3.UnusedEmptyMessage field33990 = 106;
optional bool field33991 = 108; optional bool field33991 = 108;
@ -238,8 +269,7 @@ message Message35573 {
optional string field35696 = 1000; optional string field35696 = 1000;
optional string field35697 = 1004; optional string field35697 = 1004;
optional int32 field35698 = 1003; optional int32 field35698 = 1003;
repeated group Message35574 = 1012 { repeated group Message35574 = 1012 {}
}
optional int64 field35700 = 1011; optional int64 field35700 = 1011;
optional int64 field35701 = 1005; optional int64 field35701 = 1005;
optional int64 field35702 = 1006; optional int64 field35702 = 1006;
@ -496,4 +526,3 @@ message Message3901 {
optional .benchmarks.google_message3.UnusedEnum field4000 = 6; optional .benchmarks.google_message3.UnusedEnum field4000 = 6;
optional int32 field4001 = 5; optional int32 field4001 = 5;
} }

View File

@ -1,10 +1,43 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_4.proto"; import "datasets/google_message3/benchmark_message3_4.proto";
import "datasets/google_message3/benchmark_message3_5.proto"; import "datasets/google_message3/benchmark_message3_5.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -66,8 +99,7 @@ message Message2356 {
optional bytes field2410 = 124; optional bytes field2410 = 124;
} }
optional string field2389 = 120; optional string field2389 = 120;
optional group Message2358 = 107 { optional group Message2358 = 107 {}
}
repeated group Message2359 = 40 { repeated group Message2359 = 40 {
optional string field2413 = 41; optional string field2413 = 41;
optional string field2414 = 42; optional string field2414 = 42;
@ -408,8 +440,7 @@ message Message16724 {
optional bool field16773 = 13; optional bool field16773 = 13;
} }
message Message17728 { message Message17728 {}
}
message Message24356 { message Message24356 {
optional string field24559 = 1; optional string field24559 = 1;
@ -463,4 +494,3 @@ message Message24366 {
repeated string field24587 = 8; repeated string field24587 = 8;
repeated string field24588 = 11; repeated string field24588 = 11;
} }

View File

@ -1,16 +1,48 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_5.proto"; import "datasets/google_message3/benchmark_message3_5.proto";
import "datasets/google_message3/benchmark_message3_6.proto"; import "datasets/google_message3/benchmark_message3_6.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
message Message24346 { message Message24346 {}
}
message Message24401 { message Message24401 {
optional .benchmarks.google_message3.Message24400 field24679 = 1; optional .benchmarks.google_message3.Message24400 field24679 = 1;
@ -189,12 +221,9 @@ message Message13083 {
optional float field13099 = 45; optional float field13099 = 45;
optional uint64 field13100 = 46; optional uint64 field13100 = 46;
optional float field13101 = 47; optional float field13101 = 47;
optional group Message13085 = 16 { optional group Message13085 = 16 {}
} repeated group Message13086 = 23 {}
repeated group Message13086 = 23 { repeated group Message13087 = 29 {}
}
repeated group Message13087 = 29 {
}
optional .benchmarks.google_message3.UnusedEmptyMessage field13105 = 43; optional .benchmarks.google_message3.UnusedEmptyMessage field13105 = 43;
} }
@ -262,12 +291,10 @@ message Message16816 {
optional float field16826 = 1; optional float field16826 = 1;
optional .benchmarks.google_message3.Enum16819 field16827 = 2; optional .benchmarks.google_message3.Enum16819 field16827 = 2;
optional float field16828 = 3; optional float field16828 = 3;
repeated group Message16817 = 4 { repeated group Message16817 = 4 {}
}
optional bool field16830 = 7; optional bool field16830 = 7;
optional bool field16831 = 8; optional bool field16831 = 8;
repeated group Message16818 = 12 { repeated group Message16818 = 12 {}
}
optional string field16833 = 10; optional string field16833 = 10;
optional bool field16834 = 13; optional bool field16834 = 13;
optional bool field16835 = 14; optional bool field16835 = 14;
@ -308,11 +335,9 @@ message Message1374 {
optional string field1376 = 2; optional string field1376 = 2;
} }
message Message18943 { message Message18943 {}
}
message Message18944 { message Message18944 {}
}
message Message18856 { message Message18856 {
optional string field18857 = 1; optional string field18857 = 1;
@ -436,8 +461,7 @@ message Message8475 {
optional int64 field8482 = 2; optional int64 field8482 = 2;
} }
message Message12559 { message Message12559 {}
}
message Message12817 { message Message12817 {
optional int32 field12826 = 1; optional int32 field12826 = 1;
@ -488,4 +512,3 @@ message Message24317 {
repeated string field24473 = 27; repeated string field24473 = 27;
optional bool field24474 = 40; optional bool field24474 = 40;
} }

View File

@ -1,18 +1,49 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_6.proto"; import "datasets/google_message3/benchmark_message3_6.proto";
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
message Message24377 { message Message24377 {}
}
message Message24378 { message Message24378 {}
}
message Message24400 { message Message24400 {
optional int32 field24674 = 1; optional int32 field24674 = 1;
@ -22,11 +53,9 @@ message Message24400 {
optional int32 field24678 = 5; optional int32 field24678 = 5;
} }
message Message24380 { message Message24380 {}
}
message Message24381 { message Message24381 {}
}
message Message719 { message Message719 {
repeated string field881 = 1; repeated string field881 = 1;
@ -103,6 +132,7 @@ message Message697 {
message Message0 { message Message0 {
option message_set_wire_format = true; option message_set_wire_format = true;
extensions 4 to 2147483646; extensions 4 to 2147483646;
} }
@ -193,7 +223,8 @@ message Message10155 {
optional fixed64 field10232 = 13; optional fixed64 field10232 = 13;
optional fixed64 field10233 = 20; optional fixed64 field10233 = 20;
optional bool field10234 = 79; optional bool field10234 = 79;
repeated .benchmarks.google_message3.Enum10167 field10235 = 80 [packed = true]; repeated .benchmarks.google_message3.Enum10167 field10235 = 80
[packed = true];
optional int32 field10236 = 14; optional int32 field10236 = 14;
optional int32 field10237 = 15; optional int32 field10237 = 15;
optional int32 field10238 = 28; optional int32 field10238 = 28;
@ -285,25 +316,20 @@ message Message13145 {
extensions 1000 to 536870911; extensions 1000 to 536870911;
} }
message Message16686 { message Message16686 {}
}
message Message12796 { message Message12796 {
repeated fixed64 field12800 = 1; repeated fixed64 field12800 = 1;
optional uint64 field12801 = 2; optional uint64 field12801 = 2;
} }
message Message6722 { message Message6722 {}
}
message Message6727 { message Message6727 {}
}
message Message6724 { message Message6724 {}
}
message Message6735 { message Message6735 {}
}
message Message8183 { message Message8183 {
optional string field8226 = 1; optional string field8226 = 1;
@ -325,8 +351,7 @@ message Message8301 {
extensions 64 to 536870911; extensions 64 to 536870911;
} }
message Message8456 { message Message8456 {}
}
message Message8302 { message Message8302 {
optional string field8339 = 1; optional string field8339 = 1;
@ -353,8 +378,7 @@ message Message8302 {
extensions 64 to 536870911; extensions 64 to 536870911;
} }
message Message8457 { message Message8457 {}
}
message Message8449 { message Message8449 {
optional string field8458 = 1; optional string field8458 = 1;
@ -470,4 +494,3 @@ message Message698 {
optional int64 field785 = 7; optional int64 field785 = 7;
repeated string field786 = 8; repeated string field786 = 8;
} }

View File

@ -1,14 +1,46 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3;
import "datasets/google_message3/benchmark_message3_7.proto"; import "datasets/google_message3/benchmark_message3_7.proto";
import "datasets/google_message3/benchmark_message3_8.proto"; import "datasets/google_message3/benchmark_message3_8.proto";
package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
message Message10576 { message Message10576 {}
}
message Message10154 { message Message10154 {
optional bytes field10192 = 1; optional bytes field10192 = 1;
@ -343,8 +375,7 @@ message Message8939 {
optional string field9012 = 3; optional string field9012 = 3;
repeated string field9013 = 4; repeated string field9013 = 4;
optional string field9014 = 5; optional string field9014 = 5;
repeated group Message8940 = 11 { repeated group Message8940 = 11 {}
}
optional int64 field9016 = 21; optional int64 field9016 = 21;
optional int64 field9017 = 22; optional int64 field9017 = 22;
optional int64 field9018 = 23; optional int64 field9018 = 23;
@ -423,8 +454,7 @@ message Message9627 {
optional float field9672 = 5; optional float field9672 = 5;
} }
message Message11020 { message Message11020 {}
}
message Message11013 { message Message11013 {
optional bytes field11757 = 19; optional bytes field11757 = 19;
@ -451,4 +481,3 @@ message Message11013 {
optional .benchmarks.google_message3.UnusedEmptyMessage field11778 = 23; optional .benchmarks.google_message3.UnusedEmptyMessage field11778 = 23;
repeated .benchmarks.google_message3.Message11011 field11779 = 22; repeated .benchmarks.google_message3.Message11011 field11779 = 22;
} }

View File

@ -1,3 +1,33 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3; package benchmarks.google_message3;
@ -5,8 +35,7 @@ package benchmarks.google_message3;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
message Message11018 { message Message11018 {}
}
message Message10800 { message Message10800 {
optional string field10808 = 1; optional string field10808 = 1;
@ -15,8 +44,7 @@ message Message10800 {
optional float field10811 = 4; optional float field10811 = 4;
} }
message Message10802 { message Message10802 {}
}
message Message10748 { message Message10748 {
optional string field10750 = 1; optional string field10750 = 1;
@ -39,18 +67,15 @@ message Message708 {
repeated string field828 = 5; repeated string field828 = 5;
} }
message Message8942 { message Message8942 {}
}
message Message11011 { message Message11011 {
required bytes field11752 = 1; required bytes field11752 = 1;
required bytes field11753 = 2; required bytes field11753 = 2;
} }
message UnusedEmptyMessage { message UnusedEmptyMessage {}
}
message Message741 { message Message741 {
repeated string field936 = 1; repeated string field936 = 1;
} }

View File

@ -1,3 +1,33 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message3; package benchmarks.google_message3;
@ -609,9 +639,7 @@ enum Enum10325 {
ENUM_VALUE10334 = 8; ENUM_VALUE10334 = 8;
} }
enum Enum10335 { enum Enum10335 { ENUM_VALUE10336 = 0; }
ENUM_VALUE10336 = 0;
}
enum Enum10337 { enum Enum10337 {
ENUM_VALUE10338 = 0; ENUM_VALUE10338 = 0;
@ -1857,9 +1885,7 @@ enum Enum33960 {
ENUM_VALUE33967 = 6; ENUM_VALUE33967 = 6;
} }
enum Enum34388 { enum Enum34388 { ENUM_VALUE34389 = 1; }
ENUM_VALUE34389 = 1;
}
enum Enum35477 { enum Enum35477 {
ENUM_VALUE35478 = 4; ENUM_VALUE35478 = 4;
@ -1897,4 +1923,3 @@ enum Enum36890 {
ENUM_VALUE36891 = 0; ENUM_VALUE36891 = 0;
ENUM_VALUE36892 = 1; ENUM_VALUE36892 = 1;
} }

View File

@ -1,9 +1,42 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message4;
import "datasets/google_message4/benchmark_message4_1.proto"; import "datasets/google_message4/benchmark_message4_1.proto";
import "datasets/google_message4/benchmark_message4_2.proto"; import "datasets/google_message4/benchmark_message4_2.proto";
import "datasets/google_message4/benchmark_message4_3.proto"; import "datasets/google_message4/benchmark_message4_3.proto";
package benchmarks.google_message4;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -146,8 +179,7 @@ message Message176 {
optional .benchmarks.google_message4.UnusedEnum field455 = 37; optional .benchmarks.google_message4.UnusedEnum field455 = 37;
optional .benchmarks.google_message4.UnusedEnum field456 = 34; optional .benchmarks.google_message4.UnusedEnum field456 = 34;
optional int32 field457 = 35; optional int32 field457 = 35;
repeated group Message178 = 101 { repeated group Message178 = 101 {}
}
optional bool field459 = 52; optional bool field459 = 52;
optional uint64 field460 = 58; optional uint64 field460 = 58;
optional uint64 field461 = 59; optional uint64 field461 = 59;
@ -428,10 +460,8 @@ message Message2356 {
optional bytes field2410 = 124; optional bytes field2410 = 124;
} }
optional string field2389 = 120; optional string field2389 = 120;
optional group Message2358 = 107 { optional group Message2358 = 107 {}
} repeated group Message2359 = 40 {}
repeated group Message2359 = 40 {
}
optional int32 field2392 = 50; optional int32 field2392 = 50;
optional .benchmarks.google_message4.UnusedEmptyMessage field2393 = 60; optional .benchmarks.google_message4.UnusedEmptyMessage field2393 = 60;
optional .benchmarks.google_message4.UnusedEmptyMessage field2394 = 70; optional .benchmarks.google_message4.UnusedEmptyMessage field2394 = 70;
@ -443,6 +473,7 @@ message Message2356 {
message Message0 { message Message0 {
option message_set_wire_format = true; option message_set_wire_format = true;
extensions 4 to 2147483646; extensions 4 to 2147483646;
} }
@ -451,4 +482,3 @@ message Message971 {
optional int32 field973 = 2; optional int32 field973 = 2;
optional bool field974 = 3; optional bool field974 = 3;
} }

View File

@ -1,8 +1,41 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
// LINT: ALLOW_GROUPS
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message4;
import "datasets/google_message4/benchmark_message4_2.proto"; import "datasets/google_message4/benchmark_message4_2.proto";
import "datasets/google_message4/benchmark_message4_3.proto"; import "datasets/google_message4/benchmark_message4_3.proto";
package benchmarks.google_message4;
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -16,8 +49,7 @@ message Message12686 {
optional .benchmarks.google_message4.Message12685 field12700 = 2; optional .benchmarks.google_message4.Message12685 field12700 = 2;
} }
message Message11949 { message Message11949 {}
}
message Message11975 { message Message11975 {
optional string field11992 = 1; optional string field11992 = 1;
@ -104,8 +136,7 @@ message Message3061 {
} }
optional .benchmarks.google_message4.UnusedEmptyMessage field3315 = 39; optional .benchmarks.google_message4.UnusedEmptyMessage field3315 = 39;
optional int32 field3316 = 76; optional int32 field3316 = 76;
optional group Message3065 = 63 { optional group Message3065 = 63 {}
}
optional .benchmarks.google_message4.Enum2806 field3318 = 54; optional .benchmarks.google_message4.Enum2806 field3318 = 54;
optional int32 field3319 = 46; optional int32 field3319 = 46;
repeated string field3320 = 24; repeated string field3320 = 24;
@ -133,8 +164,7 @@ message Message3061 {
optional int32 field3333 = 17; optional int32 field3333 = 17;
} }
message Message12949 { message Message12949 {}
}
message Message8572 { message Message8572 {
optional bytes field8647 = 1; optional bytes field8647 = 1;
@ -239,11 +269,9 @@ message Message12825 {
repeated .benchmarks.google_message4.UnusedEmptyMessage field12868 = 7; repeated .benchmarks.google_message4.UnusedEmptyMessage field12868 = 7;
} }
message Message8590 { message Message8590 {}
}
message Message8587 { message Message8587 {}
}
message Message1374 { message Message1374 {
required string field1375 = 1; required string field1375 = 1;
@ -423,8 +451,7 @@ message Message3052 {
optional string field3262 = 9; optional string field3262 = 9;
} }
message Message8575 { message Message8575 {}
}
message Message7843 { message Message7843 {
optional bool field7844 = 5; optional bool field7844 = 5;
@ -471,4 +498,3 @@ message Message7929 {
repeated bytes field7960 = 11; repeated bytes field7960 = 11;
optional int64 field7961 = 16; optional int64 field7961 = 16;
} }

View File

@ -1,8 +1,39 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto2";
import "datasets/google_message4/benchmark_message4_3.proto";
package benchmarks.google_message4; package benchmarks.google_message4;
import "datasets/google_message4/benchmark_message4_3.proto";
option cc_enable_arenas = true; option cc_enable_arenas = true;
option java_package = "com.google.protobuf.benchmarks"; option java_package = "com.google.protobuf.benchmarks";
@ -102,8 +133,7 @@ message Message5881 {
optional .benchmarks.google_message4.Message5880 field5902 = 6; optional .benchmarks.google_message4.Message5880 field5902 = 6;
} }
message Message6110 { message Message6110 {}
}
message Message6107 { message Message6107 {
optional .benchmarks.google_message4.Message4016 field6134 = 1; optional .benchmarks.google_message4.Message4016 field6134 = 1;
@ -181,8 +211,7 @@ message Message3850 {
optional bool field3929 = 14; optional bool field3929 = 14;
} }
message Message7865 { message Message7865 {}
}
message Message7511 { message Message7511 {
optional bool field7523 = 1; optional bool field7523 = 1;
@ -194,8 +223,7 @@ message Message7511 {
optional int32 field7529 = 7; optional int32 field7529 = 7;
} }
message Message3920 { message Message3920 {}
}
message Message7928 { message Message7928 {
optional string field7940 = 1; optional string field7940 = 1;
@ -231,8 +259,7 @@ message Message6054 {
optional string field6090 = 2; optional string field6090 = 2;
} }
message Message6127 { message Message6127 {}
}
message Message6052 { message Message6052 {
required string field6084 = 1; required string field6084 = 1;
@ -272,8 +299,7 @@ message Message4016 {
required int32 field4020 = 4; required int32 field4020 = 4;
} }
message Message6108 { message Message6108 {}
}
message Message5907 { message Message5907 {
optional .benchmarks.google_message4.Message5903 field5967 = 1; optional .benchmarks.google_message4.Message5903 field5967 = 1;
@ -282,11 +308,9 @@ message Message5907 {
optional .benchmarks.google_message4.Message5903 field5970 = 4; optional .benchmarks.google_message4.Message5903 field5970 = 4;
} }
message UnusedEmptyMessage { message UnusedEmptyMessage {}
}
message Message5903 { message Message5903 {
required int32 field5965 = 1; required int32 field5965 = 1;
optional .benchmarks.google_message4.Enum5904 field5966 = 2; optional .benchmarks.google_message4.Enum5904 field5966 = 2;
} }

View File

@ -1,3 +1,33 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2"; syntax = "proto2";
package benchmarks.google_message4; package benchmarks.google_message4;
@ -47,6 +77,7 @@ enum Enum2806 {
enum Enum2851 { enum Enum2851 {
option allow_alias = true; option allow_alias = true;
ENUM_VALUE2852 = 0; ENUM_VALUE2852 = 0;
ENUM_VALUE2853 = 0; ENUM_VALUE2853 = 0;
ENUM_VALUE2854 = 1; ENUM_VALUE2854 = 1;
@ -717,9 +748,7 @@ enum Enum10325 {
ENUM_VALUE10334 = 8; ENUM_VALUE10334 = 8;
} }
enum Enum10335 { enum Enum10335 { ENUM_VALUE10336 = 0; }
ENUM_VALUE10336 = 0;
}
enum Enum10337 { enum Enum10337 {
ENUM_VALUE10338 = 0; ENUM_VALUE10338 = 0;
@ -748,4 +777,3 @@ enum Enum12871 {
ENUM_VALUE12876 = 5; ENUM_VALUE12876 = 5;
ENUM_VALUE12877 = 6; ENUM_VALUE12877 = 6;
} }

View File

@ -41,9 +41,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length; totalBytes += onePayload.length;
}); });
var senarios = benchmarkSuite.newBenchmark( var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.getMessageName(), filename, "js"); benchmarkDataset.getMessageName(), filename, "js");
senarios.suite scenarios.suite
.add("js deserialize", function() { .add("js deserialize", function() {
benchmarkDataset.getPayloadList().forEach(function(onePayload) { benchmarkDataset.getPayloadList().forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.getMessageName()); var protoType = getNewPrototype(benchmarkDataset.getMessageName());
@ -61,15 +61,15 @@ process.argv.forEach(function(filename, index) {
results.push({ results.push({
filename: filename, filename: filename,
benchmarks: { benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes / 1024 / 1024, protobufjs_decoding: scenarios.benches[0] * totalBytes / 1024 / 1024,
protobufjs_encoding: senarios.benches[1] * totalBytes / 1024 / 1024 protobufjs_encoding: scenarios.benches[1] * totalBytes / 1024 / 1024
} }
}) })
console.log("Throughput for deserialize: " console.log("Throughput for deserialize: "
+ senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("Throughput for serialize: " console.log("Throughput for serialize: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log(""); console.log("");
}); });
console.log("#####################################################"); console.log("#####################################################");

View File

@ -31,9 +31,9 @@ process.argv.forEach(function(filename, index) {
totalBytes += onePayload.length; totalBytes += onePayload.length;
}); });
var senarios = benchmarkSuite.newBenchmark( var scenarios = benchmarkSuite.newBenchmark(
benchmarkDataset.messageName, filename, "protobufjs"); benchmarkDataset.messageName, filename, "protobufjs");
senarios.suite scenarios.suite
.add("protobuf.js static decoding", function() { .add("protobuf.js static decoding", function() {
benchmarkDataset.payload.forEach(function(onePayload) { benchmarkDataset.payload.forEach(function(onePayload) {
var protoType = getNewPrototype(benchmarkDataset.messageName); var protoType = getNewPrototype(benchmarkDataset.messageName);
@ -51,15 +51,15 @@ process.argv.forEach(function(filename, index) {
results.push({ results.push({
filename: filename, filename: filename,
benchmarks: { benchmarks: {
protobufjs_decoding: senarios.benches[0] * totalBytes, protobufjs_decoding: scenarios.benches[0] * totalBytes,
protobufjs_encoding: senarios.benches[1] * totalBytes protobufjs_encoding: scenarios.benches[1] * totalBytes
} }
}) })
console.log("Throughput for decoding: " console.log("Throughput for decoding: "
+ senarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[0] * totalBytes / 1024 / 1024 + "MB/s" );
console.log("Throughput for encoding: " console.log("Throughput for encoding: "
+ senarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" ); + scenarios.benches[1] * totalBytes / 1024 / 1024 + "MB/s" );
console.log(""); console.log("");
}); });
console.log("#####################################################"); console.log("#####################################################");

0
benchmarks/python/py_benchmark.py Executable file → Normal file
View File

0
benchmarks/util/result_parser.py Executable file → Normal file
View File

0
benchmarks/util/result_uploader.py Executable file → Normal file
View File

View File

@ -28,11 +28,23 @@ else()
set(CMAKE_CXX_EXTENSIONS OFF) set(CMAKE_CXX_EXTENSIONS OFF)
endif() endif()
# The Intel compiler isn't able to deal with noinline member functions of
# template classes defined in headers. As such it spams the output with
# warning #2196: routine is both "inline" and "noinline"
# This silences that warning.
if (CMAKE_CXX_COMPILER_ID MATCHES Intel)
string(APPEND CMAKE_CXX_FLAGS " -diag-disable=2196")
endif()
# Options # Options
if(WITH_PROTOC)
set(protobuf_PROTOC_EXE ${WITH_PROTOC} CACHE FILEPATH "Protocol Buffer Compiler executable" FORCE)
endif()
option(protobuf_BUILD_TESTS "Build tests" ON) option(protobuf_BUILD_TESTS "Build tests" ON)
option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF) option(protobuf_BUILD_CONFORMANCE "Build conformance tests" OFF)
option(protobuf_BUILD_EXAMPLES "Build examples" OFF) option(protobuf_BUILD_EXAMPLES "Build examples" OFF)
option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON) option(protobuf_BUILD_PROTOC_BINARIES "Build libprotoc and protoc compiler" ON)
option(protobuf_BUILD_LIBPROTOC "Build libprotoc" OFF)
if (BUILD_SHARED_LIBS) if (BUILD_SHARED_LIBS)
set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON) set(protobuf_BUILD_SHARED_LIBS_DEFAULT ON)
else (BUILD_SHARED_LIBS) else (BUILD_SHARED_LIBS)
@ -50,6 +62,10 @@ mark_as_advanced(protobuf_DEBUG_POSTFIX)
# User options # User options
include(protobuf-options.cmake) include(protobuf-options.cmake)
# Overrides for option dependencies
if (protobuf_BUILD_PROTOC_BINARIES OR protobuf_BUILD_TESTS)
set(protobuf_BUILD_LIBPROTOC ON)
endif ()
# Path to main configure script # Path to main configure script
set(protobuf_CONFIGURE_SCRIPT "../configure.ac") set(protobuf_CONFIGURE_SCRIPT "../configure.ac")
@ -234,11 +250,29 @@ endif (protobuf_UNICODE)
include(libprotobuf-lite.cmake) include(libprotobuf-lite.cmake)
include(libprotobuf.cmake) include(libprotobuf.cmake)
if (protobuf_BUILD_PROTOC_BINARIES) if (protobuf_BUILD_LIBPROTOC)
include(libprotoc.cmake) include(libprotoc.cmake)
endif (protobuf_BUILD_LIBPROTOC)
if (protobuf_BUILD_PROTOC_BINARIES)
include(protoc.cmake) include(protoc.cmake)
if (NOT DEFINED protobuf_PROTOC_EXE)
set(protobuf_PROTOC_EXE protoc)
endif (NOT DEFINED protobuf_PROTOC_EXE)
endif (protobuf_BUILD_PROTOC_BINARIES) endif (protobuf_BUILD_PROTOC_BINARIES)
# Ensure we have a protoc executable if we need one
if (protobuf_BUILD_TESTS OR protobuf_BUILD_CONFORMANCE OR protobuf_BUILD_EXAMPLES)
if (NOT DEFINED protobuf_PROTOC_EXE)
find_program(protobuf_PROTOC_EXE protoc)
if (NOT protobuf_PROTOC_EXE)
message(FATAL "Build requires 'protoc' but binary not found and not building protoc.")
endif ()
endif ()
if(protobuf_VERBOSE)
message(STATUS "Using protoc : ${protobuf_PROTOC_EXE}")
endif(protobuf_VERBOSE)
endif ()
if (protobuf_BUILD_TESTS) if (protobuf_BUILD_TESTS)
include(tests.cmake) include(tests.cmake)
endif (protobuf_BUILD_TESTS) endif (protobuf_BUILD_TESTS)
@ -254,5 +288,5 @@ if (protobuf_BUILD_EXAMPLES)
endif (protobuf_BUILD_EXAMPLES) endif (protobuf_BUILD_EXAMPLES)
if(protobuf_VERBOSE) if(protobuf_VERBOSE)
message(STATUS "Protocol Buffers Configuring done") message(STATUS "Protocol Buffers Configuring done")
endif() endif(protobuf_VERBOSE)

View File

@ -1,8 +1,8 @@
add_custom_command( add_custom_command(
OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc OUTPUT ${protobuf_source_dir}/conformance/conformance.pb.cc
DEPENDS protoc ${protobuf_source_dir}/conformance/conformance.proto DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto
COMMAND protoc ${protobuf_source_dir}/conformance/conformance.proto COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/conformance/conformance.proto
--proto_path=${protobuf_source_dir}/conformance --proto_path=${protobuf_source_dir}/conformance
--cpp_out=${protobuf_source_dir}/conformance --cpp_out=${protobuf_source_dir}/conformance
) )
@ -10,9 +10,9 @@ add_custom_command(
add_custom_command( add_custom_command(
OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc OUTPUT ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.pb.cc
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.pb.cc
DEPENDS protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
COMMAND protoc ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/google/protobuf/test_messages_proto3.proto
${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto ${protobuf_source_dir}/src/google/protobuf/test_messages_proto2.proto
--proto_path=${protobuf_source_dir}/src --proto_path=${protobuf_source_dir}/src
--cpp_out=${protobuf_source_dir}/src --cpp_out=${protobuf_source_dir}/src

View File

@ -53,7 +53,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_tab
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\generated_message_util.h" include\google\protobuf\generated_message_util.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\has_bits.h" include\google\protobuf\has_bits.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\implicit_weak_message.h" include\google\protobuf\implicit_weak_message.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\inlined_string_field.h" include\google\protobuf\inlined_string_field.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\coded_stream.h" include\google\protobuf\io\coded_stream.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\gzip_stream.h" include\google\protobuf\io\gzip_stream.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\io\io_win32.h" include\google\protobuf\io\io_win32.h
@ -88,7 +87,6 @@ copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\bytestream.h" i
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\callback.h" include\google\protobuf\stubs\callback.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\casts.h" include\google\protobuf\stubs\casts.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\common.h" include\google\protobuf\stubs\common.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\fastmem.h" include\google\protobuf\stubs\fastmem.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\hash.h" include\google\protobuf\stubs\hash.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\logging.h" include\google\protobuf\stubs\logging.h
copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h copy "${PROTOBUF_SOURCE_WIN32_PATH}\..\src\google\protobuf\stubs\macros.h" include\google\protobuf\stubs\macros.h

View File

@ -6,9 +6,9 @@ configure_file(${CMAKE_CURRENT_SOURCE_DIR}/protobuf-lite.pc.cmake
${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY) ${CMAKE_CURRENT_BINARY_DIR}/protobuf-lite.pc @ONLY)
set(_protobuf_libraries libprotobuf-lite libprotobuf) set(_protobuf_libraries libprotobuf-lite libprotobuf)
if (protobuf_BUILD_PROTOC_BINARIES) if (protobuf_BUILD_LIBPROTOC)
list(APPEND _protobuf_libraries libprotoc) list(APPEND _protobuf_libraries libprotoc)
endif (protobuf_BUILD_PROTOC_BINARIES) endif (protobuf_BUILD_LIBPROTOC)
foreach(_library ${_protobuf_libraries}) foreach(_library ${_protobuf_libraries})
set_property(TARGET ${_library} set_property(TARGET ${_library}
@ -102,12 +102,16 @@ endforeach()
# Install configuration # Install configuration
set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files") set(_cmakedir_desc "Directory relative to CMAKE_INSTALL to install the cmake configuration files")
set(_exampledir_desc "Directory relative to CMAKE_INSTALL_DATA to install examples")
if(NOT MSVC) if(NOT MSVC)
set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}") set(CMAKE_INSTALL_CMAKEDIR "${CMAKE_INSTALL_LIBDIR}/cmake/protobuf" CACHE STRING "${_cmakedir_desc}")
set(CMAKE_INSTALL_EXAMPLEDIR "${CMAKE_INSTALL_DATADIR}/protobuf/examples" CACHE STRING "${_exampledir_desc}")
else() else()
set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}") set(CMAKE_INSTALL_CMAKEDIR "cmake" CACHE STRING "${_cmakedir_desc}")
set(CMAKE_INSTALL_EXAMPLEDIR "examples" CACHE STRING "${_exampledir_desc}")
endif() endif()
mark_as_advanced(CMAKE_INSTALL_CMAKEDIR) mark_as_advanced(CMAKE_INSTALL_CMAKEDIR)
mark_as_advanced(CMAKE_INSTALL_EXAMPLEDIR)
configure_file(protobuf-config.cmake.in configure_file(protobuf-config.cmake.in
${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY) ${CMAKE_INSTALL_CMAKEDIR}/protobuf-config.cmake @ONLY)
@ -145,6 +149,7 @@ install(DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/${CMAKE_INSTALL_CMAKEDIR}/
option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF) option(protobuf_INSTALL_EXAMPLES "Install the examples folder" OFF)
if(protobuf_INSTALL_EXAMPLES) if(protobuf_INSTALL_EXAMPLES)
install(DIRECTORY ../examples/ DESTINATION examples install(DIRECTORY ../examples/
DESTINATION "${CMAKE_INSTALL_EXAMPLEDIR}"
COMPONENT protobuf-examples) COMPONENT protobuf-examples)
endif() endif()

View File

@ -1,6 +1,7 @@
set(libprotobuf_lite_files set(libprotobuf_lite_files
${protobuf_source_dir}/src/google/protobuf/any_lite.cc ${protobuf_source_dir}/src/google/protobuf/any_lite.cc
${protobuf_source_dir}/src/google/protobuf/arena.cc ${protobuf_source_dir}/src/google/protobuf/arena.cc
${protobuf_source_dir}/src/google/protobuf/arenastring.cc
${protobuf_source_dir}/src/google/protobuf/extension_set.cc ${protobuf_source_dir}/src/google/protobuf/extension_set.cc
${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc ${protobuf_source_dir}/src/google/protobuf/generated_enum_util.cc
${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc ${protobuf_source_dir}/src/google/protobuf/generated_message_table_driven_lite.cc
@ -12,6 +13,7 @@ set(libprotobuf_lite_files
${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream.cc
${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl.cc
${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc ${protobuf_source_dir}/src/google/protobuf/io/zero_copy_stream_impl_lite.cc
${protobuf_source_dir}/src/google/protobuf/map.cc
${protobuf_source_dir}/src/google/protobuf/message_lite.cc ${protobuf_source_dir}/src/google/protobuf/message_lite.cc
${protobuf_source_dir}/src/google/protobuf/parse_context.cc ${protobuf_source_dir}/src/google/protobuf/parse_context.cc
${protobuf_source_dir}/src/google/protobuf/repeated_field.cc ${protobuf_source_dir}/src/google/protobuf/repeated_field.cc
@ -67,6 +69,9 @@ target_link_libraries(libprotobuf-lite ${CMAKE_THREAD_LIBS_INIT})
if(protobuf_LINK_LIBATOMIC) if(protobuf_LINK_LIBATOMIC)
target_link_libraries(libprotobuf-lite atomic) target_link_libraries(libprotobuf-lite atomic)
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
target_link_libraries(libprotobuf-lite log)
endif()
target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src) target_include_directories(libprotobuf-lite PUBLIC ${protobuf_source_dir}/src)
if(MSVC AND protobuf_BUILD_SHARED_LIBS) if(MSVC AND protobuf_BUILD_SHARED_LIBS)
target_compile_definitions(libprotobuf-lite target_compile_definitions(libprotobuf-lite

View File

@ -121,6 +121,9 @@ endif()
if(protobuf_LINK_LIBATOMIC) if(protobuf_LINK_LIBATOMIC)
target_link_libraries(libprotobuf atomic) target_link_libraries(libprotobuf atomic)
endif() endif()
if(${CMAKE_SYSTEM_NAME} STREQUAL "Android")
target_link_libraries(libprotobuf log)
endif()
target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src) target_include_directories(libprotobuf PUBLIC ${protobuf_source_dir}/src)
if(MSVC AND protobuf_BUILD_SHARED_LIBS) if(MSVC AND protobuf_BUILD_SHARED_LIBS)
target_compile_definitions(libprotobuf target_compile_definitions(libprotobuf

View File

@ -11,7 +11,7 @@ function(protobuf_generate)
include(CMakeParseArguments) include(CMakeParseArguments)
set(_options APPEND_PATH) set(_options APPEND_PATH)
set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR) set(_singleargs LANGUAGE OUT_VAR EXPORT_MACRO PROTOC_OUT_DIR PLUGIN)
if(COMMAND target_sources) if(COMMAND target_sources)
list(APPEND _singleargs TARGET) list(APPEND _singleargs TARGET)
endif() endif()
@ -41,6 +41,10 @@ function(protobuf_generate)
if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp) if(protobuf_generate_EXPORT_MACRO AND protobuf_generate_LANGUAGE STREQUAL cpp)
set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:") set(_dll_export_decl "dllexport_decl=${protobuf_generate_EXPORT_MACRO}:")
endif() endif()
if(protobuf_generate_PLUGIN)
set(_plugin "--plugin=${protobuf_generate_PLUGIN}")
endif()
if(NOT protobuf_generate_GENERATE_EXTENSIONS) if(NOT protobuf_generate_GENERATE_EXTENSIONS)
if(protobuf_generate_LANGUAGE STREQUAL cpp) if(protobuf_generate_LANGUAGE STREQUAL cpp)
@ -77,8 +81,6 @@ function(protobuf_generate)
list(APPEND _protobuf_include_path -I ${_abs_path}) list(APPEND _protobuf_include_path -I ${_abs_path})
endif() endif()
endforeach() endforeach()
else()
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif() endif()
foreach(DIR ${protobuf_generate_IMPORT_DIRS}) foreach(DIR ${protobuf_generate_IMPORT_DIRS})
@ -89,12 +91,35 @@ function(protobuf_generate)
endif() endif()
endforeach() endforeach()
if(NOT _protobuf_include_path)
set(_protobuf_include_path -I ${CMAKE_CURRENT_SOURCE_DIR})
endif()
set(_generated_srcs_all) set(_generated_srcs_all)
foreach(_proto ${protobuf_generate_PROTOS}) foreach(_proto ${protobuf_generate_PROTOS})
get_filename_component(_abs_file ${_proto} ABSOLUTE) get_filename_component(_abs_file ${_proto} ABSOLUTE)
get_filename_component(_abs_dir ${_abs_file} DIRECTORY) get_filename_component(_abs_dir ${_abs_file} DIRECTORY)
get_filename_component(_basename ${_proto} NAME_WE)
file(RELATIVE_PATH _rel_dir ${CMAKE_CURRENT_SOURCE_DIR} ${_abs_dir}) get_filename_component(_file_full_name ${_proto} NAME)
string(FIND "${_file_full_name}" "." _file_last_ext_pos REVERSE)
string(SUBSTRING "${_file_full_name}" 0 ${_file_last_ext_pos} _basename)
set(_suitable_include_found FALSE)
foreach(DIR ${_protobuf_include_path})
if(NOT DIR STREQUAL "-I")
file(RELATIVE_PATH _rel_dir ${DIR} ${_abs_dir})
string(FIND "${_rel_dir}" "../" _is_in_parent_folder)
if (NOT ${_is_in_parent_folder} EQUAL 0)
set(_suitable_include_found TRUE)
break()
endif()
endif()
endforeach()
if(NOT _suitable_include_found)
message(SEND_ERROR "Error: protobuf_generate could not find any correct proto include directory.")
return()
endif()
set(_generated_srcs) set(_generated_srcs)
foreach(_ext ${protobuf_generate_GENERATE_EXTENSIONS}) foreach(_ext ${protobuf_generate_GENERATE_EXTENSIONS})
@ -105,7 +130,7 @@ function(protobuf_generate)
add_custom_command( add_custom_command(
OUTPUT ${_generated_srcs} OUTPUT ${_generated_srcs}
COMMAND protobuf::protoc COMMAND protobuf::protoc
ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_protobuf_include_path} ${_abs_file} ARGS --${protobuf_generate_LANGUAGE}_out ${_dll_export_decl}${protobuf_generate_PROTOC_OUT_DIR} ${_plugin} ${_protobuf_include_path} ${_abs_file}
DEPENDS ${_abs_file} protobuf::protoc DEPENDS ${_abs_file} protobuf::protoc
COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}" COMMENT "Running ${protobuf_generate_LANGUAGE} protocol buffer compiler on ${_proto}"
VERBATIM ) VERBATIM )

View File

@ -97,6 +97,10 @@ function(_protobuf_find_libraries name filename)
else() else()
get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename} get_target_property(${name}_LIBRARY_RELEASE protobuf::lib${filename}
LOCATION_RELEASE) LOCATION_RELEASE)
get_target_property(${name}_LIBRARY_RELWITHDEBINFO protobuf::lib${filename}
LOCATION_RELWITHDEBINFO)
get_target_property(${name}_LIBRARY_MINSIZEREL protobuf::lib${filename}
LOCATION_MINSIZEREL)
get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename} get_target_property(${name}_LIBRARY_DEBUG protobuf::lib${filename}
LOCATION_DEBUG) LOCATION_DEBUG)
@ -146,6 +150,14 @@ get_target_property(Protobuf_INCLUDE_DIRS protobuf::libprotobuf
# Set the protoc Executable # Set the protoc Executable
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_RELEASE) IMPORTED_LOCATION_RELEASE)
if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_RELWITHDEBINFO)
endif()
if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_MINSIZEREL)
endif()
if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}") if(NOT EXISTS "${Protobuf_PROTOC_EXECUTABLE}")
get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc get_target_property(Protobuf_PROTOC_EXECUTABLE protobuf::protoc
IMPORTED_LOCATION_DEBUG) IMPORTED_LOCATION_DEBUG)

View File

@ -2,6 +2,6 @@
option(protobuf_VERBOSE "Enable for verbose output" OFF) option(protobuf_VERBOSE "Enable for verbose output" OFF)
mark_as_advanced(protobuf_VERBOSE) mark_as_advanced(protobuf_VERBOSE)
# FindProtobuf module compatibel # FindProtobuf module compatible
option(protobuf_MODULE_COMPATIBLE "CMake build-in FindProtobuf.cmake module compatible" OFF) option(protobuf_MODULE_COMPATIBLE "CMake built-in FindProtobuf.cmake module compatible" OFF)
mark_as_advanced(protobuf_MODULE_COMPATIBLE) mark_as_advanced(protobuf_MODULE_COMPATIBLE)

View File

@ -33,7 +33,6 @@ set(lite_test_protos
google/protobuf/unittest_import_lite.proto google/protobuf/unittest_import_lite.proto
google/protobuf/unittest_import_public_lite.proto google/protobuf/unittest_import_public_lite.proto
google/protobuf/unittest_lite.proto google/protobuf/unittest_lite.proto
google/protobuf/unittest_no_arena_lite.proto
) )
set(tests_protos set(tests_protos
@ -56,8 +55,6 @@ set(tests_protos
google/protobuf/unittest_lite_imports_nonlite.proto google/protobuf/unittest_lite_imports_nonlite.proto
google/protobuf/unittest_mset.proto google/protobuf/unittest_mset.proto
google/protobuf/unittest_mset_wire_format.proto google/protobuf/unittest_mset_wire_format.proto
google/protobuf/unittest_no_arena.proto
google/protobuf/unittest_no_arena_import.proto
google/protobuf/unittest_no_field_presence.proto google/protobuf/unittest_no_field_presence.proto
google/protobuf/unittest_no_generic_services.proto google/protobuf/unittest_no_generic_services.proto
google/protobuf/unittest_optimize_for.proto google/protobuf/unittest_optimize_for.proto
@ -67,6 +64,7 @@ set(tests_protos
google/protobuf/unittest_proto3_arena.proto google/protobuf/unittest_proto3_arena.proto
google/protobuf/unittest_proto3_arena_lite.proto google/protobuf/unittest_proto3_arena_lite.proto
google/protobuf/unittest_proto3_lite.proto google/protobuf/unittest_proto3_lite.proto
google/protobuf/unittest_proto3_optional.proto
google/protobuf/unittest_well_known_types.proto google/protobuf/unittest_well_known_types.proto
google/protobuf/util/internal/testdata/anys.proto google/protobuf/util/internal/testdata/anys.proto
google/protobuf/util/internal/testdata/books.proto google/protobuf/util/internal/testdata/books.proto
@ -89,10 +87,11 @@ macro(compile_proto_file filename)
get_filename_component(basename ${filename} NAME_WE) get_filename_component(basename ${filename} NAME_WE)
add_custom_command( add_custom_command(
OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc OUTPUT ${protobuf_source_dir}/src/${dirname}/${basename}.pb.cc
DEPENDS protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto DEPENDS ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto
COMMAND protoc ${protobuf_source_dir}/src/${dirname}/${basename}.proto COMMAND ${protobuf_PROTOC_EXE} ${protobuf_source_dir}/src/${dirname}/${basename}.proto
--proto_path=${protobuf_source_dir}/src --proto_path=${protobuf_source_dir}/src
--cpp_out=${protobuf_source_dir}/src --cpp_out=${protobuf_source_dir}/src
--experimental_allow_proto3_optional
) )
endmacro(compile_proto_file) endmacro(compile_proto_file)

View File

@ -1,6 +1,6 @@
"""Creates config_setting that allows selecting based on 'compiler' value.""" """Creates config_setting that allows selecting based on 'compiler' value."""
def create_compiler_config_setting(name, value): def create_compiler_config_setting(name, value, visibility = None):
# The "do_not_use_tools_cpp_compiler_present" attribute exists to # The "do_not_use_tools_cpp_compiler_present" attribute exists to
# distinguish between older versions of Bazel that do not support # distinguish between older versions of Bazel that do not support
# "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do. # "@bazel_tools//tools/cpp:compiler" flag_value, and newer ones that do.
@ -13,9 +13,11 @@ def create_compiler_config_setting(name, value):
flag_values = { flag_values = {
"@bazel_tools//tools/cpp:compiler": value, "@bazel_tools//tools/cpp:compiler": value,
}, },
visibility = visibility,
) )
else: else:
native.config_setting( native.config_setting(
name = name, name = name,
values = {"compiler": value}, values = {"compiler": value},
visibility = visibility,
) )

View File

@ -17,7 +17,7 @@ AC_PREREQ(2.59)
# In the SVN trunk, the version should always be the next anticipated release # In the SVN trunk, the version should always be the next anticipated release
# version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed # version with the "-pre" suffix. (We used to use "-SNAPSHOT" but this pushed
# the size of one file name in the dist tarfile over the 99-char limit.) # the size of one file name in the dist tarfile over the 99-char limit.)
AC_INIT([Protocol Buffers],[3.11.2],[protobuf@googlegroups.com],[protobuf]) AC_INIT([Protocol Buffers],[3.14.0],[protobuf@googlegroups.com],[protobuf])
AM_MAINTAINER_MODE([enable]) AM_MAINTAINER_MODE([enable])

View File

@ -236,8 +236,10 @@ class ConformanceJava {
private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) { private Conformance.ConformanceResponse doTest(Conformance.ConformanceRequest request) {
com.google.protobuf.AbstractMessage testMessage; com.google.protobuf.AbstractMessage testMessage;
boolean isProto3 = request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3"); boolean isProto3 =
boolean isProto2 = request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2"); request.getMessageType().equals("protobuf_test_messages.proto3.TestAllTypesProto3");
boolean isProto2 =
request.getMessageType().equals("protobuf_test_messages.proto2.TestAllTypesProto2");
switch (request.getPayloadCase()) { switch (request.getPayloadCase()) {
case PROTOBUF_PAYLOAD: { case PROTOBUF_PAYLOAD: {
@ -264,15 +266,24 @@ class ConformanceJava {
} }
case JSON_PAYLOAD: { case JSON_PAYLOAD: {
try { try {
TestMessagesProto3.TestAllTypesProto3.Builder builder =
TestMessagesProto3.TestAllTypesProto3.newBuilder();
JsonFormat.Parser parser = JsonFormat.parser().usingTypeRegistry(typeRegistry); JsonFormat.Parser parser = JsonFormat.parser().usingTypeRegistry(typeRegistry);
if (request.getTestCategory() if (request.getTestCategory()
== Conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST) { == Conformance.TestCategory.JSON_IGNORE_UNKNOWN_PARSING_TEST) {
parser = parser.ignoringUnknownFields(); parser = parser.ignoringUnknownFields();
} }
parser.merge(request.getJsonPayload(), builder); if (isProto3) {
testMessage = builder.build(); TestMessagesProto3.TestAllTypesProto3.Builder builder =
TestMessagesProto3.TestAllTypesProto3.newBuilder();
parser.merge(request.getJsonPayload(), builder);
testMessage = builder.build();
} else if (isProto2) {
TestMessagesProto2.TestAllTypesProto2.Builder builder =
TestMessagesProto2.TestAllTypesProto2.newBuilder();
parser.merge(request.getJsonPayload(), builder);
testMessage = builder.build();
} else {
throw new RuntimeException("Protobuf request doesn't have specific payload type.");
}
} catch (InvalidProtocolBufferException e) { } catch (InvalidProtocolBufferException e) {
return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build(); return Conformance.ConformanceResponse.newBuilder().setParseError(e.getMessage()).build();
} }

View File

@ -333,7 +333,7 @@ conformance-php-c:
# Targets for actually running tests. # Targets for actually running tests.
test_cpp: protoc_middleman conformance-test-runner conformance-cpp test_cpp: protoc_middleman conformance-test-runner conformance-cpp
./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt ./conformance-cpp ./conformance-test-runner --enforce_recommended --failure_list failure_list_cpp.txt --text_format_failure_list text_format_failure_list_cpp.txt ./conformance-cpp
test_java: protoc_middleman conformance-test-runner conformance-java test_java: protoc_middleman conformance-test-runner conformance-java
./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java ./conformance-test-runner --enforce_recommended --failure_list failure_list_java.txt --text_format_failure_list text_format_failure_list_java.txt ./conformance-java
@ -353,16 +353,27 @@ test_php: protoc_middleman conformance-test-runner conformance-php $(other_langu
test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs) test_php_c: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c ./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c
test_php_c_32: protoc_middleman conformance-test-runner conformance-php-c $(other_language_protoc_outputs)
./conformance-test-runner --enforce_recommended --failure_list failure_list_php_c_32.txt --text_format_failure_list text_format_failure_list_php.txt ./conformance-php-c
# These depend on library paths being properly set up. The easiest way to # These depend on library paths being properly set up. The easiest way to
# run them is to just use "tox" from the python dir. # run them is to just use "tox" from the python dir.
test_python: protoc_middleman conformance-test-runner test_python: protoc_middleman conformance-test-runner
./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py VERSION="$(shell python --version 2>&1)"; \
if [[ "$$VERSION" == "Python 2.7"* ]]; then \
echo "Using Python 2.7 failure list."; \
./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python_2.7.txt ./conformance_python.py; \
else \
echo "Using Python >2.7 failure list."; \
./conformance-test-runner --enforce_recommended --failure_list failure_list_python.txt --text_format_failure_list text_format_failure_list_python.txt ./conformance_python.py; \
fi
test_python_cpp: protoc_middleman conformance-test-runner test_python_cpp: protoc_middleman conformance-test-runner
./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt ./conformance_python.py VERSION="$(shell python --version 2>&1)"; \
if [[ "$$VERSION" == "Python 2.7"* ]]; then \
echo "Using Python 2.7 failure list."; \
./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp_2.7.txt ./conformance_python.py; \
else \
echo "Using Python >2.7 failure list."; \
./conformance-test-runner --enforce_recommended --failure_list failure_list_python_cpp.txt --text_format_failure_list text_format_failure_list_python_cpp.txt ./conformance_python.py; \
fi
test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs) test_nodejs: protoc_middleman conformance-test-runner $(other_language_protoc_outputs)
NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js NODE_PATH=../js:. ./conformance-test-runner --enforce_recommended --failure_list failure_list_js.txt ./conformance_nodejs.js

View File

@ -556,24 +556,24 @@ void BinaryAndJsonConformanceSuite::RunValidProtobufTestWithMessage(
equivalent_text_format, is_proto3); equivalent_text_format, is_proto3);
} }
// According to proto3 JSON specification, JSON serializers follow more strict // According to proto JSON specification, JSON serializers follow more strict
// rules than parsers (e.g., a serializer must serialize int32 values as JSON // rules than parsers (e.g., a serializer must serialize int32 values as JSON
// numbers while the parser is allowed to accept them as JSON strings). This // numbers while the parser is allowed to accept them as JSON strings). This
// method allows strict checking on a proto3 JSON serializer by inspecting // method allows strict checking on a proto JSON serializer by inspecting
// the JSON output directly. // the JSON output directly.
void BinaryAndJsonConformanceSuite::RunValidJsonTestWithValidator( void BinaryAndJsonConformanceSuite::RunValidJsonTestWithValidator(
const string& test_name, ConformanceLevel level, const string& input_json, const string& test_name, ConformanceLevel level, const string& input_json,
const Validator& validator) { const Validator& validator, bool is_proto3) {
TestAllTypesProto3 prototype; std::unique_ptr<Message> prototype = NewTestMessage(is_proto3);
ConformanceRequestSetting setting( ConformanceRequestSetting setting(level, conformance::JSON, conformance::JSON,
level, conformance::JSON, conformance::JSON, conformance::JSON_TEST, *prototype,
conformance::JSON_TEST, test_name, input_json);
prototype, test_name, input_json);
const ConformanceRequest& request = setting.GetRequest(); const ConformanceRequest& request = setting.GetRequest();
ConformanceResponse response; ConformanceResponse response;
string effective_test_name = string effective_test_name =
StrCat(setting.ConformanceLevelToString(level), StrCat(setting.ConformanceLevelToString(level),
".Proto3.JsonInput.", test_name, ".Validator"); is_proto3 ? ".Proto3.JsonInput." : ".Proto2.JsonInput.",
test_name, ".Validator");
RunTest(effective_test_name, request, &response); RunTest(effective_test_name, request, &response);
@ -1800,7 +1800,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() {
value.isMember("fieldName2") && value.isMember("fieldName2") &&
value.isMember("FieldName3") && value.isMember("FieldName3") &&
value.isMember("fieldName4"); value.isMember("fieldName4");
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"FieldNameWithNumbers", REQUIRED, "FieldNameWithNumbers", REQUIRED,
R"({ R"({
@ -1810,7 +1811,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() {
[](const Json::Value& value) { [](const Json::Value& value) {
return value.isMember("field0name5") && return value.isMember("field0name5") &&
value.isMember("field0Name6"); value.isMember("field0Name6");
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"FieldNameWithMixedCases", REQUIRED, "FieldNameWithMixedCases", REQUIRED,
R"({ R"({
@ -1828,7 +1830,8 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() {
value.isMember("FieldName10") && value.isMember("FieldName10") &&
value.isMember("FIELDNAME11") && value.isMember("FIELDNAME11") &&
value.isMember("FIELDName12"); value.isMember("FIELDName12");
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"FieldNameWithDoubleUnderscores", RECOMMENDED, "FieldNameWithDoubleUnderscores", RECOMMENDED,
R"({ R"({
@ -1846,7 +1849,32 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldNameConvention() {
value.isMember("fieldName16") && value.isMember("fieldName16") &&
value.isMember("fieldName17") && value.isMember("fieldName17") &&
value.isMember("FieldName18"); value.isMember("FieldName18");
}); },
true);
RunValidJsonTestWithValidator(
"StoresDefaultPrimitive", REQUIRED,
R"({
"FieldName13": 0
})",
[](const Json::Value& value) { return value.isMember("FieldName13"); },
false);
RunValidJsonTestWithValidator(
"SkipsDefaultPrimitive", REQUIRED,
R"({
"FieldName13": 0
})",
[](const Json::Value& value) { return !value.isMember("FieldName13"); },
true);
RunValidJsonTestWithValidator(
"FieldNameExtension", RECOMMENDED,
R"({
"[protobuf_test_messages.proto2.extension_int32]": 1
})",
[](const Json::Value& value) {
return value.isMember(
"[protobuf_test_messages.proto2.extension_int32]");
},
false);
} }
void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() { void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
@ -1995,19 +2023,19 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
// 64-bit values are serialized as strings. // 64-bit values are serialized as strings.
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"Int64FieldBeString", RECOMMENDED, "Int64FieldBeString", RECOMMENDED, R"({"optionalInt64": 1})",
R"({"optionalInt64": 1})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalInt64"].type() == Json::stringValue && return value["optionalInt64"].type() == Json::stringValue &&
value["optionalInt64"].asString() == "1"; value["optionalInt64"].asString() == "1";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"Uint64FieldBeString", RECOMMENDED, "Uint64FieldBeString", RECOMMENDED, R"({"optionalUint64": 1})",
R"({"optionalUint64": 1})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalUint64"].type() == Json::stringValue && return value["optionalUint64"].type() == Json::stringValue &&
value["optionalUint64"].asString() == "1"; value["optionalUint64"].asString() == "1";
}); },
true);
// Bool fields. // Bool fields.
RunValidJsonTest( RunValidJsonTest(
@ -2156,12 +2184,12 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
{ {
TestAllTypesProto3 message; TestAllTypesProto3 message;
message.set_optional_double( message.set_optional_double(
WireFormatLite::DecodeDouble(0x7FFA123456789ABCLL)); WireFormatLite::DecodeDouble(int64{0x7FFA123456789ABC}));
RunValidJsonTestWithProtobufInput( RunValidJsonTestWithProtobufInput(
"DoubleFieldNormalizeQuietNan", REQUIRED, message, "DoubleFieldNormalizeQuietNan", REQUIRED, message,
"optional_double: nan"); "optional_double: nan");
message.set_optional_double( message.set_optional_double(
WireFormatLite::DecodeDouble(0xFFFBCBA987654321LL)); WireFormatLite::DecodeDouble(uint64{0xFFFBCBA987654321}));
RunValidJsonTestWithProtobufInput( RunValidJsonTestWithProtobufInput(
"DoubleFieldNormalizeSignalingNan", REQUIRED, message, "DoubleFieldNormalizeSignalingNan", REQUIRED, message,
"optional_double: nan"); "optional_double: nan");
@ -2223,12 +2251,12 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
"optional_nested_enum: BAR"); "optional_nested_enum: BAR");
// Unknown enum values are represented as numeric values. // Unknown enum values are represented as numeric values.
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"EnumFieldUnknownValue", REQUIRED, "EnumFieldUnknownValue", REQUIRED, R"({"optionalNestedEnum": 123})",
R"({"optionalNestedEnum": 123})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalNestedEnum"].type() == Json::intValue && return value["optionalNestedEnum"].type() == Json::intValue &&
value["optionalNestedEnum"].asInt() == 123; value["optionalNestedEnum"].asInt() == 123;
}); },
true);
// String fields. // String fields.
RunValidJsonTest( RunValidJsonTest(
@ -2712,25 +2740,29 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForWrapperTypes() {
R"({"optionalDuration": "1.000000000s"})", R"({"optionalDuration": "1.000000000s"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalDuration"].asString() == "1s"; return value["optionalDuration"].asString() == "1s";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"DurationHas3FractionalDigits", RECOMMENDED, "DurationHas3FractionalDigits", RECOMMENDED,
R"({"optionalDuration": "1.010000000s"})", R"({"optionalDuration": "1.010000000s"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalDuration"].asString() == "1.010s"; return value["optionalDuration"].asString() == "1.010s";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"DurationHas6FractionalDigits", RECOMMENDED, "DurationHas6FractionalDigits", RECOMMENDED,
R"({"optionalDuration": "1.000010000s"})", R"({"optionalDuration": "1.000010000s"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalDuration"].asString() == "1.000010s"; return value["optionalDuration"].asString() == "1.000010s";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"DurationHas9FractionalDigits", RECOMMENDED, "DurationHas9FractionalDigits", RECOMMENDED,
R"({"optionalDuration": "1.000000010s"})", R"({"optionalDuration": "1.000000010s"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalDuration"].asString() == "1.000000010s"; return value["optionalDuration"].asString() == "1.000000010s";
}); },
true);
// Timestamp // Timestamp
RunValidJsonTest( RunValidJsonTest(
@ -2794,34 +2826,39 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForWrapperTypes() {
R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})", R"({"optionalTimestamp": "1969-12-31T16:00:00-08:00"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z"; return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"TimestampHasZeroFractionalDigit", RECOMMENDED, "TimestampHasZeroFractionalDigit", RECOMMENDED,
R"({"optionalTimestamp": "1970-01-01T00:00:00.000000000Z"})", R"({"optionalTimestamp": "1970-01-01T00:00:00.000000000Z"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z"; return value["optionalTimestamp"].asString() == "1970-01-01T00:00:00Z";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"TimestampHas3FractionalDigits", RECOMMENDED, "TimestampHas3FractionalDigits", RECOMMENDED,
R"({"optionalTimestamp": "1970-01-01T00:00:00.010000000Z"})", R"({"optionalTimestamp": "1970-01-01T00:00:00.010000000Z"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalTimestamp"].asString() == return value["optionalTimestamp"].asString() ==
"1970-01-01T00:00:00.010Z"; "1970-01-01T00:00:00.010Z";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"TimestampHas6FractionalDigits", RECOMMENDED, "TimestampHas6FractionalDigits", RECOMMENDED,
R"({"optionalTimestamp": "1970-01-01T00:00:00.000010000Z"})", R"({"optionalTimestamp": "1970-01-01T00:00:00.000010000Z"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalTimestamp"].asString() == return value["optionalTimestamp"].asString() ==
"1970-01-01T00:00:00.000010Z"; "1970-01-01T00:00:00.000010Z";
}); },
true);
RunValidJsonTestWithValidator( RunValidJsonTestWithValidator(
"TimestampHas9FractionalDigits", RECOMMENDED, "TimestampHas9FractionalDigits", RECOMMENDED,
R"({"optionalTimestamp": "1970-01-01T00:00:00.000000010Z"})", R"({"optionalTimestamp": "1970-01-01T00:00:00.000000010Z"})",
[](const Json::Value& value) { [](const Json::Value& value) {
return value["optionalTimestamp"].asString() == return value["optionalTimestamp"].asString() ==
"1970-01-01T00:00:00.000000010Z"; "1970-01-01T00:00:00.000000010Z";
}); },
true);
} }
void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldMask() { void BinaryAndJsonConformanceSuite::RunJsonTestsForFieldMask() {
@ -3014,6 +3051,29 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForValue() {
} }
] ]
)"); )");
RunValidJsonTestWithValidator(
"NullValueInOtherOneofOldFormat", RECOMMENDED,
R"({"oneofNullValue": "NULL_VALUE"})",
[](const Json::Value& value) {
return (value.isMember("oneofNullValue") &&
value["oneofNullValue"].isNull());
},
true);
RunValidJsonTestWithValidator(
"NullValueInOtherOneofNewFormat", RECOMMENDED,
R"({"oneofNullValue": null})",
[](const Json::Value& value) {
return (value.isMember("oneofNullValue") &&
value["oneofNullValue"].isNull());
},
true);
RunValidJsonTestWithValidator(
"NullValueInNormalMessage", RECOMMENDED,
R"({"optionalNullValue": null})",
[](const Json::Value& value) {
return value.empty();
},
true);
} }
void BinaryAndJsonConformanceSuite::RunJsonTestsForAny() { void BinaryAndJsonConformanceSuite::RunJsonTestsForAny() {

View File

@ -53,35 +53,34 @@ class BinaryAndJsonConformanceSuite : public ConformanceTestSuite {
void RunJsonTestsForStruct(); void RunJsonTestsForStruct();
void RunJsonTestsForValue(); void RunJsonTestsForValue();
void RunJsonTestsForAny(); void RunJsonTestsForAny();
void RunValidJsonTest(const string& test_name, void RunValidJsonTest(const std::string& test_name, ConformanceLevel level,
ConformanceLevel level, const std::string& input_json,
const string& input_json, const std::string& equivalent_text_format);
const string& equivalent_text_format);
void RunValidJsonTestWithProtobufInput( void RunValidJsonTestWithProtobufInput(
const string& test_name, const std::string& test_name, ConformanceLevel level,
ConformanceLevel level,
const protobuf_test_messages::proto3::TestAllTypesProto3& input, const protobuf_test_messages::proto3::TestAllTypesProto3& input,
const string& equivalent_text_format); const std::string& equivalent_text_format);
void RunValidJsonIgnoreUnknownTest( void RunValidJsonIgnoreUnknownTest(const std::string& test_name,
const string& test_name, ConformanceLevel level, const string& input_json, ConformanceLevel level,
const string& equivalent_text_format); const std::string& input_json,
void RunValidProtobufTest(const string& test_name, ConformanceLevel level, const std::string& equivalent_text_format);
const string& input_protobuf, void RunValidProtobufTest(const std::string& test_name,
const string& equivalent_text_format, ConformanceLevel level,
const std::string& input_protobuf,
const std::string& equivalent_text_format,
bool is_proto3); bool is_proto3);
void RunValidBinaryProtobufTest(const string& test_name, void RunValidBinaryProtobufTest(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input_protobuf, const std::string& input_protobuf,
bool is_proto3); bool is_proto3);
void RunValidBinaryProtobufTest(const string& test_name, void RunValidBinaryProtobufTest(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input_protobuf, const std::string& input_protobuf,
const string& expected_protobuf, const std::string& expected_protobuf,
bool is_proto3); bool is_proto3);
void RunValidProtobufTestWithMessage( void RunValidProtobufTestWithMessage(
const string& test_name, ConformanceLevel level, const std::string& test_name, ConformanceLevel level,
const Message *input, const Message* input, const std::string& equivalent_text_format,
const string& equivalent_text_format,
bool is_proto3); bool is_proto3);
bool ParseJsonResponse( bool ParseJsonResponse(
@ -93,20 +92,21 @@ class BinaryAndJsonConformanceSuite : public ConformanceTestSuite {
Message* test_message) override; Message* test_message) override;
typedef std::function<bool(const Json::Value&)> Validator; typedef std::function<bool(const Json::Value&)> Validator;
void RunValidJsonTestWithValidator(const string& test_name, void RunValidJsonTestWithValidator(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input_json, const std::string& input_json,
const Validator& validator); const Validator& validator,
void ExpectParseFailureForJson(const string& test_name, bool is_proto3);
void ExpectParseFailureForJson(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input_json); const std::string& input_json);
void ExpectSerializeFailureForJson(const string& test_name, void ExpectSerializeFailureForJson(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& text_format); const std::string& text_format);
void ExpectParseFailureForProtoWithProtoVersion (const string& proto, void ExpectParseFailureForProtoWithProtoVersion(const std::string& proto,
const string& test_name, const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
bool is_proto3); bool is_proto3);
void ExpectParseFailureForProto(const std::string& proto, void ExpectParseFailureForProto(const std::string& proto,
const std::string& test_name, const std::string& test_name,
ConformanceLevel level); ConformanceLevel level);

View File

@ -64,7 +64,7 @@ enum TestCategory {
BINARY_TEST = 1; // Test binary wire format. BINARY_TEST = 1; // Test binary wire format.
JSON_TEST = 2; // Test json wire format. JSON_TEST = 2; // Test json wire format.
// Similar to JSON_TEST. However, during parsing json, testee should ignore // Similar to JSON_TEST. However, during parsing json, testee should ignore
// unknown fields. This feature is optional. Each implementation can descide // unknown fields. This feature is optional. Each implementation can decide
// whether to support it. See // whether to support it. See
// https://developers.google.com/protocol-buffers/docs/proto3#json_options // https://developers.google.com/protocol-buffers/docs/proto3#json_options
// for more detail. // for more detail.
@ -113,7 +113,7 @@ message ConformanceRequest {
string message_type = 4; string message_type = 4;
// Each test is given a specific test category. Some category may need // Each test is given a specific test category. Some category may need
// spedific support in testee programs. Refer to the definition of TestCategory // specific support in testee programs. Refer to the definition of TestCategory
// for more information. // for more information.
TestCategory test_category = 5; TestCategory test_category = 5;

View File

@ -36,6 +36,7 @@
#include <google/protobuf/text_format.h> #include <google/protobuf/text_format.h>
#include <google/protobuf/util/json_util.h> #include <google/protobuf/util/json_util.h>
#include <google/protobuf/util/type_resolver_util.h> #include <google/protobuf/util/type_resolver_util.h>
#include <google/protobuf/stubs/status.h>
#include "conformance.pb.h" #include "conformance.pb.h"
#include <google/protobuf/test_messages_proto2.pb.h> #include <google/protobuf/test_messages_proto2.pb.h>
#include <google/protobuf/test_messages_proto3.pb.h> #include <google/protobuf/test_messages_proto3.pb.h>
@ -125,9 +126,9 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) {
options.ignore_unknown_fields = options.ignore_unknown_fields =
(request.test_category() == (request.test_category() ==
conformance::JSON_IGNORE_UNKNOWN_PARSING_TEST); conformance::JSON_IGNORE_UNKNOWN_PARSING_TEST);
Status status = JsonToBinaryString(type_resolver, *type_url, util::Status status =
request.json_payload(), &proto_binary, JsonToBinaryString(type_resolver, *type_url, request.json_payload(),
options); &proto_binary, options);
if (!status.ok()) { if (!status.ok()) {
response->set_parse_error(string("Parse error: ") + response->set_parse_error(string("Parse error: ") +
std::string(status.error_message())); std::string(status.error_message()));
@ -179,8 +180,9 @@ void DoTest(const ConformanceRequest& request, ConformanceResponse* response) {
case conformance::JSON: { case conformance::JSON: {
string proto_binary; string proto_binary;
GOOGLE_CHECK(test_message->SerializeToString(&proto_binary)); GOOGLE_CHECK(test_message->SerializeToString(&proto_binary));
Status status = BinaryToJsonString(type_resolver, *type_url, proto_binary, util::Status status =
response->mutable_json_payload()); BinaryToJsonString(type_resolver, *type_url, proto_binary,
response->mutable_json_payload());
if (!status.ok()) { if (!status.ok()) {
response->set_serialize_error( response->set_serialize_error(
string("Failed to serialize JSON output: ") + string("Failed to serialize JSON output: ") +

0
conformance/conformance_php.php Executable file → Normal file
View File

View File

@ -88,7 +88,7 @@ class ForkPipeRunner : public ConformanceTestRunner {
const std::vector<ConformanceTestSuite*>& suites); const std::vector<ConformanceTestSuite*>& suites);
ForkPipeRunner(const std::string& executable, ForkPipeRunner(const std::string& executable,
const std::vector<string>& executable_args) const std::vector<std::string>& executable_args)
: child_pid_(-1), : child_pid_(-1),
executable_(executable), executable_(executable),
executable_args_(executable_args) {} executable_args_(executable_args) {}
@ -113,7 +113,7 @@ class ForkPipeRunner : public ConformanceTestRunner {
int read_fd_; int read_fd_;
pid_t child_pid_; pid_t child_pid_;
std::string executable_; std::string executable_;
const std::vector<string> executable_args_; const std::vector<std::string> executable_args_;
std::string current_test_name_; std::string current_test_name_;
}; };
@ -168,9 +168,7 @@ class ConformanceTestSuite {
// Gets the flag name to the failure list file. // Gets the flag name to the failure list file.
// By default, this would return --failure_list // By default, this would return --failure_list
string GetFailureListFlagName() { std::string GetFailureListFlagName() { return failure_list_flag_name_; }
return failure_list_flag_name_;
}
void SetFailureListFlagName(const std::string& failure_list_flag_name) { void SetFailureListFlagName(const std::string& failure_list_flag_name) {
failure_list_flag_name_ = failure_list_flag_name; failure_list_flag_name_ = failure_list_flag_name;
@ -207,18 +205,18 @@ class ConformanceTestSuite {
class ConformanceRequestSetting { class ConformanceRequestSetting {
public: public:
ConformanceRequestSetting( ConformanceRequestSetting(ConformanceLevel level,
ConformanceLevel level, conformance::WireFormat input_format,
conformance::WireFormat input_format, conformance::WireFormat output_format,
conformance::WireFormat output_format, conformance::TestCategory test_category,
conformance::TestCategory test_category, const Message& prototype_message,
const Message& prototype_message, const std::string& test_name,
const string& test_name, const string& input); const std::string& input);
virtual ~ConformanceRequestSetting() {} virtual ~ConformanceRequestSetting() {}
std::unique_ptr<Message> NewTestMessage() const; std::unique_ptr<Message> NewTestMessage() const;
string GetTestName() const; std::string GetTestName() const;
const conformance::ConformanceRequest& GetRequest() const { const conformance::ConformanceRequest& GetRequest() const {
return request_; return request_;
@ -228,7 +226,7 @@ class ConformanceTestSuite {
return level_; return level_;
} }
string ConformanceLevelToString(ConformanceLevel level) const; std::string ConformanceLevelToString(ConformanceLevel level) const;
void SetPrintUnknownFields(bool print_unknown_fields) { void SetPrintUnknownFields(bool print_unknown_fields) {
request_.set_print_unknown_fields(true); request_.set_print_unknown_fields(true);
@ -239,8 +237,9 @@ class ConformanceTestSuite {
} }
protected: protected:
virtual string InputFormatString(conformance::WireFormat format) const; virtual std::string InputFormatString(conformance::WireFormat format) const;
virtual string OutputFormatString(conformance::WireFormat format) const; virtual std::string OutputFormatString(
conformance::WireFormat format) const;
conformance::ConformanceRequest request_; conformance::ConformanceRequest request_;
private: private:
@ -249,12 +248,12 @@ class ConformanceTestSuite {
::conformance::WireFormat output_format_; ::conformance::WireFormat output_format_;
const Message& prototype_message_; const Message& prototype_message_;
std::unique_ptr<Message> prototype_message_for_compare_; std::unique_ptr<Message> prototype_message_for_compare_;
string test_name_; std::string test_name_;
}; };
bool CheckSetEmpty(const std::set<string>& set_to_check, bool CheckSetEmpty(const std::set<std::string>& set_to_check,
const std::string& write_to_file, const std::string& msg); const std::string& write_to_file, const std::string& msg);
string WireFormatToString(conformance::WireFormat wire_format); std::string WireFormatToString(conformance::WireFormat wire_format);
// Parse payload in the response to the given message. Returns true on // Parse payload in the response to the given message. Returns true on
// success. // success.
@ -264,24 +263,23 @@ class ConformanceTestSuite {
Message* test_message) = 0; Message* test_message) = 0;
void VerifyResponse(const ConformanceRequestSetting& setting, void VerifyResponse(const ConformanceRequestSetting& setting,
const string& equivalent_wire_format, const std::string& equivalent_wire_format,
const conformance::ConformanceResponse& response, const conformance::ConformanceResponse& response,
bool need_report_success, bool require_same_wire_format); bool need_report_success, bool require_same_wire_format);
void ReportSuccess(const std::string& test_name); void ReportSuccess(const std::string& test_name);
void ReportFailure(const string& test_name, void ReportFailure(const std::string& test_name, ConformanceLevel level,
ConformanceLevel level,
const conformance::ConformanceRequest& request, const conformance::ConformanceRequest& request,
const conformance::ConformanceResponse& response, const conformance::ConformanceResponse& response,
const char* fmt, ...); const char* fmt, ...);
void ReportSkip(const string& test_name, void ReportSkip(const std::string& test_name,
const conformance::ConformanceRequest& request, const conformance::ConformanceRequest& request,
const conformance::ConformanceResponse& response); const conformance::ConformanceResponse& response);
void RunValidInputTest(const ConformanceRequestSetting& setting, void RunValidInputTest(const ConformanceRequestSetting& setting,
const string& equivalent_text_format); const std::string& equivalent_text_format);
void RunValidBinaryInputTest(const ConformanceRequestSetting& setting, void RunValidBinaryInputTest(const ConformanceRequestSetting& setting,
const string& equivalent_wire_format, const std::string& equivalent_wire_format,
bool require_same_wire_format = false); bool require_same_wire_format = false);
void RunTest(const std::string& test_name, void RunTest(const std::string& test_name,

View File

@ -34,3 +34,4 @@ Recommended.Proto3.JsonInput.TrailingCommaInAnObject
Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithNewlines
Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpace
Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace Recommended.Proto3.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
Recommended.Proto2.JsonInput.FieldNameExtension.Validator

View File

@ -1,2 +1,3 @@
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto2.JsonInput.FieldNameExtension.Validator

View File

@ -34,6 +34,7 @@ Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted Recommended.Proto3.JsonInput.Uint32MapFieldKeyNotQuoted
Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted Recommended.Proto3.JsonInput.Uint64MapFieldKeyNotQuoted
Recommended.Proto2.JsonInput.FieldNameExtension.Validator
Required.Proto3.JsonInput.EnumFieldNotQuoted Required.Proto3.JsonInput.EnumFieldNotQuoted
Required.Proto3.JsonInput.Int32FieldLeadingZero Required.Proto3.JsonInput.Int32FieldLeadingZero
Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero Required.Proto3.JsonInput.Int32FieldNegativeWithLeadingZero

View File

@ -1,115 +0,0 @@
Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto2.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput
Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataMap.STRING.MESSAGE.MergeValue.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.INT32.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.INT64.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.ProtobufOutput
Required.Proto2.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.ProtobufOutput

View File

@ -1,66 +1,12 @@
Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
Recommended.FieldMaskTooManyUnderscore.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput
Recommended.Proto2.JsonInput.FieldNameExtension.Validator
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataOneofBinary.MESSAGE.Merge.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldTooSmall Required.Proto3.JsonInput.DoubleFieldTooSmall
Required.Proto3.JsonInput.FloatFieldTooLarge Required.Proto3.JsonInput.FloatFieldTooLarge
Required.Proto3.JsonInput.FloatFieldTooSmall Required.Proto3.JsonInput.FloatFieldTooSmall
@ -75,8 +21,8 @@ Required.Proto3.JsonInput.Uint32FieldNotInteger
Required.Proto3.JsonInput.Uint64FieldNotInteger Required.Proto3.JsonInput.Uint64FieldNotInteger
Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.JsonOutput Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.JsonOutput
Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput Required.Proto3.ProtobufInput.RepeatedScalarMessageMerge.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput
Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput
Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.JsonOutput
Required.Proto3.ProtobufInput.ValidDataOneof.MESSAGE.Merge.ProtobufOutput

View File

@ -1,109 +1,2 @@
Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.Proto2.JsonInput.FieldNameExtension.Validator
Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator
Recommended.FieldMaskTooManyUnderscore.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
Recommended.Proto3.JsonInput.MapFieldValueIsNull
Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput
Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
Recommended.Proto3.JsonInput.StringEndsWithEscapeChar
Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator
Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator
Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput
Required.DurationProtoInputTooLarge.JsonOutput
Required.DurationProtoInputTooSmall.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput
Required.Proto3.JsonInput.DurationMinValue.JsonOutput
Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput
Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput
Required.Proto3.JsonInput.FloatFieldNan.JsonOutput
Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput
Required.Proto3.JsonInput.OneofFieldDuplicate
Required.Proto3.JsonInput.RejectTopLevelNull
Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput
Required.TimestampProtoInputTooLarge.JsonOutput
Required.TimestampProtoInputTooSmall.JsonOutput

View File

@ -1,142 +0,0 @@
Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
Recommended.FieldMaskTooManyUnderscore.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
Recommended.Proto3.JsonInput.DurationHas9FractionalDigits.Validator
Recommended.Proto3.JsonInput.DurationHasZeroFractionalDigit.Validator
Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
Recommended.Proto3.JsonInput.MapFieldValueIsNull
Recommended.Proto3.JsonInput.OneofZeroBytes.JsonOutput
Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
Recommended.Proto3.JsonInput.StringEndsWithEscapeChar
Recommended.Proto3.JsonInput.StringFieldSurrogateInWrongOrder
Recommended.Proto3.JsonInput.StringFieldUnpairedHighSurrogate
Recommended.Proto3.JsonInput.StringFieldUnpairedLowSurrogate
Recommended.Proto3.JsonInput.TimestampHas3FractionalDigits.Validator
Recommended.Proto3.JsonInput.TimestampHas6FractionalDigits.Validator
Recommended.Proto3.JsonInput.TimestampHas9FractionalDigits.Validator
Recommended.Proto3.JsonInput.TimestampHasZeroFractionalDigit.Validator
Recommended.Proto3.JsonInput.TimestampZeroNormalized.Validator
Recommended.Proto3.ProtobufInput.OneofZeroBytes.JsonOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.BOOL.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.DOUBLE.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.PackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.ENUM.UnpackedInput.UnpackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.INT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SFIXED64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.SINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT32.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.PackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.DefaultOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataRepeated.UINT64.UnpackedInput.PackedOutput.ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput
Required.DurationProtoInputTooLarge.JsonOutput
Required.DurationProtoInputTooSmall.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldNan.JsonOutput
Required.Proto3.JsonInput.DurationMaxValue.JsonOutput
Required.Proto3.JsonInput.DurationMaxValue.ProtobufOutput
Required.Proto3.JsonInput.DurationMinValue.JsonOutput
Required.Proto3.JsonInput.DurationMinValue.ProtobufOutput
Required.Proto3.JsonInput.DurationRepeatedValue.JsonOutput
Required.Proto3.JsonInput.DurationRepeatedValue.ProtobufOutput
Required.Proto3.JsonInput.FloatFieldInfinity.JsonOutput
Required.Proto3.JsonInput.FloatFieldNan.JsonOutput
Required.Proto3.JsonInput.FloatFieldNegativeInfinity.JsonOutput
Required.Proto3.JsonInput.Int64FieldMaxValue.JsonOutput
Required.Proto3.JsonInput.Int64FieldMaxValue.ProtobufOutput
Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.JsonOutput
Required.Proto3.JsonInput.Int64FieldMaxValueNotQuoted.ProtobufOutput
Required.Proto3.JsonInput.Int64FieldMinValue.JsonOutput
Required.Proto3.JsonInput.Int64FieldMinValue.ProtobufOutput
Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.JsonOutput
Required.Proto3.JsonInput.Int64FieldMinValueNotQuoted.ProtobufOutput
Required.Proto3.JsonInput.OneofFieldDuplicate
Required.Proto3.JsonInput.RejectTopLevelNull
Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput
Required.Proto3.JsonInput.TimestampLeap.JsonOutput
Required.Proto3.JsonInput.TimestampLeap.ProtobufOutput
Required.Proto3.JsonInput.TimestampMaxValue.JsonOutput
Required.Proto3.JsonInput.TimestampMaxValue.ProtobufOutput
Required.Proto3.JsonInput.TimestampMinValue.JsonOutput
Required.Proto3.JsonInput.TimestampMinValue.ProtobufOutput
Required.Proto3.JsonInput.TimestampRepeatedValue.JsonOutput
Required.Proto3.JsonInput.TimestampRepeatedValue.ProtobufOutput
Required.Proto3.JsonInput.TimestampWithNegativeOffset.JsonOutput
Required.Proto3.JsonInput.TimestampWithNegativeOffset.ProtobufOutput
Required.Proto3.JsonInput.TimestampWithPositiveOffset.JsonOutput
Required.Proto3.JsonInput.TimestampWithPositiveOffset.ProtobufOutput
Required.Proto3.JsonInput.Uint64FieldMaxValue.JsonOutput
Required.Proto3.JsonInput.Uint64FieldMaxValue.ProtobufOutput
Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.JsonOutput
Required.Proto3.JsonInput.Uint64FieldMaxValueNotQuoted.ProtobufOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeQuietNan.JsonOutput
Required.Proto3.ProtobufInput.FloatFieldNormalizeSignalingNan.JsonOutput
Required.Proto3.ProtobufInput.ValidDataOneof.BYTES.DefaultValue.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.BYTES.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.PackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.FLOAT.UnpackedInput.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.JsonOutput
Required.Proto3.ProtobufInput.ValidDataRepeated.STRING.ProtobufOutput
Required.Proto3.ProtobufInput.ValidDataScalar.FLOAT[2].JsonOutput
Required.TimestampProtoInputTooLarge.JsonOutput
Required.TimestampProtoInputTooSmall.JsonOutput

View File

@ -1,31 +0,0 @@
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BOOL[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.BYTES[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.DOUBLE[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED32[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FIXED64[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.FLOAT[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT32[6].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.INT64[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED32[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SFIXED64[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT32[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.SINT64[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.STRING[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[0].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT32[5].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.UINT64[0].ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldTooSmall
Required.Proto3.JsonInput.FloatFieldTooLarge
Required.Proto3.JsonInput.FloatFieldTooSmall
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
Required.Proto3.JsonInput.TimestampJsonInputLowercaseT

View File

@ -6,17 +6,3 @@
# #
# TODO(haberman): insert links to corresponding bugs tracking the issue. # TODO(haberman): insert links to corresponding bugs tracking the issue.
# Should we use GitHub issues or the Google-internal bug tracker? # Should we use GitHub issues or the Google-internal bug tracker?
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.DoubleFieldInfinityNotQuoted
Recommended.Proto3.JsonInput.DoubleFieldNanNotQuoted
Recommended.Proto3.JsonInput.DoubleFieldNegativeInfinityNotQuoted
Recommended.Proto3.JsonInput.FloatFieldInfinityNotQuoted
Recommended.Proto3.JsonInput.FloatFieldNanNotQuoted
Recommended.Proto3.JsonInput.FloatFieldNegativeInfinityNotQuoted
Required.Proto3.JsonInput.DoubleFieldTooSmall
Required.Proto3.JsonInput.FloatFieldTooLarge
Required.Proto3.JsonInput.FloatFieldTooSmall
Required.Proto3.JsonInput.RepeatedFieldWrongElementTypeExpectingIntegersGotBool
Required.Proto3.JsonInput.TimestampJsonInputLowercaseT

View File

@ -1,12 +1,16 @@
Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput Recommended.FieldMaskNumbersDontRoundTrip.JsonOutput
Recommended.FieldMaskPathsDontRoundTrip.JsonOutput Recommended.FieldMaskPathsDontRoundTrip.JsonOutput
Recommended.FieldMaskTooManyUnderscore.JsonOutput Recommended.FieldMaskTooManyUnderscore.JsonOutput
Recommended.Proto2.JsonInput.FieldNameExtension.Validator
Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.JsonOutput
Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput Recommended.Proto3.JsonInput.BytesFieldBase64Url.ProtobufOutput
Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHas3FractionalDigits.Validator
Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator Recommended.Proto3.JsonInput.DurationHas6FractionalDigits.Validator
Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter Recommended.Proto3.JsonInput.FieldMaskInvalidCharacter
Recommended.Proto3.JsonInput.MapFieldValueIsNull Recommended.Proto3.JsonInput.MapFieldValueIsNull
Recommended.Proto3.JsonInput.NullValueInNormalMessage.Validator
Recommended.Proto3.JsonInput.NullValueInOtherOneofNewFormat.Validator
Recommended.Proto3.JsonInput.NullValueInOtherOneofOldFormat.Validator
Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull Recommended.Proto3.JsonInput.RepeatedFieldMessageElementIsNull
Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull Recommended.Proto3.JsonInput.RepeatedFieldPrimitiveElementIsNull
Recommended.Proto3.JsonInput.StringEndsWithEscapeChar Recommended.Proto3.JsonInput.StringEndsWithEscapeChar
@ -77,6 +81,7 @@ Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[3].ProtobufOutput
Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput Recommended.Proto3.ProtobufInput.ValidDataScalarBinary.ENUM[4].ProtobufOutput
Required.DurationProtoInputTooLarge.JsonOutput Required.DurationProtoInputTooLarge.JsonOutput
Required.DurationProtoInputTooSmall.JsonOutput Required.DurationProtoInputTooSmall.JsonOutput
Required.Proto2.JsonInput.StoresDefaultPrimitive.Validator
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.JsonOutput
Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput Required.Proto3.JsonInput.DoubleFieldMaxNegativeValue.ProtobufOutput
Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput Required.Proto3.JsonInput.DoubleFieldMinPositiveValue.JsonOutput
@ -94,25 +99,7 @@ Required.Proto3.JsonInput.IgnoreUnknownJsonObject.ProtobufOutput
Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonString.ProtobufOutput
Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput Required.Proto3.JsonInput.IgnoreUnknownJsonTrue.ProtobufOutput
Required.Proto3.JsonInput.OneofFieldDuplicate Required.Proto3.JsonInput.OneofFieldDuplicate
Required.Proto3.JsonInput.OptionalBoolWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalBytesWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalDoubleWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalFloatWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalInt32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalStringWrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.OptionalUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.RejectTopLevelNull Required.Proto3.JsonInput.RejectTopLevelNull
Required.Proto3.JsonInput.RepeatedBoolWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedBytesWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedDoubleWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedFloatWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedInt32Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedInt64Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedStringWrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedUint32Wrapper.JsonOutput
Required.Proto3.JsonInput.RepeatedUint64Wrapper.JsonOutput
Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput Required.Proto3.JsonInput.StringFieldSurrogatePair.JsonOutput
Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput Required.Proto3.JsonInput.StringFieldSurrogatePair.ProtobufOutput
Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput Required.Proto3.ProtobufInput.DoubleFieldNormalizeQuietNan.JsonOutput

View File

@ -258,6 +258,84 @@ void TextFormatConformanceTestSuite::RunSuiteImpl() {
RunValidTextFormatTest("FloatFieldLargerThanUint64", REQUIRED, RunValidTextFormatTest("FloatFieldLargerThanUint64", REQUIRED,
"optional_float: 18446744073709551616"); "optional_float: 18446744073709551616");
// String literals x {Strings, Bytes}
for (const auto& field_type : std::vector<std::string>{"String", "Bytes"}) {
const std::string field_name =
field_type == "String" ? "optional_string" : "optional_bytes";
RunValidTextFormatTest(
StrCat("StringLiteralConcat", field_type), REQUIRED,
StrCat(field_name, ": 'first' \"second\"\n'third'"));
RunValidTextFormatTest(
StrCat("StringLiteralBasicEscapes", field_type), REQUIRED,
StrCat(field_name, ": '\\a\\b\\f\\n\\r\\t\\v\\?\\\\\\'\\\"'"));
RunValidTextFormatTest(
StrCat("StringLiteralOctalEscapes", field_type), REQUIRED,
StrCat(field_name, ": '\\341\\210\\264'"));
RunValidTextFormatTest(StrCat("StringLiteralHexEscapes", field_type),
REQUIRED,
StrCat(field_name, ": '\\xe1\\x88\\xb4'"));
RunValidTextFormatTest(
StrCat("StringLiteralShortUnicodeEscape", field_type),
RECOMMENDED, StrCat(field_name, ": '\\u1234'"));
RunValidTextFormatTest(
StrCat("StringLiteralLongUnicodeEscapes", field_type),
RECOMMENDED, StrCat(field_name, ": '\\U00001234\\U00010437'"));
// String literals don't include line feeds.
ExpectParseFailure(StrCat("StringLiteralIncludesLF", field_type),
REQUIRED,
StrCat(field_name, ": 'first line\nsecond line'"));
// Unicode escapes don't include code points that lie beyond the planes
// (> 0x10ffff).
ExpectParseFailure(
StrCat("StringLiteralLongUnicodeEscapeTooLarge", field_type),
REQUIRED, StrCat(field_name, ": '\\U00110000'"));
// Unicode escapes don't include surrogates.
ExpectParseFailure(
StrCat("StringLiteralShortUnicodeEscapeSurrogatePair",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\ud801\\udc37'"));
ExpectParseFailure(
StrCat("StringLiteralShortUnicodeEscapeSurrogateFirstOnly",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\ud800'"));
ExpectParseFailure(
StrCat("StringLiteralShortUnicodeEscapeSurrogateSecondOnly",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\udc00'"));
ExpectParseFailure(
StrCat("StringLiteralLongUnicodeEscapeSurrogateFirstOnly",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\U0000d800'"));
ExpectParseFailure(
StrCat("StringLiteralLongUnicodeEscapeSurrogateSecondOnly",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\U0000dc00'"));
ExpectParseFailure(
StrCat("StringLiteralLongUnicodeEscapeSurrogatePair", field_type),
RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\U00000dc37'"));
ExpectParseFailure(
StrCat("StringLiteralUnicodeEscapeSurrogatePairLongShort",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\U0000d801\\udc37'"));
ExpectParseFailure(
StrCat("StringLiteralUnicodeEscapeSurrogatePairShortLong",
field_type),
RECOMMENDED, StrCat(field_name, ": '\\ud801\\U0000dc37'"));
// The following method depend on the type of field, as strings have extra
// validation.
const auto test_method =
field_type == "String"
? &TextFormatConformanceTestSuite::ExpectParseFailure
: &TextFormatConformanceTestSuite::RunValidTextFormatTest;
// String fields reject invalid UTF-8 byte sequences; bytes fields don't.
(this->*test_method)(StrCat(field_type, "FieldBadUTF8Octal"),
REQUIRED, StrCat(field_name, ": '\\300'"));
(this->*test_method)(StrCat(field_type, "FieldBadUTF8Hex"), REQUIRED,
StrCat(field_name, ": '\\xc0'"));
}
// Group fields // Group fields
RunValidTextFormatTestProto2("GroupFieldNoColon", REQUIRED, RunValidTextFormatTestProto2("GroupFieldNoColon", REQUIRED,
"Data { group_int32: 1 }"); "Data { group_int32: 1 }");
@ -313,6 +391,66 @@ void TextFormatConformanceTestSuite::RunSuiteImpl() {
} }
} }
)"); )");
// Map fields
TestAllTypesProto3 prototype;
(*prototype.mutable_map_string_string())["c"] = "value";
(*prototype.mutable_map_string_string())["b"] = "value";
(*prototype.mutable_map_string_string())["a"] = "value";
RunValidTextFormatTestWithMessage("AlphabeticallySortedMapStringKeys",
REQUIRED,
R"(
map_string_string {
key: "a"
value: "value"
}
map_string_string {
key: "b"
value: "value"
}
map_string_string {
key: "c"
value: "value"
}
)",
prototype);
prototype.Clear();
(*prototype.mutable_map_int32_int32())[3] = 0;
(*prototype.mutable_map_int32_int32())[2] = 0;
(*prototype.mutable_map_int32_int32())[1] = 0;
RunValidTextFormatTestWithMessage("AlphabeticallySortedMapIntKeys", REQUIRED,
R"(
map_int32_int32 {
key: 1
value: 0
}
map_int32_int32 {
key: 2
value: 0
}
map_int32_int32 {
key: 3
value: 0
}
)",
prototype);
prototype.Clear();
(*prototype.mutable_map_bool_bool())[true] = false;
(*prototype.mutable_map_bool_bool())[false] = false;
RunValidTextFormatTestWithMessage("AlphabeticallySortedMapBoolKeys", REQUIRED,
R"(
map_bool_bool {
key: false
value: false
}
map_bool_bool {
key: true
value: false
}
)",
prototype);
} }
} // namespace protobuf } // namespace protobuf

View File

@ -42,19 +42,19 @@ class TextFormatConformanceTestSuite : public ConformanceTestSuite {
private: private:
void RunSuiteImpl(); void RunSuiteImpl();
void RunValidTextFormatTest(const string& test_name, ConformanceLevel level, void RunValidTextFormatTest(const std::string& test_name,
const string& input); ConformanceLevel level, const std::string& input);
void RunValidTextFormatTestProto2(const string& test_name, void RunValidTextFormatTestProto2(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input); const std::string& input);
void RunValidTextFormatTestWithMessage(const string& test_name, void RunValidTextFormatTestWithMessage(const std::string& test_name,
ConformanceLevel level, ConformanceLevel level,
const string& input_text, const std::string& input_text,
const Message& prototype); const Message& prototype);
void RunValidUnknownTextFormatTest(const string& test_name, void RunValidUnknownTextFormatTest(const std::string& test_name,
const Message& message); const Message& message);
void ExpectParseFailure(const string& test_name, ConformanceLevel level, void ExpectParseFailure(const std::string& test_name, ConformanceLevel level,
const string& input); const std::string& input);
bool ParseTextFormatResponse(const conformance::ConformanceResponse& response, bool ParseTextFormatResponse(const conformance::ConformanceResponse& response,
const ConformanceRequestSetting& setting, const ConformanceRequestSetting& setting,
Message* test_message); Message* test_message);

View File

@ -0,0 +1,20 @@
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex
Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString

7
conformance/text_format_failure_list_java.txt Executable file → Normal file
View File

@ -4,3 +4,10 @@ Recommended.Proto3.ProtobufInput.RepeatedUnknownFields_Drop.TextFormatOutput
Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput Recommended.Proto3.ProtobufInput.ScalarUnknownFields_Drop.TextFormatOutput
Required.Proto3.TextFormatInput.AnyField.ProtobufOutput Required.Proto3.TextFormatInput.AnyField.ProtobufOutput
Required.Proto3.TextFormatInput.AnyField.TextFormatOutput Required.Proto3.TextFormatInput.AnyField.TextFormatOutput
Required.Proto3.TextFormatInput.StringFieldBadUTF8Hex
Required.Proto3.TextFormatInput.StringFieldBadUTF8Octal
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput

View File

@ -3,3 +3,32 @@
# TODO: These should be fixed. # TODO: These should be fixed.
Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput
Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput

View File

@ -0,0 +1,36 @@
# This is the list of text format conformance tests that are known to fail right
# now.
# TODO: These should be fixed.
Required.Proto3.TextFormatInput.FloatFieldMaxValue.ProtobufOutput
Required.Proto3.TextFormatInput.FloatFieldMaxValue.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString

View File

@ -0,0 +1,28 @@
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput

View File

@ -0,0 +1,30 @@
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapesString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeBytes.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.ProtobufOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeString.TextFormatOutput
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateFirstOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogatePairString
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyBytes
Recommended.Proto3.TextFormatInput.StringLiteralShortUnicodeEscapeSurrogateSecondOnlyString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairLongShortString
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongBytes
Recommended.Proto3.TextFormatInput.StringLiteralUnicodeEscapeSurrogatePairShortLongString
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesBytes.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.ProtobufOutput
Required.Proto3.TextFormatInput.StringLiteralBasicEscapesString.TextFormatOutput
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeBytes
Required.Proto3.TextFormatInput.StringLiteralLongUnicodeEscapeTooLargeString

View File

@ -1371,7 +1371,7 @@ public:
*/ */
std::string getFormattedErrorMessages() const; std::string getFormattedErrorMessages() const;
/** \brief Returns a vector of structured errors encounted while parsing. /** \brief Returns a vector of structured errors encountered while parsing.
* \return A (possibly empty) vector of StructuredError objects. Currently * \return A (possibly empty) vector of StructuredError objects. Currently
* only one error can be returned, but the caller should tolerate * only one error can be returned, but the caller should tolerate
* multiple * multiple
@ -1867,7 +1867,7 @@ private:
* - otherwise, it the values do not fit on one line, or the array contains * - otherwise, it the values do not fit on one line, or the array contains
* object or non empty array, then print one value per line. * object or non empty array, then print one value per line.
* *
* If the Value have comments then they are outputed according to their * If the Value have comments then they are outputted according to their
*#CommentPlacement. *#CommentPlacement.
* *
* \sa Reader, Value, Value::setComment() * \sa Reader, Value, Value::setComment()
@ -1928,7 +1928,7 @@ private:
* - otherwise, it the values do not fit on one line, or the array contains * - otherwise, it the values do not fit on one line, or the array contains
* object or non empty array, then print one value per line. * object or non empty array, then print one value per line.
* *
* If the Value have comments then they are outputed according to their * If the Value have comments then they are outputted according to their
#CommentPlacement. #CommentPlacement.
* *
* \param indentation Each level will be indented by this amount extra. * \param indentation Each level will be indented by this amount extra.

View File

@ -142,7 +142,7 @@ enum {
typedef char UIntToStringBuffer[uintToStringBufferSize]; typedef char UIntToStringBuffer[uintToStringBufferSize];
/** Converts an unsigned integer to string. /** Converts an unsigned integer to string.
* @param value Unsigned interger to convert to string * @param value Unsigned integer to convert to string
* @param current Input/Output string buffer. * @param current Input/Output string buffer.
* Must have at least uintToStringBufferSize chars free. * Must have at least uintToStringBufferSize chars free.
*/ */

View File

@ -5,7 +5,7 @@
<title>Google Protocol Buffers tools</title> <title>Google Protocol Buffers tools</title>
<summary>Tools for Protocol Buffers - Google's data interchange format.</summary> <summary>Tools for Protocol Buffers - Google's data interchange format.</summary>
<description>See project site for more info.</description> <description>See project site for more info.</description>
<version>3.11.2</version> <version>3.14.0</version>
<authors>Google Inc.</authors> <authors>Google Inc.</authors>
<owners>protobuf-packages</owners> <owners>protobuf-packages</owners>
<licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl> <licenseUrl>https://github.com/protocolbuffers/protobuf/blob/master/LICENSE</licenseUrl>
@ -20,7 +20,6 @@
<file src="protoc\windows_x64\protoc.exe" target="tools\windows_x64\protoc.exe"/> <file src="protoc\windows_x64\protoc.exe" target="tools\windows_x64\protoc.exe"/>
<file src="protoc\linux_x86\protoc" target="tools\linux_x86\protoc"/> <file src="protoc\linux_x86\protoc" target="tools\linux_x86\protoc"/>
<file src="protoc\linux_x64\protoc" target="tools\linux_x64\protoc"/> <file src="protoc\linux_x64\protoc" target="tools\linux_x64\protoc"/>
<file src="protoc\macosx_x86\protoc" target="tools\macosx_x86\protoc"/>
<file src="protoc\macosx_x64\protoc" target="tools\macosx_x64\protoc"/> <file src="protoc\macosx_x64\protoc" target="tools\macosx_x64\protoc"/>
<file src="..\src\google\protobuf\any.proto" target="tools\google\protobuf"/> <file src="..\src\google\protobuf\any.proto" target="tools\google\protobuf"/>
<file src="..\src\google\protobuf\api.proto" target="tools\google\protobuf"/> <file src="..\src\google\protobuf\api.proto" target="tools\google\protobuf"/>

View File

@ -19,7 +19,6 @@ VERSION_NUMBER=$1
declare -a FILE_NAMES=( \ declare -a FILE_NAMES=( \
windows_x86 windows-x86_32.exe \ windows_x86 windows-x86_32.exe \
windows_x64 windows-x86_64.exe \ windows_x64 windows-x86_64.exe \
macosx_x86 osx-x86_32.exe \
macosx_x64 osx-x86_64.exe \ macosx_x64 osx-x86_64.exe \
linux_x86 linux-x86_32.exe \ linux_x86 linux-x86_32.exe \
linux_x64 linux-x86_64.exe \ linux_x64 linux-x86_64.exe \

View File

@ -201,29 +201,29 @@ namespace Google.Protobuf
[Test] [Test]
public void DecodeZigZag32() public void DecodeZigZag32()
{ {
Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(0)); Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(0));
Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(1)); Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(1));
Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(2)); Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(2));
Assert.AreEqual(-2, CodedInputStream.DecodeZigZag32(3)); Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag32(3));
Assert.AreEqual(0x3FFFFFFF, CodedInputStream.DecodeZigZag32(0x7FFFFFFE)); Assert.AreEqual(0x3FFFFFFF, ParsingPrimitives.DecodeZigZag32(0x7FFFFFFE));
Assert.AreEqual(unchecked((int) 0xC0000000), CodedInputStream.DecodeZigZag32(0x7FFFFFFF)); Assert.AreEqual(unchecked((int) 0xC0000000), ParsingPrimitives.DecodeZigZag32(0x7FFFFFFF));
Assert.AreEqual(0x7FFFFFFF, CodedInputStream.DecodeZigZag32(0xFFFFFFFE)); Assert.AreEqual(0x7FFFFFFF, ParsingPrimitives.DecodeZigZag32(0xFFFFFFFE));
Assert.AreEqual(unchecked((int) 0x80000000), CodedInputStream.DecodeZigZag32(0xFFFFFFFF)); Assert.AreEqual(unchecked((int) 0x80000000), ParsingPrimitives.DecodeZigZag32(0xFFFFFFFF));
} }
[Test] [Test]
public void DecodeZigZag64() public void DecodeZigZag64()
{ {
Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(0)); Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(0));
Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(1)); Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(1));
Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(2)); Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(2));
Assert.AreEqual(-2, CodedInputStream.DecodeZigZag64(3)); Assert.AreEqual(-2, ParsingPrimitives.DecodeZigZag64(3));
Assert.AreEqual(0x000000003FFFFFFFL, CodedInputStream.DecodeZigZag64(0x000000007FFFFFFEL)); Assert.AreEqual(0x000000003FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFEL));
Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), CodedInputStream.DecodeZigZag64(0x000000007FFFFFFFL)); Assert.AreEqual(unchecked((long) 0xFFFFFFFFC0000000L), ParsingPrimitives.DecodeZigZag64(0x000000007FFFFFFFL));
Assert.AreEqual(0x000000007FFFFFFFL, CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFEL)); Assert.AreEqual(0x000000007FFFFFFFL, ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFEL));
Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), CodedInputStream.DecodeZigZag64(0x00000000FFFFFFFFL)); Assert.AreEqual(unchecked((long) 0xFFFFFFFF80000000L), ParsingPrimitives.DecodeZigZag64(0x00000000FFFFFFFFL));
Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL)); Assert.AreEqual(0x7FFFFFFFFFFFFFFFL, ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFEL));
Assert.AreEqual(unchecked((long) 0x8000000000000000L), CodedInputStream.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL)); Assert.AreEqual(unchecked((long) 0x8000000000000000L), ParsingPrimitives.DecodeZigZag64(0xFFFFFFFFFFFFFFFFL));
} }
[Test] [Test]

View File

@ -211,35 +211,35 @@ namespace Google.Protobuf
[Test] [Test]
public void EncodeZigZag32() public void EncodeZigZag32()
{ {
Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag32(0)); Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag32(0));
Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag32(-1)); Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag32(-1));
Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag32(1)); Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag32(1));
Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag32(-2)); Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag32(-2));
Assert.AreEqual(0x7FFFFFFEu, CodedOutputStream.EncodeZigZag32(0x3FFFFFFF)); Assert.AreEqual(0x7FFFFFFEu, WritingPrimitives.EncodeZigZag32(0x3FFFFFFF));
Assert.AreEqual(0x7FFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0xC0000000))); Assert.AreEqual(0x7FFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0xC0000000)));
Assert.AreEqual(0xFFFFFFFEu, CodedOutputStream.EncodeZigZag32(0x7FFFFFFF)); Assert.AreEqual(0xFFFFFFFEu, WritingPrimitives.EncodeZigZag32(0x7FFFFFFF));
Assert.AreEqual(0xFFFFFFFFu, CodedOutputStream.EncodeZigZag32(unchecked((int) 0x80000000))); Assert.AreEqual(0xFFFFFFFFu, WritingPrimitives.EncodeZigZag32(unchecked((int) 0x80000000)));
} }
[Test] [Test]
public void EncodeZigZag64() public void EncodeZigZag64()
{ {
Assert.AreEqual(0u, CodedOutputStream.EncodeZigZag64(0)); Assert.AreEqual(0u, WritingPrimitives.EncodeZigZag64(0));
Assert.AreEqual(1u, CodedOutputStream.EncodeZigZag64(-1)); Assert.AreEqual(1u, WritingPrimitives.EncodeZigZag64(-1));
Assert.AreEqual(2u, CodedOutputStream.EncodeZigZag64(1)); Assert.AreEqual(2u, WritingPrimitives.EncodeZigZag64(1));
Assert.AreEqual(3u, CodedOutputStream.EncodeZigZag64(-2)); Assert.AreEqual(3u, WritingPrimitives.EncodeZigZag64(-2));
Assert.AreEqual(0x000000007FFFFFFEuL, Assert.AreEqual(0x000000007FFFFFFEuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000003FFFFFFFUL)));
Assert.AreEqual(0x000000007FFFFFFFuL, Assert.AreEqual(0x000000007FFFFFFFuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFFC0000000UL)));
Assert.AreEqual(0x00000000FFFFFFFEuL, Assert.AreEqual(0x00000000FFFFFFFEuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0x000000007FFFFFFFUL)));
Assert.AreEqual(0x00000000FFFFFFFFuL, Assert.AreEqual(0x00000000FFFFFFFFuL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0xFFFFFFFF80000000UL)));
Assert.AreEqual(0xFFFFFFFFFFFFFFFEL, Assert.AreEqual(0xFFFFFFFFFFFFFFFEL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0x7FFFFFFFFFFFFFFFUL)));
Assert.AreEqual(0xFFFFFFFFFFFFFFFFL, Assert.AreEqual(0xFFFFFFFFFFFFFFFFL,
CodedOutputStream.EncodeZigZag64(unchecked((long) 0x8000000000000000UL))); WritingPrimitives.EncodeZigZag64(unchecked((long) 0x8000000000000000UL)));
} }
[Test] [Test]
@ -247,26 +247,26 @@ namespace Google.Protobuf
{ {
// Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1) // Some easier-to-verify round-trip tests. The inputs (other than 0, 1, -1)
// were chosen semi-randomly via keyboard bashing. // were chosen semi-randomly via keyboard bashing.
Assert.AreEqual(0, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(0))); Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(0)));
Assert.AreEqual(1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(1))); Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(1)));
Assert.AreEqual(-1, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-1))); Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-1)));
Assert.AreEqual(14927, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(14927))); Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(14927)));
Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag32(CodedOutputStream.EncodeZigZag32(-3612))); Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag32(WritingPrimitives.EncodeZigZag32(-3612)));
} }
[Test] [Test]
public void RoundTripZigZag64() public void RoundTripZigZag64()
{ {
Assert.AreEqual(0, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(0))); Assert.AreEqual(0, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(0)));
Assert.AreEqual(1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(1))); Assert.AreEqual(1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(1)));
Assert.AreEqual(-1, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-1))); Assert.AreEqual(-1, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-1)));
Assert.AreEqual(14927, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(14927))); Assert.AreEqual(14927, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(14927)));
Assert.AreEqual(-3612, CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-3612))); Assert.AreEqual(-3612, ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-3612)));
Assert.AreEqual(856912304801416L, Assert.AreEqual(856912304801416L,
CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(856912304801416L))); ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(856912304801416L)));
Assert.AreEqual(-75123905439571256L, Assert.AreEqual(-75123905439571256L,
CodedInputStream.DecodeZigZag64(CodedOutputStream.EncodeZigZag64(-75123905439571256L))); ParsingPrimitives.DecodeZigZag64(WritingPrimitives.EncodeZigZag64(-75123905439571256L)));
} }
[Test] [Test]
@ -395,7 +395,7 @@ namespace Google.Protobuf
Assert.IsTrue(memoryStream.CanWrite); Assert.IsTrue(memoryStream.CanWrite);
using (var cos = new CodedOutputStream(memoryStream)) using (var cos = new CodedOutputStream(memoryStream))
{ {
cos.WriteRawByte(0); cos.WriteRawBytes(new byte[] {0});
Assert.AreEqual(0, memoryStream.Position); // Not flushed yet Assert.AreEqual(0, memoryStream.Position); // Not flushed yet
} }
Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream Assert.AreEqual(1, memoryStream.ToArray().Length); // Flushed data from CodedOutputStream to MemoryStream
@ -409,7 +409,7 @@ namespace Google.Protobuf
Assert.IsTrue(memoryStream.CanWrite); Assert.IsTrue(memoryStream.CanWrite);
using (var cos = new CodedOutputStream(memoryStream, true)) using (var cos = new CodedOutputStream(memoryStream, true))
{ {
cos.WriteRawByte(0); cos.WriteRawBytes(new byte[] {0});
Assert.AreEqual(0, memoryStream.Position); // Not flushed yet Assert.AreEqual(0, memoryStream.Position); // Not flushed yet
} }
Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream Assert.AreEqual(1, memoryStream.Position); // Flushed data from CodedOutputStream to MemoryStream

View File

@ -124,11 +124,20 @@ namespace Google.Protobuf
{ {
var stream = new MemoryStream(); var stream = new MemoryStream();
var codedOutput = new CodedOutputStream(stream); var codedOutput = new CodedOutputStream(stream);
codec.ValueWriter(codedOutput, sampleValue); WriteContext.Initialize(codedOutput, out WriteContext ctx);
try
{
// only write the value using the codec
codec.ValueWriter(ref ctx, sampleValue);
}
finally
{
ctx.CopyStateTo(codedOutput);
}
codedOutput.Flush(); codedOutput.Flush();
stream.Position = 0; stream.Position = 0;
var codedInput = new CodedInputStream(stream); var codedInput = new CodedInputStream(stream);
Assert.AreEqual(sampleValue, codec.ValueReader(codedInput)); Assert.AreEqual(sampleValue, codec.Read(codedInput));
Assert.IsTrue(codedInput.IsAtEnd); Assert.IsTrue(codedInput.IsAtEnd);
} }
@ -172,13 +181,22 @@ namespace Google.Protobuf
if (codec.DefaultValue != null) // This part isn't appropriate for message types. if (codec.DefaultValue != null) // This part isn't appropriate for message types.
{ {
codedOutput = new CodedOutputStream(stream); codedOutput = new CodedOutputStream(stream);
codec.ValueWriter(codedOutput, codec.DefaultValue); WriteContext.Initialize(codedOutput, out WriteContext ctx);
try
{
// only write the value using the codec
codec.ValueWriter(ref ctx, codec.DefaultValue);
}
finally
{
ctx.CopyStateTo(codedOutput);
}
codedOutput.Flush(); codedOutput.Flush();
Assert.AreNotEqual(0, stream.Position); Assert.AreNotEqual(0, stream.Position);
Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue)); Assert.AreEqual(stream.Position, codec.ValueSizeCalculator(codec.DefaultValue));
stream.Position = 0; stream.Position = 0;
var codedInput = new CodedInputStream(stream); var codedInput = new CodedInputStream(stream);
Assert.AreEqual(codec.DefaultValue, codec.ValueReader(codedInput)); Assert.AreEqual(codec.DefaultValue, codec.Read(codedInput));
} }
} }

View File

@ -45,6 +45,7 @@ $PROTOC -Isrc --csharp_out=csharp/src/Google.Protobuf \
# and old_extensions2.proto, which are generated with an older version # and old_extensions2.proto, which are generated with an older version
# of protoc. # of protoc.
$PROTOC -Isrc -Icsharp/protos \ $PROTOC -Isrc -Icsharp/protos \
--experimental_allow_proto3_optional \
--csharp_out=csharp/src/Google.Protobuf.Test.TestProtos \ --csharp_out=csharp/src/Google.Protobuf.Test.TestProtos \
--descriptor_set_out=csharp/src/Google.Protobuf.Test/testprotos.pb \ --descriptor_set_out=csharp/src/Google.Protobuf.Test/testprotos.pb \
--include_source_info \ --include_source_info \
@ -61,9 +62,11 @@ $PROTOC -Isrc -Icsharp/protos \
csharp/protos/unittest_issue6936_a.proto \ csharp/protos/unittest_issue6936_a.proto \
csharp/protos/unittest_issue6936_b.proto \ csharp/protos/unittest_issue6936_b.proto \
csharp/protos/unittest_issue6936_c.proto \ csharp/protos/unittest_issue6936_c.proto \
csharp/protos/unittest_selfreferential_options.proto \
src/google/protobuf/unittest_well_known_types.proto \ src/google/protobuf/unittest_well_known_types.proto \
src/google/protobuf/test_messages_proto3.proto \ src/google/protobuf/test_messages_proto3.proto \
src/google/protobuf/test_messages_proto2.proto src/google/protobuf/test_messages_proto2.proto \
src/google/protobuf/unittest_proto3_optional.proto
# AddressBook sample protos # AddressBook sample protos
$PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \ $PROTOC -Iexamples -Isrc --csharp_out=csharp/src/AddressBook \

12
csharp/install_dotnet_sdk.ps1 Normal file → Executable file
View File

@ -1,5 +1,5 @@
#!/usr/bin/env powershell #!/usr/bin/env powershell
# Install dotnet SDK based on the SDK version from global.json # Install dotnet SDK using the official dotnet-install.ps1 script
Set-StrictMode -Version 2 Set-StrictMode -Version 2
$ErrorActionPreference = 'Stop' $ErrorActionPreference = 'Stop'
@ -9,16 +9,12 @@ $ErrorActionPreference = 'Stop'
$InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1' $InstallScriptUrl = 'https://dot.net/v1/dotnet-install.ps1'
$InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1' $InstallScriptPath = Join-Path "$env:TEMP" 'dotnet-install.ps1'
$GlobalJsonPath = Join-Path $PSScriptRoot '..' | Join-Path -ChildPath 'global.json'
# Resolve SDK version from global.json file
$GlobalJson = Get-Content -Raw $GlobalJsonPath | ConvertFrom-Json
$SDKVersion = $GlobalJson.sdk.version
# Download install script # Download install script
Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath" Write-Host "Downloading install script: $InstallScriptUrl => $InstallScriptPath"
Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath Invoke-WebRequest -Uri $InstallScriptUrl -OutFile $InstallScriptPath
&$InstallScriptPath -Version $SDKVersion
# Also install dotnet SDK LTS which is required to run some of the tests # The SDK versions to install should be kept in sync with versions
# installed by kokoro/linux/dockerfile/test/csharp/Dockerfile
&$InstallScriptPath -Version 2.1.802 &$InstallScriptPath -Version 2.1.802
&$InstallScriptPath -Version 3.1.301

View File

@ -8,6 +8,8 @@ option csharp_namespace = "UnitTest.Issues.TestProtos";
package unittest_issues; package unittest_issues;
import "google/protobuf/struct.proto";
// Issue 307: when generating doubly-nested types, any references // Issue 307: when generating doubly-nested types, any references
// should be of the form A.Types.B.Types.C. // should be of the form A.Types.B.Types.C.
message Issue307 { message Issue307 {
@ -137,4 +139,20 @@ message OneofMerging {
string text = 1; string text = 1;
Nested nested = 2; Nested nested = 2;
} }
} }
message NullValueOutsideStruct {
oneof value {
string string_value = 1;
google.protobuf.NullValue null_value = 2;
}
}
message NullValueNotInOneof {
google.protobuf.NullValue null_value = 2;
}
message MixedRegularAndOptional {
string regular_field = 1;
optional string optional_field = 2;
}

View File

@ -0,0 +1,64 @@
// Protocol Buffers - Google's data interchange format
// Copyright 2008 Google Inc. All rights reserved.
// https://developers.google.com/protocol-buffers/
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
syntax = "proto2";
package protobuf_unittest_selfreferential_options;
option csharp_namespace = "UnitTest.Issues.TestProtos.SelfreferentialOptions";
import "google/protobuf/descriptor.proto";
message FooOptions {
// Custom field option used in definition of the extension message.
optional int32 int_opt = 1 [(foo_options) = {
int_opt: 1
[foo_int_opt]: 2
[foo_foo_opt]: {
int_opt: 3
}
}];
// Custom field option used in definition of the custom option's message.
optional int32 foo = 2 [(foo_options) = {foo: 1234}];
extensions 1000 to max;
}
extend google.protobuf.FieldOptions {
// Custom field option used on the definition of that field option.
optional int32 bar_options = 1000 [(bar_options) = 1234];
optional FooOptions foo_options = 1001;
}
extend FooOptions {
optional int32 foo_int_opt = 1000;
optional FooOptions foo_foo_opt = 1001;
}

View File

@ -49,7 +49,11 @@ namespace Google.Protobuf.Examples.AddressBook {
/// <summary> /// <summary>
/// [START messages] /// [START messages]
/// </summary> /// </summary>
public sealed partial class Person : pb::IMessage<Person> { public sealed partial class Person : pb::IMessage<Person>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person()); private static readonly pb::MessageParser<Person> _parser = new pb::MessageParser<Person>(() => new Person());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -186,6 +190,9 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(Name); output.WriteString(Name);
@ -206,8 +213,35 @@ namespace Google.Protobuf.Examples.AddressBook {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (Id != 0) {
output.WriteRawTag(16);
output.WriteInt32(Id);
}
if (Email.Length != 0) {
output.WriteRawTag(26);
output.WriteString(Email);
}
phones_.WriteTo(ref output, _repeated_phones_codec);
if (lastUpdated_ != null) {
output.WriteRawTag(42);
output.WriteMessage(LastUpdated);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -256,6 +290,9 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -287,8 +324,46 @@ namespace Google.Protobuf.Examples.AddressBook {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 16: {
Id = input.ReadInt32();
break;
}
case 26: {
Email = input.ReadString();
break;
}
case 34: {
phones_.AddEntriesFrom(ref input, _repeated_phones_codec);
break;
}
case 42: {
if (lastUpdated_ == null) {
LastUpdated = new global::Google.Protobuf.WellKnownTypes.Timestamp();
}
input.ReadMessage(LastUpdated);
break;
}
}
}
}
#endif
#region Nested types #region Nested types
/// <summary>Container for nested types declared in the Person message type.</summary> /// <summary>Container for nested types declared in the Person message type.</summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -299,7 +374,11 @@ namespace Google.Protobuf.Examples.AddressBook {
[pbr::OriginalName("WORK")] Work = 2, [pbr::OriginalName("WORK")] Work = 2,
} }
public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber> { public sealed partial class PhoneNumber : pb::IMessage<PhoneNumber>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber()); private static readonly pb::MessageParser<PhoneNumber> _parser = new pb::MessageParser<PhoneNumber>(() => new PhoneNumber());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -392,6 +471,9 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Number.Length != 0) { if (Number.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(Number); output.WriteString(Number);
@ -403,8 +485,26 @@ namespace Google.Protobuf.Examples.AddressBook {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Number.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Number);
}
if (Type != global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType.Mobile) {
output.WriteRawTag(16);
output.WriteEnum((int) Type);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -436,6 +536,9 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -452,8 +555,31 @@ namespace Google.Protobuf.Examples.AddressBook {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Number = input.ReadString();
break;
}
case 16: {
Type = (global::Google.Protobuf.Examples.AddressBook.Person.Types.PhoneType) input.ReadEnum();
break;
}
}
}
}
#endif
} }
} }
@ -464,7 +590,11 @@ namespace Google.Protobuf.Examples.AddressBook {
/// <summary> /// <summary>
/// Our address book file is just one of these. /// Our address book file is just one of these.
/// </summary> /// </summary>
public sealed partial class AddressBook : pb::IMessage<AddressBook> { public sealed partial class AddressBook : pb::IMessage<AddressBook>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook()); private static readonly pb::MessageParser<AddressBook> _parser = new pb::MessageParser<AddressBook>(() => new AddressBook());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -542,12 +672,26 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
people_.WriteTo(output, _repeated_people_codec); people_.WriteTo(output, _repeated_people_codec);
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
people_.WriteTo(ref output, _repeated_people_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -569,6 +713,9 @@ namespace Google.Protobuf.Examples.AddressBook {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -581,8 +728,27 @@ namespace Google.Protobuf.Examples.AddressBook {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
people_.AddEntriesFrom(ref input, _repeated_people_codec);
break;
}
}
}
}
#endif
} }
#endregion #endregion

View File

@ -37,7 +37,7 @@ namespace Google.Protobuf.Examples.AddressBook
/// <summary> /// <summary>
/// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour /// Entry point. Repeatedly prompts user for an action to take, delegating actual behaviour
/// to individual actions. Each action has its own Main method, so that it can be used as an /// to individual actions. Each action has its own Main method, so that it can be used as an
/// invidual complete program. /// individual complete program.
/// </summary> /// </summary>
internal class Program internal class Program
{ {

View File

@ -43,20 +43,20 @@ namespace Google.Protobuf.Benchmarks
/// <summary> /// <summary>
/// The configuration for a single serialization test, loaded from a dataset. /// The configuration for a single serialization test, loaded from a dataset.
/// </summary> /// </summary>
public class SerializationConfig public class BenchmarkDatasetConfig
{ {
private static readonly Dictionary<string, MessageParser> parsersByMessageName = private static readonly Dictionary<string, MessageParser> parsersByMessageName =
typeof(SerializationBenchmark).Assembly.GetTypes() typeof(GoogleMessageBenchmark).Assembly.GetTypes()
.Where(t => typeof(IMessage).IsAssignableFrom(t)) .Where(t => typeof(IMessage).IsAssignableFrom(t))
.ToDictionary( .ToDictionary(
t => ((MessageDescriptor) t.GetProperty("Descriptor", BindingFlags.Static | BindingFlags.Public).GetValue(null)).FullName, t => ((MessageDescriptor) t.GetProperty("Descriptor", BindingFlags.Static | BindingFlags.Public).GetValue(null)).FullName,
t => ((MessageParser) t.GetProperty("Parser", BindingFlags.Static | BindingFlags.Public).GetValue(null))); t => ((MessageParser) t.GetProperty("Parser", BindingFlags.Static | BindingFlags.Public).GetValue(null)));
public MessageParser Parser { get; } public MessageParser Parser { get; }
public IEnumerable<ByteString> Payloads { get; } public List<byte[]> Payloads { get; }
public string Name { get; } public string Name { get; }
public SerializationConfig(string resource) public BenchmarkDatasetConfig(string resource, string shortName = null)
{ {
var data = LoadData(resource); var data = LoadData(resource);
var dataset = BenchmarkDataset.Parser.ParseFrom(data); var dataset = BenchmarkDataset.Parser.ParseFrom(data);
@ -66,13 +66,13 @@ namespace Google.Protobuf.Benchmarks
throw new ArgumentException($"No parser for message {dataset.MessageName} in this assembly"); throw new ArgumentException($"No parser for message {dataset.MessageName} in this assembly");
} }
Parser = parser; Parser = parser;
Payloads = dataset.Payload; Payloads = new List<byte[]>(dataset.Payload.Select(p => p.ToByteArray()));
Name = dataset.Name; Name = shortName ?? dataset.Name;
} }
private static byte[] LoadData(string resource) private static byte[] LoadData(string resource)
{ {
using (var stream = typeof(SerializationBenchmark).Assembly.GetManifestResourceStream($"Google.Protobuf.Benchmarks.{resource}")) using (var stream = typeof(GoogleMessageBenchmark).Assembly.GetManifestResourceStream($"Google.Protobuf.Benchmarks.{resource}"))
{ {
if (stream == null) if (stream == null)
{ {

View File

@ -64,7 +64,11 @@ namespace Benchmarks.Proto3 {
} }
#region Messages #region Messages
public sealed partial class GoogleMessage1 : pb::IMessage<GoogleMessage1> { public sealed partial class GoogleMessage1 : pb::IMessage<GoogleMessage1>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<GoogleMessage1> _parser = new pb::MessageParser<GoogleMessage1>(() => new GoogleMessage1()); private static readonly pb::MessageParser<GoogleMessage1> _parser = new pb::MessageParser<GoogleMessage1>(() => new GoogleMessage1());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -702,6 +706,9 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Field1.Length != 0) { if (Field1.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(Field1); output.WriteString(Field1);
@ -866,8 +873,179 @@ namespace Benchmarks.Proto3 {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Field1.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Field1);
}
if (Field2 != 0) {
output.WriteRawTag(16);
output.WriteInt32(Field2);
}
if (Field3 != 0) {
output.WriteRawTag(24);
output.WriteInt32(Field3);
}
if (Field4.Length != 0) {
output.WriteRawTag(34);
output.WriteString(Field4);
}
field5_.WriteTo(ref output, _repeated_field5_codec);
if (Field6 != 0) {
output.WriteRawTag(48);
output.WriteInt32(Field6);
}
if (Field7.Length != 0) {
output.WriteRawTag(58);
output.WriteString(Field7);
}
if (Field9.Length != 0) {
output.WriteRawTag(74);
output.WriteString(Field9);
}
if (Field12 != false) {
output.WriteRawTag(96);
output.WriteBool(Field12);
}
if (Field13 != false) {
output.WriteRawTag(104);
output.WriteBool(Field13);
}
if (Field14 != false) {
output.WriteRawTag(112);
output.WriteBool(Field14);
}
if (field15_ != null) {
output.WriteRawTag(122);
output.WriteMessage(Field15);
}
if (Field16 != 0) {
output.WriteRawTag(128, 1);
output.WriteInt32(Field16);
}
if (Field17 != false) {
output.WriteRawTag(136, 1);
output.WriteBool(Field17);
}
if (Field18.Length != 0) {
output.WriteRawTag(146, 1);
output.WriteString(Field18);
}
if (Field22 != 0L) {
output.WriteRawTag(176, 1);
output.WriteInt64(Field22);
}
if (Field23 != 0) {
output.WriteRawTag(184, 1);
output.WriteInt32(Field23);
}
if (Field24 != false) {
output.WriteRawTag(192, 1);
output.WriteBool(Field24);
}
if (Field25 != 0) {
output.WriteRawTag(200, 1);
output.WriteInt32(Field25);
}
if (Field29 != 0) {
output.WriteRawTag(232, 1);
output.WriteInt32(Field29);
}
if (Field30 != false) {
output.WriteRawTag(240, 1);
output.WriteBool(Field30);
}
if (Field59 != false) {
output.WriteRawTag(216, 3);
output.WriteBool(Field59);
}
if (Field60 != 0) {
output.WriteRawTag(224, 3);
output.WriteInt32(Field60);
}
if (Field67 != 0) {
output.WriteRawTag(152, 4);
output.WriteInt32(Field67);
}
if (Field68 != 0) {
output.WriteRawTag(160, 4);
output.WriteInt32(Field68);
}
if (Field78 != false) {
output.WriteRawTag(240, 4);
output.WriteBool(Field78);
}
if (Field80 != false) {
output.WriteRawTag(128, 5);
output.WriteBool(Field80);
}
if (Field81 != false) {
output.WriteRawTag(136, 5);
output.WriteBool(Field81);
}
if (Field100 != 0) {
output.WriteRawTag(160, 6);
output.WriteInt32(Field100);
}
if (Field101 != 0) {
output.WriteRawTag(168, 6);
output.WriteInt32(Field101);
}
if (Field102.Length != 0) {
output.WriteRawTag(178, 6);
output.WriteString(Field102);
}
if (Field103.Length != 0) {
output.WriteRawTag(186, 6);
output.WriteString(Field103);
}
if (Field104 != 0) {
output.WriteRawTag(192, 6);
output.WriteInt32(Field104);
}
if (Field128 != 0) {
output.WriteRawTag(128, 8);
output.WriteInt32(Field128);
}
if (Field129.Length != 0) {
output.WriteRawTag(138, 8);
output.WriteString(Field129);
}
if (Field130 != 0) {
output.WriteRawTag(144, 8);
output.WriteInt32(Field130);
}
if (Field131 != 0) {
output.WriteRawTag(152, 8);
output.WriteInt32(Field131);
}
if (Field150 != 0) {
output.WriteRawTag(176, 9);
output.WriteInt32(Field150);
}
if (Field271 != 0) {
output.WriteRawTag(248, 16);
output.WriteInt32(Field271);
}
if (Field272 != 0) {
output.WriteRawTag(128, 17);
output.WriteInt32(Field272);
}
if (Field280 != 0) {
output.WriteRawTag(192, 17);
output.WriteInt32(Field280);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -1132,6 +1310,9 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -1308,11 +1489,198 @@ namespace Benchmarks.Proto3 {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Field1 = input.ReadString();
break;
}
case 16: {
Field2 = input.ReadInt32();
break;
}
case 24: {
Field3 = input.ReadInt32();
break;
}
case 34: {
Field4 = input.ReadString();
break;
}
case 42:
case 41: {
field5_.AddEntriesFrom(ref input, _repeated_field5_codec);
break;
}
case 48: {
Field6 = input.ReadInt32();
break;
}
case 58: {
Field7 = input.ReadString();
break;
}
case 74: {
Field9 = input.ReadString();
break;
}
case 96: {
Field12 = input.ReadBool();
break;
}
case 104: {
Field13 = input.ReadBool();
break;
}
case 112: {
Field14 = input.ReadBool();
break;
}
case 122: {
if (field15_ == null) {
Field15 = new global::Benchmarks.Proto3.GoogleMessage1SubMessage();
}
input.ReadMessage(Field15);
break;
}
case 128: {
Field16 = input.ReadInt32();
break;
}
case 136: {
Field17 = input.ReadBool();
break;
}
case 146: {
Field18 = input.ReadString();
break;
}
case 176: {
Field22 = input.ReadInt64();
break;
}
case 184: {
Field23 = input.ReadInt32();
break;
}
case 192: {
Field24 = input.ReadBool();
break;
}
case 200: {
Field25 = input.ReadInt32();
break;
}
case 232: {
Field29 = input.ReadInt32();
break;
}
case 240: {
Field30 = input.ReadBool();
break;
}
case 472: {
Field59 = input.ReadBool();
break;
}
case 480: {
Field60 = input.ReadInt32();
break;
}
case 536: {
Field67 = input.ReadInt32();
break;
}
case 544: {
Field68 = input.ReadInt32();
break;
}
case 624: {
Field78 = input.ReadBool();
break;
}
case 640: {
Field80 = input.ReadBool();
break;
}
case 648: {
Field81 = input.ReadBool();
break;
}
case 800: {
Field100 = input.ReadInt32();
break;
}
case 808: {
Field101 = input.ReadInt32();
break;
}
case 818: {
Field102 = input.ReadString();
break;
}
case 826: {
Field103 = input.ReadString();
break;
}
case 832: {
Field104 = input.ReadInt32();
break;
}
case 1024: {
Field128 = input.ReadInt32();
break;
}
case 1034: {
Field129 = input.ReadString();
break;
}
case 1040: {
Field130 = input.ReadInt32();
break;
}
case 1048: {
Field131 = input.ReadInt32();
break;
}
case 1200: {
Field150 = input.ReadInt32();
break;
}
case 2168: {
Field271 = input.ReadInt32();
break;
}
case 2176: {
Field272 = input.ReadInt32();
break;
}
case 2240: {
Field280 = input.ReadInt32();
break;
}
}
}
}
#endif
} }
public sealed partial class GoogleMessage1SubMessage : pb::IMessage<GoogleMessage1SubMessage> { public sealed partial class GoogleMessage1SubMessage : pb::IMessage<GoogleMessage1SubMessage>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<GoogleMessage1SubMessage> _parser = new pb::MessageParser<GoogleMessage1SubMessage>(() => new GoogleMessage1SubMessage()); private static readonly pb::MessageParser<GoogleMessage1SubMessage> _parser = new pb::MessageParser<GoogleMessage1SubMessage>(() => new GoogleMessage1SubMessage());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1657,6 +2025,9 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Field1 != 0) { if (Field1 != 0) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteInt32(Field1); output.WriteInt32(Field1);
@ -1740,8 +2111,98 @@ namespace Benchmarks.Proto3 {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Field1 != 0) {
output.WriteRawTag(8);
output.WriteInt32(Field1);
}
if (Field2 != 0) {
output.WriteRawTag(16);
output.WriteInt32(Field2);
}
if (Field3 != 0) {
output.WriteRawTag(24);
output.WriteInt32(Field3);
}
if (Field12 != false) {
output.WriteRawTag(96);
output.WriteBool(Field12);
}
if (Field13 != 0L) {
output.WriteRawTag(104);
output.WriteInt64(Field13);
}
if (Field14 != 0L) {
output.WriteRawTag(112);
output.WriteInt64(Field14);
}
if (Field15.Length != 0) {
output.WriteRawTag(122);
output.WriteString(Field15);
}
if (Field16 != 0) {
output.WriteRawTag(128, 1);
output.WriteInt32(Field16);
}
if (Field19 != 0) {
output.WriteRawTag(152, 1);
output.WriteInt32(Field19);
}
if (Field20 != false) {
output.WriteRawTag(160, 1);
output.WriteBool(Field20);
}
if (Field21 != 0UL) {
output.WriteRawTag(169, 1);
output.WriteFixed64(Field21);
}
if (Field22 != 0) {
output.WriteRawTag(176, 1);
output.WriteInt32(Field22);
}
if (Field23 != false) {
output.WriteRawTag(184, 1);
output.WriteBool(Field23);
}
if (Field28 != false) {
output.WriteRawTag(224, 1);
output.WriteBool(Field28);
}
if (Field203 != 0) {
output.WriteRawTag(221, 12);
output.WriteFixed32(Field203);
}
if (Field204 != 0) {
output.WriteRawTag(224, 12);
output.WriteInt32(Field204);
}
if (Field205.Length != 0) {
output.WriteRawTag(234, 12);
output.WriteString(Field205);
}
if (Field206 != false) {
output.WriteRawTag(240, 12);
output.WriteBool(Field206);
}
if (Field207 != 0UL) {
output.WriteRawTag(248, 12);
output.WriteUInt64(Field207);
}
if (Field300 != 0UL) {
output.WriteRawTag(224, 18);
output.WriteUInt64(Field300);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -1881,6 +2342,9 @@ namespace Benchmarks.Proto3 {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -1969,8 +2433,103 @@ namespace Benchmarks.Proto3 {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
Field1 = input.ReadInt32();
break;
}
case 16: {
Field2 = input.ReadInt32();
break;
}
case 24: {
Field3 = input.ReadInt32();
break;
}
case 96: {
Field12 = input.ReadBool();
break;
}
case 104: {
Field13 = input.ReadInt64();
break;
}
case 112: {
Field14 = input.ReadInt64();
break;
}
case 122: {
Field15 = input.ReadString();
break;
}
case 128: {
Field16 = input.ReadInt32();
break;
}
case 152: {
Field19 = input.ReadInt32();
break;
}
case 160: {
Field20 = input.ReadBool();
break;
}
case 169: {
Field21 = input.ReadFixed64();
break;
}
case 176: {
Field22 = input.ReadInt32();
break;
}
case 184: {
Field23 = input.ReadBool();
break;
}
case 224: {
Field28 = input.ReadBool();
break;
}
case 1629: {
Field203 = input.ReadFixed32();
break;
}
case 1632: {
Field204 = input.ReadInt32();
break;
}
case 1642: {
Field205 = input.ReadString();
break;
}
case 1648: {
Field206 = input.ReadBool();
break;
}
case 1656: {
Field207 = input.ReadUInt64();
break;
}
case 2400: {
Field300 = input.ReadUInt64();
break;
}
}
}
}
#endif
} }
#endregion #endregion

View File

@ -38,7 +38,11 @@ namespace Benchmarks {
} }
#region Messages #region Messages
public sealed partial class BenchmarkDataset : pb::IMessage<BenchmarkDataset> { public sealed partial class BenchmarkDataset : pb::IMessage<BenchmarkDataset>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<BenchmarkDataset> _parser = new pb::MessageParser<BenchmarkDataset>(() => new BenchmarkDataset()); private static readonly pb::MessageParser<BenchmarkDataset> _parser = new pb::MessageParser<BenchmarkDataset>(() => new BenchmarkDataset());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -172,6 +176,9 @@ namespace Benchmarks {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (Name.Length != 0) { if (Name.Length != 0) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(Name); output.WriteString(Name);
@ -184,8 +191,27 @@ namespace Benchmarks {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (Name.Length != 0) {
output.WriteRawTag(10);
output.WriteString(Name);
}
if (MessageName.Length != 0) {
output.WriteRawTag(18);
output.WriteString(MessageName);
}
payload_.WriteTo(ref output, _repeated_payload_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -219,6 +245,9 @@ namespace Benchmarks {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -239,8 +268,35 @@ namespace Benchmarks {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
Name = input.ReadString();
break;
}
case 18: {
MessageName = input.ReadString();
break;
}
case 26: {
payload_.AddEntriesFrom(ref input, _repeated_payload_codec);
break;
}
}
}
}
#endif
} }
#endregion #endregion

View File

@ -0,0 +1,72 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmarks using ByteString.
/// </summary>
[MemoryDiagnoser]
public class ByteStringBenchmark
{
private const int Zero = 0;
private const int Kilobyte = 1024;
private const int _128Kilobytes = 1024 * 128;
private const int Megabyte = 1024 * 1024;
private const int _10Megabytes = 1024 * 1024 * 10;
byte[] byteBuffer;
[GlobalSetup]
public void GlobalSetup()
{
byteBuffer = new byte[PayloadSize];
}
[Params(Zero, Kilobyte, _128Kilobytes, Megabyte, _10Megabytes)]
public int PayloadSize { get; set; }
[Benchmark]
public ByteString CopyFrom()
{
return ByteString.CopyFrom(byteBuffer);
}
[Benchmark]
public ByteString UnsafeWrap()
{
return UnsafeByteOperations.UnsafeWrap(byteBuffer);
}
}
}

View File

@ -2,12 +2,21 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFramework>netcoreapp2.1</TargetFramework> <TargetFramework>netcoreapp3.1</TargetFramework>
<AssemblyOriginatorKeyFile>../../keys/Google.Protobuf.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<IsPackable>False</IsPackable> <IsPackable>False</IsPackable>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" /> <Compile Include="..\Google.Protobuf.Test\ReadOnlySequenceFactory.cs" Link="ReadOnlySequenceFactory.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" Version="0.12.1" />
<ProjectReference Include="..\Google.Protobuf\Google.Protobuf.csproj" /> <ProjectReference Include="..\Google.Protobuf\Google.Protobuf.csproj" />
</ItemGroup> </ItemGroup>

View File

@ -38,23 +38,27 @@ using System.Linq;
namespace Google.Protobuf.Benchmarks namespace Google.Protobuf.Benchmarks
{ {
/// <summary> /// <summary>
/// Benchmark for serializing (to a MemoryStream) and deserializing (from a ByteString). /// Benchmark for serializing and deserializing of standard datasets that are also
/// measured by benchmarks in other languages.
/// Over time we may wish to test the various different approaches to serialization and deserialization separately. /// Over time we may wish to test the various different approaches to serialization and deserialization separately.
/// See https://github.com/protocolbuffers/protobuf/blob/master/benchmarks/README.md
/// See https://github.com/protocolbuffers/protobuf/blob/master/docs/performance.md
/// </summary> /// </summary>
[MemoryDiagnoser] [MemoryDiagnoser]
public class SerializationBenchmark public class GoogleMessageBenchmark
{ {
/// <summary> /// <summary>
/// All the configurations to be tested. Add more datasets to the array as they're available. /// All the datasets to be tested. Add more datasets to the array as they're available.
/// (When C# supports proto2, this will increase significantly.) /// (When C# supports proto2, this will increase significantly.)
/// </summary> /// </summary>
public static SerializationConfig[] Configurations => new[] public static BenchmarkDatasetConfig[] DatasetConfigurations => new[]
{ {
new SerializationConfig("dataset.google_message1_proto3.pb") // short name is specified to make results table more readable
new BenchmarkDatasetConfig("dataset.google_message1_proto3.pb", "goog_msg1_proto3")
}; };
[ParamsSource(nameof(Configurations))] [ParamsSource(nameof(DatasetConfigurations))]
public SerializationConfig Configuration { get; set; } public BenchmarkDatasetConfig Dataset { get; set; }
private MessageParser parser; private MessageParser parser;
/// <summary> /// <summary>
@ -67,8 +71,8 @@ namespace Google.Protobuf.Benchmarks
[GlobalSetup] [GlobalSetup]
public void GlobalSetup() public void GlobalSetup()
{ {
parser = Configuration.Parser; parser = Dataset.Parser;
subTests = Configuration.Payloads.Select(p => new SubTest(p, parser.ParseFrom(p))).ToList(); subTests = Dataset.Payloads.Select(p => new SubTest(p, parser.ParseFrom(p))).ToList();
} }
[Benchmark] [Benchmark]
@ -78,7 +82,7 @@ namespace Google.Protobuf.Benchmarks
public void ToByteArray() => subTests.ForEach(item => item.ToByteArray()); public void ToByteArray() => subTests.ForEach(item => item.ToByteArray());
[Benchmark] [Benchmark]
public void ParseFromByteString() => subTests.ForEach(item => item.ParseFromByteString(parser)); public void ParseFromByteArray() => subTests.ForEach(item => item.ParseFromByteArray(parser));
[Benchmark] [Benchmark]
public void ParseFromStream() => subTests.ForEach(item => item.ParseFromStream(parser)); public void ParseFromStream() => subTests.ForEach(item => item.ParseFromStream(parser));
@ -87,13 +91,13 @@ namespace Google.Protobuf.Benchmarks
{ {
private readonly Stream destinationStream; private readonly Stream destinationStream;
private readonly Stream sourceStream; private readonly Stream sourceStream;
private readonly ByteString data; private readonly byte[] data;
private readonly IMessage message; private readonly IMessage message;
public SubTest(ByteString data, IMessage message) public SubTest(byte[] data, IMessage message)
{ {
destinationStream = new MemoryStream(data.Length); destinationStream = new MemoryStream(data.Length);
sourceStream = new MemoryStream(data.ToByteArray()); sourceStream = new MemoryStream(data);
this.data = data; this.data = data;
this.message = message; this.message = message;
} }
@ -108,7 +112,7 @@ namespace Google.Protobuf.Benchmarks
public void ToByteArray() => message.ToByteArray(); public void ToByteArray() => message.ToByteArray();
public void ParseFromByteString(MessageParser parser) => parser.ParseFrom(data); public void ParseFromByteArray(MessageParser parser) => parser.ParseFrom(data);
public void ParseFromStream(MessageParser parser) public void ParseFromStream(MessageParser parser)
{ {

View File

@ -0,0 +1,258 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Buffers;
using Google.Protobuf.WellKnownTypes;
using Benchmarks.Proto3;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmark that tests parsing performance for various messages.
/// </summary>
[MemoryDiagnoser]
public class ParseMessagesBenchmark
{
const int MaxMessages = 100;
SubTest manyWrapperFieldsTest = new SubTest(CreateManyWrapperFieldsMessage(), ManyWrapperFieldsMessage.Parser, () => new ManyWrapperFieldsMessage(), MaxMessages);
SubTest manyPrimitiveFieldsTest = new SubTest(CreateManyPrimitiveFieldsMessage(), ManyPrimitiveFieldsMessage.Parser, () => new ManyPrimitiveFieldsMessage(), MaxMessages);
SubTest repeatedFieldTest = new SubTest(CreateRepeatedFieldMessage(), GoogleMessage1.Parser, () => new GoogleMessage1(), MaxMessages);
SubTest emptyMessageTest = new SubTest(new Empty(), Empty.Parser, () => new Empty(), MaxMessages);
public IEnumerable<int> MessageCountValues => new[] { 10, 100 };
[GlobalSetup]
public void GlobalSetup()
{
}
[Benchmark]
public IMessage ManyWrapperFieldsMessage_ParseFromByteArray()
{
return manyWrapperFieldsTest.ParseFromByteArray();
}
[Benchmark]
public IMessage ManyWrapperFieldsMessage_ParseFromReadOnlySequence()
{
return manyWrapperFieldsTest.ParseFromReadOnlySequence();
}
[Benchmark]
public IMessage ManyPrimitiveFieldsMessage_ParseFromByteArray()
{
return manyPrimitiveFieldsTest.ParseFromByteArray();
}
[Benchmark]
public IMessage ManyPrimitiveFieldsMessage_ParseFromReadOnlySequence()
{
return manyPrimitiveFieldsTest.ParseFromReadOnlySequence();
}
[Benchmark]
public IMessage RepeatedFieldMessage_ParseFromByteArray()
{
return repeatedFieldTest.ParseFromByteArray();
}
[Benchmark]
public IMessage RepeatedFieldMessage_ParseFromReadOnlySequence()
{
return repeatedFieldTest.ParseFromReadOnlySequence();
}
[Benchmark]
public IMessage EmptyMessage_ParseFromByteArray()
{
return emptyMessageTest.ParseFromByteArray();
}
[Benchmark]
public IMessage EmptyMessage_ParseFromReadOnlySequence()
{
return emptyMessageTest.ParseFromReadOnlySequence();
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount)
{
manyWrapperFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyWrapperFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
{
manyWrapperFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromByteArray(int messageCount)
{
manyPrimitiveFieldsTest.ParseDelimitedMessagesFromByteArray(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyPrimitiveFieldsMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
{
manyPrimitiveFieldsTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void RepeatedFieldMessage_ParseDelimitedMessagesFromByteArray(int messageCount)
{
repeatedFieldTest.ParseDelimitedMessagesFromByteArray(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void RepeatedFieldMessage_ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
{
repeatedFieldTest.ParseDelimitedMessagesFromReadOnlySequence(messageCount);
}
public static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage()
{
// Example data match data of an internal benchmarks
return new ManyWrapperFieldsMessage()
{
Int64Field19 = 123,
Int64Field37 = 1000032,
Int64Field26 = 3453524500,
DoubleField79 = 1.2,
DoubleField25 = 234,
DoubleField9 = 123.3,
DoubleField28 = 23,
DoubleField7 = 234,
DoubleField50 = 2.45
};
}
public static ManyPrimitiveFieldsMessage CreateManyPrimitiveFieldsMessage()
{
// Example data match data of an internal benchmarks
return new ManyPrimitiveFieldsMessage()
{
Int64Field19 = 123,
Int64Field37 = 1000032,
Int64Field26 = 3453524500,
DoubleField79 = 1.2,
DoubleField25 = 234,
DoubleField9 = 123.3,
DoubleField28 = 23,
DoubleField7 = 234,
DoubleField50 = 2.45
};
}
public static GoogleMessage1 CreateRepeatedFieldMessage()
{
// Message with a repeated fixed length item collection
var message = new GoogleMessage1();
for (ulong i = 0; i < 1000; i++)
{
message.Field5.Add(i);
}
return message;
}
private class SubTest
{
private readonly IMessage message;
private readonly MessageParser parser;
private readonly Func<IMessage> factory;
private readonly byte[] data;
private readonly byte[] multipleMessagesData;
private ReadOnlySequence<byte> dataSequence;
private ReadOnlySequence<byte> multipleMessagesDataSequence;
public SubTest(IMessage message, MessageParser parser, Func<IMessage> factory, int maxMessageCount)
{
this.message = message;
this.parser = parser;
this.factory = factory;
this.data = message.ToByteArray();
this.multipleMessagesData = CreateBufferWithMultipleMessages(message, maxMessageCount);
this.dataSequence = new ReadOnlySequence<byte>(this.data);
this.multipleMessagesDataSequence = new ReadOnlySequence<byte>(this.multipleMessagesData);
}
public IMessage ParseFromByteArray() => parser.ParseFrom(data);
public IMessage ParseFromReadOnlySequence() => parser.ParseFrom(dataSequence);
public void ParseDelimitedMessagesFromByteArray(int messageCount)
{
var input = new CodedInputStream(multipleMessagesData);
for (int i = 0; i < messageCount; i++)
{
var msg = factory();
input.ReadMessage(msg);
}
}
public void ParseDelimitedMessagesFromReadOnlySequence(int messageCount)
{
ParseContext.Initialize(multipleMessagesDataSequence, out ParseContext ctx);
for (int i = 0; i < messageCount; i++)
{
var msg = factory();
ctx.ReadMessage(msg);
}
}
private static byte[] CreateBufferWithMultipleMessages(IMessage msg, int msgCount)
{
var ms = new MemoryStream();
var cos = new CodedOutputStream(ms);
for (int i = 0; i < msgCount; i++)
{
cos.WriteMessage(msg);
}
cos.Flush();
return ms.ToArray();
}
}
}
}

View File

@ -0,0 +1,536 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.IO;
using System.Buffers;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmarks throughput when parsing raw primitives.
/// </summary>
[MemoryDiagnoser]
public class ParseRawPrimitivesBenchmark
{
// key is the encodedSize of varint values
Dictionary<int, byte[]> varintInputBuffers;
byte[] doubleInputBuffer;
byte[] floatInputBuffer;
byte[] fixedIntInputBuffer;
// key is the encodedSize of string values
Dictionary<int, byte[]> stringInputBuffers;
Dictionary<int, ReadOnlySequence<byte>> stringInputBuffersSegmented;
Random random = new Random(417384220); // random but deterministic seed
public IEnumerable<int> StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 };
public IEnumerable<int> StringSegmentedEncodedSizes => new[] { 105, 10080 };
[GlobalSetup]
public void GlobalSetup()
{
// add some extra values that we won't read just to make sure we are far enough from the end of the buffer
// which allows the parser fastpath to always kick in.
const int paddingValueCount = 100;
varintInputBuffers = new Dictionary<int, byte[]>();
for (int encodedSize = 1; encodedSize <= 10; encodedSize++)
{
byte[] buffer = CreateBufferWithRandomVarints(random, BytesToParse / encodedSize, encodedSize, paddingValueCount);
varintInputBuffers.Add(encodedSize, buffer);
}
doubleInputBuffer = CreateBufferWithRandomDoubles(random, BytesToParse / sizeof(double), paddingValueCount);
floatInputBuffer = CreateBufferWithRandomFloats(random, BytesToParse / sizeof(float), paddingValueCount);
fixedIntInputBuffer = CreateBufferWithRandomData(random, BytesToParse / sizeof(long), sizeof(long), paddingValueCount);
stringInputBuffers = new Dictionary<int, byte[]>();
foreach (var encodedSize in StringEncodedSizes)
{
byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1 );
stringInputBuffers.Add(encodedSize, buffer);
}
stringInputBuffersSegmented = new Dictionary<int, ReadOnlySequence<byte>>();
foreach (var encodedSize in StringSegmentedEncodedSizes)
{
byte[] buffer = CreateBufferWithStrings(BytesToParse / encodedSize, encodedSize, encodedSize < 10 ? 10 : 1);
stringInputBuffersSegmented.Add(encodedSize, ReadOnlySequenceFactory.CreateWithContent(buffer, segmentSize: 128, addEmptySegmentDelimiters: false));
}
}
// Total number of bytes that each benchmark will parse.
// Measuring the time taken to parse buffer of given size makes it easier to compare parsing speed for different
// types and makes it easy to calculate the througput (in MB/s)
// 10800 bytes is chosen because it is divisible by all possible encoded sizes for all primitive types {1..10}
[Params(10080)]
public int BytesToParse { get; set; }
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
public int ParseRawVarint32_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadInt32();
}
return sum;
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
public int ParseRawVarint32_ParseContext(int encodedSize)
{
InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadInt32();
}
return sum;
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
[Arguments(6)]
[Arguments(7)]
[Arguments(8)]
[Arguments(9)]
[Arguments(10)]
public long ParseRawVarint64_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(varintInputBuffers[encodedSize]);
long sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadInt64();
}
return sum;
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
[Arguments(6)]
[Arguments(7)]
[Arguments(8)]
[Arguments(9)]
[Arguments(10)]
public long ParseRawVarint64_ParseContext(int encodedSize)
{
InitializeParseContext(varintInputBuffers[encodedSize], out ParseContext ctx);
long sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadInt64();
}
return sum;
}
[Benchmark]
public uint ParseFixed32_CodedInputStream()
{
const int encodedSize = sizeof(uint);
CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer);
uint sum = 0;
for (uint i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadFixed32();
}
return sum;
}
[Benchmark]
public uint ParseFixed32_ParseContext()
{
const int encodedSize = sizeof(uint);
InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx);
uint sum = 0;
for (uint i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadFixed32();
}
return sum;
}
[Benchmark]
public ulong ParseFixed64_CodedInputStream()
{
const int encodedSize = sizeof(ulong);
CodedInputStream cis = new CodedInputStream(fixedIntInputBuffer);
ulong sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadFixed64();
}
return sum;
}
[Benchmark]
public ulong ParseFixed64_ParseContext()
{
const int encodedSize = sizeof(ulong);
InitializeParseContext(fixedIntInputBuffer, out ParseContext ctx);
ulong sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadFixed64();
}
return sum;
}
[Benchmark]
public float ParseRawFloat_CodedInputStream()
{
const int encodedSize = sizeof(float);
CodedInputStream cis = new CodedInputStream(floatInputBuffer);
float sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadFloat();
}
return sum;
}
[Benchmark]
public float ParseRawFloat_ParseContext()
{
const int encodedSize = sizeof(float);
InitializeParseContext(floatInputBuffer, out ParseContext ctx);
float sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadFloat();
}
return sum;
}
[Benchmark]
public double ParseRawDouble_CodedInputStream()
{
const int encodedSize = sizeof(double);
CodedInputStream cis = new CodedInputStream(doubleInputBuffer);
double sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadDouble();
}
return sum;
}
[Benchmark]
public double ParseRawDouble_ParseContext()
{
const int encodedSize = sizeof(double);
InitializeParseContext(doubleInputBuffer, out ParseContext ctx);
double sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadDouble();
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public int ParseString_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadString().Length;
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public int ParseString_ParseContext(int encodedSize)
{
InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadString().Length;
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringSegmentedEncodedSizes))]
public int ParseString_ParseContext_MultipleSegments(int encodedSize)
{
InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadString().Length;
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public int ParseBytes_CodedInputStream(int encodedSize)
{
CodedInputStream cis = new CodedInputStream(stringInputBuffers[encodedSize]);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += cis.ReadBytes().Length;
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public int ParseBytes_ParseContext(int encodedSize)
{
InitializeParseContext(stringInputBuffers[encodedSize], out ParseContext ctx);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadBytes().Length;
}
return sum;
}
[Benchmark]
[ArgumentsSource(nameof(StringSegmentedEncodedSizes))]
public int ParseBytes_ParseContext_MultipleSegments(int encodedSize)
{
InitializeParseContext(stringInputBuffersSegmented[encodedSize], out ParseContext ctx);
int sum = 0;
for (int i = 0; i < BytesToParse / encodedSize; i++)
{
sum += ctx.ReadBytes().Length;
}
return sum;
}
private static void InitializeParseContext(byte[] buffer, out ParseContext ctx)
{
ParseContext.Initialize(new ReadOnlySequence<byte>(buffer), out ctx);
}
private static void InitializeParseContext(ReadOnlySequence<byte> buffer, out ParseContext ctx)
{
ParseContext.Initialize(buffer, out ctx);
}
private static byte[] CreateBufferWithRandomVarints(Random random, int valueCount, int encodedSize, int paddingValueCount)
{
MemoryStream ms = new MemoryStream();
CodedOutputStream cos = new CodedOutputStream(ms);
for (int i = 0; i < valueCount + paddingValueCount; i++)
{
cos.WriteUInt64(RandomUnsignedVarint(random, encodedSize, false));
}
cos.Flush();
var buffer = ms.ToArray();
if (buffer.Length != encodedSize * (valueCount + paddingValueCount))
{
throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}");
}
return buffer;
}
private static byte[] CreateBufferWithRandomFloats(Random random, int valueCount, int paddingValueCount)
{
MemoryStream ms = new MemoryStream();
CodedOutputStream cos = new CodedOutputStream(ms);
for (int i = 0; i < valueCount + paddingValueCount; i++)
{
cos.WriteFloat((float)random.NextDouble());
}
cos.Flush();
var buffer = ms.ToArray();
return buffer;
}
private static byte[] CreateBufferWithRandomDoubles(Random random, int valueCount, int paddingValueCount)
{
MemoryStream ms = new MemoryStream();
CodedOutputStream cos = new CodedOutputStream(ms);
for (int i = 0; i < valueCount + paddingValueCount; i++)
{
cos.WriteDouble(random.NextDouble());
}
cos.Flush();
var buffer = ms.ToArray();
return buffer;
}
private static byte[] CreateBufferWithRandomData(Random random, int valueCount, int encodedSize, int paddingValueCount)
{
int bufferSize = (valueCount + paddingValueCount) * encodedSize;
byte[] buffer = new byte[bufferSize];
random.NextBytes(buffer);
return buffer;
}
/// <summary>
/// Generate a random value that will take exactly "encodedSize" bytes when varint-encoded.
/// </summary>
public static ulong RandomUnsignedVarint(Random random, int encodedSize, bool fitsIn32Bits)
{
Span<byte> randomBytesBuffer = stackalloc byte[8];
if (encodedSize < 1 || encodedSize > 10 || (fitsIn32Bits && encodedSize > 5))
{
throw new ArgumentException("Illegal encodedSize value requested", nameof(encodedSize));
}
const int bitsPerByte = 7;
ulong result = 0;
while (true)
{
random.NextBytes(randomBytesBuffer);
ulong randomValue = BinaryPrimitives.ReadUInt64LittleEndian(randomBytesBuffer);
// only use the number of random bits we need
ulong bitmask = encodedSize < 10 ? ((1UL << (encodedSize * bitsPerByte)) - 1) : ulong.MaxValue;
result = randomValue & bitmask;
if (fitsIn32Bits)
{
// make sure the resulting value is representable by a uint.
result &= uint.MaxValue;
}
if (encodedSize == 10)
{
// for 10-byte values the highest bit always needs to be set (7*9=63)
result |= ulong.MaxValue;
break;
}
// some random values won't require the full "encodedSize" bytes, check that at least
// one of the top 7 bits is set. Retrying is fine since it only happens rarely
if (encodedSize == 1 || (result & (0x7FUL << ((encodedSize - 1) * bitsPerByte))) != 0)
{
break;
}
}
return result;
}
private static byte[] CreateBufferWithStrings(int valueCount, int encodedSize, int paddingValueCount)
{
var str = CreateStringWithEncodedSize(encodedSize);
MemoryStream ms = new MemoryStream();
CodedOutputStream cos = new CodedOutputStream(ms);
for (int i = 0; i < valueCount + paddingValueCount; i++)
{
cos.WriteString(str);
}
cos.Flush();
var buffer = ms.ToArray();
if (buffer.Length != encodedSize * (valueCount + paddingValueCount))
{
throw new InvalidOperationException($"Unexpected output buffer length {buffer.Length}");
}
return buffer;
}
public static string CreateStringWithEncodedSize(int encodedSize)
{
var str = new string('a', encodedSize);
while (CodedOutputStream.ComputeStringSize(str) > encodedSize)
{
str = str.Substring(1);
}
if (CodedOutputStream.ComputeStringSize(str) != encodedSize)
{
throw new InvalidOperationException($"Generated string with wrong encodedSize");
}
return str;
}
public static string CreateNonAsciiStringWithEncodedSize(int encodedSize)
{
if (encodedSize < 3)
{
throw new ArgumentException("Illegal encoded size for a string with non-ascii chars.");
}
var twoByteChar = '\u00DC'; // U-umlaut, UTF8 encoding has 2 bytes
var str = new string(twoByteChar, encodedSize / 2);
while (CodedOutputStream.ComputeStringSize(str) > encodedSize)
{
str = str.Substring(1);
}
// add padding of ascii characters to reach the desired encoded size.
while (CodedOutputStream.ComputeStringSize(str) < encodedSize)
{
str += 'a';
}
// Note that for a few specific encodedSize values, it might be impossible to generate
// the string with the desired encodedSize using the algorithm above. For testing purposes, checking that
// the encoded size we got is actually correct is good enough.
if (CodedOutputStream.ComputeStringSize(str) != encodedSize)
{
throw new InvalidOperationException($"Generated string with wrong encodedSize");
}
return str;
}
}
}

View File

@ -1,102 +0,0 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
using System.Collections.Generic;
using System.IO;
using System.Linq;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmark that tests serialization/deserialization of wrapper fields.
/// </summary>
[MemoryDiagnoser]
public class WrapperBenchmark
{
byte[] manyWrapperFieldsData;
byte[] manyPrimitiveFieldsData;
[GlobalSetup]
public void GlobalSetup()
{
manyWrapperFieldsData = CreateManyWrapperFieldsMessage().ToByteArray();
manyPrimitiveFieldsData = CreateManyPrimitiveFieldsMessage().ToByteArray();
}
[Benchmark]
public ManyWrapperFieldsMessage ParseWrapperFields()
{
return ManyWrapperFieldsMessage.Parser.ParseFrom(manyWrapperFieldsData);
}
[Benchmark]
public ManyPrimitiveFieldsMessage ParsePrimitiveFields()
{
return ManyPrimitiveFieldsMessage.Parser.ParseFrom(manyPrimitiveFieldsData);
}
private static ManyWrapperFieldsMessage CreateManyWrapperFieldsMessage()
{
// Example data match data of an internal benchmarks
return new ManyWrapperFieldsMessage()
{
Int64Field19 = 123,
Int64Field37 = 1000032,
Int64Field26 = 3453524500,
DoubleField79 = 1.2,
DoubleField25 = 234,
DoubleField9 = 123.3,
DoubleField28 = 23,
DoubleField7 = 234,
DoubleField50 = 2.45
};
}
private static ManyPrimitiveFieldsMessage CreateManyPrimitiveFieldsMessage()
{
// Example data match data of an internal benchmarks
return new ManyPrimitiveFieldsMessage()
{
Int64Field19 = 123,
Int64Field37 = 1000032,
Int64Field26 = 3453524500,
DoubleField79 = 1.2,
DoubleField25 = 234,
DoubleField9 = 123.3,
DoubleField28 = 23,
DoubleField7 = 234,
DoubleField50 = 2.45
};
}
}
}

View File

@ -0,0 +1,198 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Buffers;
using Google.Protobuf.WellKnownTypes;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmark that tests writing performance for various messages.
/// </summary>
[MemoryDiagnoser]
public class WriteMessagesBenchmark
{
const int MaxMessages = 100;
SubTest manyWrapperFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyWrapperFieldsMessage(), MaxMessages);
SubTest manyPrimitiveFieldsTest = new SubTest(ParseMessagesBenchmark.CreateManyPrimitiveFieldsMessage(), MaxMessages);
SubTest emptyMessageTest = new SubTest(new Empty(), MaxMessages);
public IEnumerable<int> MessageCountValues => new[] { 10, 100 };
[GlobalSetup]
public void GlobalSetup()
{
}
[Benchmark]
public byte[] ManyWrapperFieldsMessage_ToByteArray()
{
return manyWrapperFieldsTest.ToByteArray();
}
[Benchmark]
public byte[] ManyWrapperFieldsMessage_WriteToCodedOutputStream()
{
return manyWrapperFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer();
}
[Benchmark]
public byte[] ManyWrapperFieldsMessage_WriteToSpan()
{
return manyWrapperFieldsTest.WriteToSpan_PreAllocatedBuffer();
}
[Benchmark]
public byte[] ManyPrimitiveFieldsMessage_ToByteArray()
{
return manyPrimitiveFieldsTest.ToByteArray();
}
[Benchmark]
public byte[] ManyPrimitiveFieldsMessage_WriteToCodedOutputStream()
{
return manyPrimitiveFieldsTest.WriteToCodedOutputStream_PreAllocatedBuffer();
}
[Benchmark]
public byte[] ManyPrimitiveFieldsMessage_WriteToSpan()
{
return manyPrimitiveFieldsTest.WriteToSpan_PreAllocatedBuffer();
}
[Benchmark]
public byte[] EmptyMessage_ToByteArray()
{
return emptyMessageTest.ToByteArray();
}
[Benchmark]
public byte[] EmptyMessage_WriteToCodedOutputStream()
{
return emptyMessageTest.WriteToCodedOutputStream_PreAllocatedBuffer();
}
[Benchmark]
public byte[] EmptyMessage_WriteToSpan()
{
return emptyMessageTest.WriteToSpan_PreAllocatedBuffer();
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount)
{
manyWrapperFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyWrapperFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount)
{
manyWrapperFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToCodedOutputStream(int messageCount)
{
manyPrimitiveFieldsTest.WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(messageCount);
}
[Benchmark]
[ArgumentsSource(nameof(MessageCountValues))]
public void ManyPrimitiveFieldsMessage_WriteDelimitedMessagesToSpan(int messageCount)
{
manyPrimitiveFieldsTest.WriteDelimitedMessagesToSpan_PreAllocatedBuffer(messageCount);
}
private class SubTest
{
private readonly IMessage message;
private readonly byte[] outputBuffer;
private readonly byte[] multipleMessagesOutputBuffer;
public SubTest(IMessage message, int maxMessageCount)
{
this.message = message;
int messageSize = message.CalculateSize();
this.outputBuffer = new byte[messageSize];
this.multipleMessagesOutputBuffer = new byte[maxMessageCount * (messageSize + CodedOutputStream.ComputeLengthSize(messageSize))];
}
public byte[] ToByteArray() => message.ToByteArray();
public byte[] WriteToCodedOutputStream_PreAllocatedBuffer()
{
var cos = new CodedOutputStream(outputBuffer); // use pre-existing output buffer
message.WriteTo(cos);
return outputBuffer;
}
public byte[] WriteToSpan_PreAllocatedBuffer()
{
var span = new Span<byte>(outputBuffer); // use pre-existing output buffer
message.WriteTo(span);
return outputBuffer;
}
public byte[] WriteDelimitedMessagesToCodedOutputStream_PreAllocatedBuffer(int messageCount)
{
var cos = new CodedOutputStream(multipleMessagesOutputBuffer); // use pre-existing output buffer
for (int i = 0; i < messageCount; i++)
{
cos.WriteMessage(message);
}
return multipleMessagesOutputBuffer;
}
public byte[] WriteDelimitedMessagesToSpan_PreAllocatedBuffer(int messageCount)
{
var span = new Span<byte>(multipleMessagesOutputBuffer); // use pre-existing output buffer
WriteContext.Initialize(ref span, out WriteContext ctx);
for (int i = 0; i < messageCount; i++)
{
ctx.WriteMessage(message);
}
return multipleMessagesOutputBuffer;
}
}
}
}

View File

@ -0,0 +1,519 @@
#region Copyright notice and license
// Protocol Buffers - Google's data interchange format
// Copyright 2019 Google Inc. All rights reserved.
// https://github.com/protocolbuffers/protobuf
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are
// met:
//
// * Redistributions of source code must retain the above copyright
// notice, this list of conditions and the following disclaimer.
// * Redistributions in binary form must reproduce the above
// copyright notice, this list of conditions and the following disclaimer
// in the documentation and/or other materials provided with the
// distribution.
// * Neither the name of Google Inc. nor the names of its
// contributors may be used to endorse or promote products derived from
// this software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
// "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
// LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
// A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
// OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
// LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
// DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
// THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#endregion
using BenchmarkDotNet.Attributes;
using System;
using System.Buffers.Binary;
using System.Collections.Generic;
using System.IO;
using System.Buffers;
using System.Text;
namespace Google.Protobuf.Benchmarks
{
/// <summary>
/// Benchmarks throughput when writing raw primitives.
/// </summary>
[MemoryDiagnoser]
public class WriteRawPrimitivesBenchmark
{
// key is the encodedSize of varint values
Dictionary<int, uint[]> varint32Values;
Dictionary<int, ulong[]> varint64Values;
double[] doubleValues;
float[] floatValues;
// key is the encodedSize of string values
Dictionary<int, string[]> stringValues;
// key is the encodedSize of string values
Dictionary<int, string[]> nonAsciiStringValues;
// key is the encodedSize of string values
Dictionary<int, ByteString[]> byteStringValues;
// the buffer to which all the data will be written
byte[] outputBuffer;
Random random = new Random(417384220); // random but deterministic seed
public IEnumerable<int> StringEncodedSizes => new[] { 1, 4, 10, 105, 10080 };
public IEnumerable<int> NonAsciiStringEncodedSizes => new[] { 4, 10, 105, 10080 };
[GlobalSetup]
public void GlobalSetup()
{
outputBuffer = new byte[BytesToWrite];
varint32Values = new Dictionary<int, uint[]>();
varint64Values = new Dictionary<int, ulong[]>();
for (int encodedSize = 1; encodedSize <= 10; encodedSize++)
{
if (encodedSize <= 5)
{
varint32Values.Add(encodedSize, CreateRandomVarints32(random, BytesToWrite / encodedSize, encodedSize));
}
varint64Values.Add(encodedSize, CreateRandomVarints64(random, BytesToWrite / encodedSize, encodedSize));
}
doubleValues = CreateRandomDoubles(random, BytesToWrite / sizeof(double));
floatValues = CreateRandomFloats(random, BytesToWrite / sizeof(float));
stringValues = new Dictionary<int, string[]>();
byteStringValues = new Dictionary<int, ByteString[]>();
foreach(var encodedSize in StringEncodedSizes)
{
stringValues.Add(encodedSize, CreateStrings(BytesToWrite / encodedSize, encodedSize));
byteStringValues.Add(encodedSize, CreateByteStrings(BytesToWrite / encodedSize, encodedSize));
}
nonAsciiStringValues = new Dictionary<int, string[]>();
foreach(var encodedSize in NonAsciiStringEncodedSizes)
{
nonAsciiStringValues.Add(encodedSize, CreateNonAsciiStrings(BytesToWrite / encodedSize, encodedSize));
}
}
// Total number of bytes that each benchmark will write.
// Measuring the time taken to write buffer of given size makes it easier to compare parsing speed for different
// types and makes it easy to calculate the througput (in MB/s)
// 10800 bytes is chosen because it is divisible by all possible encoded sizes for all primitive types {1..10}
[Params(10080)]
public int BytesToWrite { get; set; }
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
public void WriteRawVarint32_CodedOutputStream(int encodedSize)
{
var values = varint32Values[encodedSize];
var cos = new CodedOutputStream(outputBuffer);
for (int i = 0; i < values.Length; i++)
{
cos.WriteRawVarint32(values[i]);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
public void WriteRawVarint32_WriteContext(int encodedSize)
{
var values = varint32Values[encodedSize];
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (int i = 0; i < values.Length; i++)
{
ctx.WriteUInt32(values[i]);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
[Arguments(6)]
[Arguments(7)]
[Arguments(8)]
[Arguments(9)]
[Arguments(10)]
public void WriteRawVarint64_CodedOutputStream(int encodedSize)
{
var values = varint64Values[encodedSize];
var cos = new CodedOutputStream(outputBuffer);
for (int i = 0; i < values.Length; i++)
{
cos.WriteRawVarint64(values[i]);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
[Arguments(1)]
[Arguments(2)]
[Arguments(3)]
[Arguments(4)]
[Arguments(5)]
[Arguments(6)]
[Arguments(7)]
[Arguments(8)]
[Arguments(9)]
[Arguments(10)]
public void WriteRawVarint64_WriteContext(int encodedSize)
{
var values = varint64Values[encodedSize];
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (int i = 0; i < values.Length; i++)
{
ctx.WriteUInt64(values[i]);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteFixed32_CodedOutputStream()
{
const int encodedSize = sizeof(uint);
var cos = new CodedOutputStream(outputBuffer);
for (int i = 0; i < BytesToWrite / encodedSize; i++)
{
cos.WriteFixed32(12345);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteFixed32_WriteContext()
{
const int encodedSize = sizeof(uint);
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (uint i = 0; i < BytesToWrite / encodedSize; i++)
{
ctx.WriteFixed32(12345);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteFixed64_CodedOutputStream()
{
const int encodedSize = sizeof(ulong);
var cos = new CodedOutputStream(outputBuffer);
for(int i = 0; i < BytesToWrite / encodedSize; i++)
{
cos.WriteFixed64(123456789);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteFixed64_WriteContext()
{
const int encodedSize = sizeof(ulong);
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (uint i = 0; i < BytesToWrite / encodedSize; i++)
{
ctx.WriteFixed64(123456789);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawTag_OneByte_WriteContext()
{
const int encodedSize = 1;
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (uint i = 0; i < BytesToWrite / encodedSize; i++)
{
ctx.WriteRawTag(16);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawTag_TwoBytes_WriteContext()
{
const int encodedSize = 2;
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (uint i = 0; i < BytesToWrite / encodedSize; i++)
{
ctx.WriteRawTag(137, 6);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawTag_ThreeBytes_WriteContext()
{
const int encodedSize = 3;
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
for (uint i = 0; i < BytesToWrite / encodedSize; i++)
{
ctx.WriteRawTag(160, 131, 1);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void Baseline_WriteContext()
{
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
ctx.state.position = outputBuffer.Length;
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawFloat_CodedOutputStream()
{
var cos = new CodedOutputStream(outputBuffer);
foreach (var value in floatValues)
{
cos.WriteFloat(value);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawFloat_WriteContext()
{
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
foreach (var value in floatValues)
{
ctx.WriteFloat(value);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawDouble_CodedOutputStream()
{
var cos = new CodedOutputStream(outputBuffer);
foreach (var value in doubleValues)
{
cos.WriteDouble(value);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
public void WriteRawDouble_WriteContext()
{
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
foreach (var value in doubleValues)
{
ctx.WriteDouble(value);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public void WriteString_CodedOutputStream(int encodedSize)
{
var values = stringValues[encodedSize];
var cos = new CodedOutputStream(outputBuffer);
foreach (var value in values)
{
cos.WriteString(value);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public void WriteString_WriteContext(int encodedSize)
{
var values = stringValues[encodedSize];
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
foreach (var value in values)
{
ctx.WriteString(value);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(NonAsciiStringEncodedSizes))]
public void WriteNonAsciiString_CodedOutputStream(int encodedSize)
{
var values = nonAsciiStringValues[encodedSize];
var cos = new CodedOutputStream(outputBuffer);
foreach (var value in values)
{
cos.WriteString(value);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(NonAsciiStringEncodedSizes))]
public void WriteNonAsciiString_WriteContext(int encodedSize)
{
var values = nonAsciiStringValues[encodedSize];
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
foreach (var value in values)
{
ctx.WriteString(value);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public void WriteBytes_CodedOutputStream(int encodedSize)
{
var values = byteStringValues[encodedSize];
var cos = new CodedOutputStream(outputBuffer);
foreach (var value in values)
{
cos.WriteBytes(value);
}
cos.Flush();
cos.CheckNoSpaceLeft();
}
[Benchmark]
[ArgumentsSource(nameof(StringEncodedSizes))]
public void WriteBytes_WriteContext(int encodedSize)
{
var values = byteStringValues[encodedSize];
var span = new Span<byte>(outputBuffer);
WriteContext.Initialize(ref span, out WriteContext ctx);
foreach (var value in values)
{
ctx.WriteBytes(value);
}
ctx.Flush();
ctx.CheckNoSpaceLeft();
}
private static uint[] CreateRandomVarints32(Random random, int valueCount, int encodedSize)
{
var result = new uint[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = (uint) ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, true);
}
return result;
}
private static ulong[] CreateRandomVarints64(Random random, int valueCount, int encodedSize)
{
var result = new ulong[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = ParseRawPrimitivesBenchmark.RandomUnsignedVarint(random, encodedSize, false);
}
return result;
}
private static float[] CreateRandomFloats(Random random, int valueCount)
{
var result = new float[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = (float)random.NextDouble();
}
return result;
}
private static double[] CreateRandomDoubles(Random random, int valueCount)
{
var result = new double[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = random.NextDouble();
}
return result;
}
private static string[] CreateStrings(int valueCount, int encodedSize)
{
var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize);
var result = new string[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = str;
}
return result;
}
private static string[] CreateNonAsciiStrings(int valueCount, int encodedSize)
{
var str = ParseRawPrimitivesBenchmark.CreateNonAsciiStringWithEncodedSize(encodedSize);
var result = new string[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = str;
}
return result;
}
private static ByteString[] CreateByteStrings(int valueCount, int encodedSize)
{
var str = ParseRawPrimitivesBenchmark.CreateStringWithEncodedSize(encodedSize);
var result = new ByteString[valueCount];
for (int i = 0; i < valueCount; i++)
{
result[i] = ByteString.CopyFrom(Encoding.UTF8.GetBytes(str));
}
return result;
}
}
}

View File

@ -82,7 +82,7 @@ namespace Conformance {
[pbr::OriginalName("JSON_TEST")] JsonTest = 2, [pbr::OriginalName("JSON_TEST")] JsonTest = 2,
/// <summary> /// <summary>
/// Similar to JSON_TEST. However, during parsing json, testee should ignore /// Similar to JSON_TEST. However, during parsing json, testee should ignore
/// unknown fields. This feature is optional. Each implementation can descide /// unknown fields. This feature is optional. Each implementation can decide
/// whether to support it. See /// whether to support it. See
/// https://developers.google.com/protocol-buffers/docs/proto3#json_options /// https://developers.google.com/protocol-buffers/docs/proto3#json_options
/// for more detail. /// for more detail.
@ -107,7 +107,11 @@ namespace Conformance {
/// This will be known by message_type == "conformance.FailureSet", a conformance /// This will be known by message_type == "conformance.FailureSet", a conformance
/// test should return a serialized FailureSet in protobuf_payload. /// test should return a serialized FailureSet in protobuf_payload.
/// </summary> /// </summary>
public sealed partial class FailureSet : pb::IMessage<FailureSet> { public sealed partial class FailureSet : pb::IMessage<FailureSet>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<FailureSet> _parser = new pb::MessageParser<FailureSet>(() => new FailureSet()); private static readonly pb::MessageParser<FailureSet> _parser = new pb::MessageParser<FailureSet>(() => new FailureSet());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -185,12 +189,26 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
failure_.WriteTo(output, _repeated_failure_codec); failure_.WriteTo(output, _repeated_failure_codec);
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
failure_.WriteTo(ref output, _repeated_failure_codec);
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -212,6 +230,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -224,8 +245,27 @@ namespace Conformance {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
failure_.AddEntriesFrom(ref input, _repeated_failure_codec);
break;
}
}
}
}
#endif
} }
/// <summary> /// <summary>
@ -235,7 +275,11 @@ namespace Conformance {
/// 2. parse the protobuf or JSON payload in "payload" (which may fail) /// 2. parse the protobuf or JSON payload in "payload" (which may fail)
/// 3. if the parse succeeded, serialize the message in the requested format. /// 3. if the parse succeeded, serialize the message in the requested format.
/// </summary> /// </summary>
public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest> { public sealed partial class ConformanceRequest : pb::IMessage<ConformanceRequest>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest()); private static readonly pb::MessageParser<ConformanceRequest> _parser = new pb::MessageParser<ConformanceRequest>(() => new ConformanceRequest());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -370,7 +414,7 @@ namespace Conformance {
private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest; private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest;
/// <summary> /// <summary>
/// Each test is given a specific test category. Some category may need /// Each test is given a specific test category. Some category may need
/// spedific support in testee programs. Refer to the definition of TestCategory /// specific support in testee programs. Refer to the definition of TestCategory
/// for more information. /// for more information.
/// </summary> /// </summary>
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -483,6 +527,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (payloadCase_ == PayloadOneofCase.ProtobufPayload) { if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteBytes(ProtobufPayload); output.WriteBytes(ProtobufPayload);
@ -522,8 +569,54 @@ namespace Conformance {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (payloadCase_ == PayloadOneofCase.ProtobufPayload) {
output.WriteRawTag(10);
output.WriteBytes(ProtobufPayload);
}
if (payloadCase_ == PayloadOneofCase.JsonPayload) {
output.WriteRawTag(18);
output.WriteString(JsonPayload);
}
if (RequestedOutputFormat != global::Conformance.WireFormat.Unspecified) {
output.WriteRawTag(24);
output.WriteEnum((int) RequestedOutputFormat);
}
if (MessageType.Length != 0) {
output.WriteRawTag(34);
output.WriteString(MessageType);
}
if (TestCategory != global::Conformance.TestCategory.UnspecifiedTest) {
output.WriteRawTag(40);
output.WriteEnum((int) TestCategory);
}
if (jspbEncodingOptions_ != null) {
output.WriteRawTag(50);
output.WriteMessage(JspbEncodingOptions);
}
if (payloadCase_ == PayloadOneofCase.JspbPayload) {
output.WriteRawTag(58);
output.WriteString(JspbPayload);
}
if (payloadCase_ == PayloadOneofCase.TextPayload) {
output.WriteRawTag(66);
output.WriteString(TextPayload);
}
if (PrintUnknownFields != false) {
output.WriteRawTag(72);
output.WriteBool(PrintUnknownFields);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -603,6 +696,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -650,14 +746,72 @@ namespace Conformance {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ProtobufPayload = input.ReadBytes();
break;
}
case 18: {
JsonPayload = input.ReadString();
break;
}
case 24: {
RequestedOutputFormat = (global::Conformance.WireFormat) input.ReadEnum();
break;
}
case 34: {
MessageType = input.ReadString();
break;
}
case 40: {
TestCategory = (global::Conformance.TestCategory) input.ReadEnum();
break;
}
case 50: {
if (jspbEncodingOptions_ == null) {
JspbEncodingOptions = new global::Conformance.JspbEncodingConfig();
}
input.ReadMessage(JspbEncodingOptions);
break;
}
case 58: {
JspbPayload = input.ReadString();
break;
}
case 66: {
TextPayload = input.ReadString();
break;
}
case 72: {
PrintUnknownFields = input.ReadBool();
break;
}
}
}
}
#endif
} }
/// <summary> /// <summary>
/// Represents a single test case's output. /// Represents a single test case's output.
/// </summary> /// </summary>
public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse> { public sealed partial class ConformanceResponse : pb::IMessage<ConformanceResponse>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse()); private static readonly pb::MessageParser<ConformanceResponse> _parser = new pb::MessageParser<ConformanceResponse>(() => new ConformanceResponse());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -918,6 +1072,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (resultCase_ == ResultOneofCase.ParseError) { if (resultCase_ == ResultOneofCase.ParseError) {
output.WriteRawTag(10); output.WriteRawTag(10);
output.WriteString(ParseError); output.WriteString(ParseError);
@ -953,8 +1110,50 @@ namespace Conformance {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (resultCase_ == ResultOneofCase.ParseError) {
output.WriteRawTag(10);
output.WriteString(ParseError);
}
if (resultCase_ == ResultOneofCase.RuntimeError) {
output.WriteRawTag(18);
output.WriteString(RuntimeError);
}
if (resultCase_ == ResultOneofCase.ProtobufPayload) {
output.WriteRawTag(26);
output.WriteBytes(ProtobufPayload);
}
if (resultCase_ == ResultOneofCase.JsonPayload) {
output.WriteRawTag(34);
output.WriteString(JsonPayload);
}
if (resultCase_ == ResultOneofCase.Skipped) {
output.WriteRawTag(42);
output.WriteString(Skipped);
}
if (resultCase_ == ResultOneofCase.SerializeError) {
output.WriteRawTag(50);
output.WriteString(SerializeError);
}
if (resultCase_ == ResultOneofCase.JspbPayload) {
output.WriteRawTag(58);
output.WriteString(JspbPayload);
}
if (resultCase_ == ResultOneofCase.TextPayload) {
output.WriteRawTag(66);
output.WriteString(TextPayload);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -1025,6 +1224,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -1065,14 +1267,65 @@ namespace Conformance {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 10: {
ParseError = input.ReadString();
break;
}
case 18: {
RuntimeError = input.ReadString();
break;
}
case 26: {
ProtobufPayload = input.ReadBytes();
break;
}
case 34: {
JsonPayload = input.ReadString();
break;
}
case 42: {
Skipped = input.ReadString();
break;
}
case 50: {
SerializeError = input.ReadString();
break;
}
case 58: {
JspbPayload = input.ReadString();
break;
}
case 66: {
TextPayload = input.ReadString();
break;
}
}
}
}
#endif
} }
/// <summary> /// <summary>
/// Encoding options for jspb format. /// Encoding options for jspb format.
/// </summary> /// </summary>
public sealed partial class JspbEncodingConfig : pb::IMessage<JspbEncodingConfig> { public sealed partial class JspbEncodingConfig : pb::IMessage<JspbEncodingConfig>
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
, pb::IBufferMessage
#endif
{
private static readonly pb::MessageParser<JspbEncodingConfig> _parser = new pb::MessageParser<JspbEncodingConfig>(() => new JspbEncodingConfig()); private static readonly pb::MessageParser<JspbEncodingConfig> _parser = new pb::MessageParser<JspbEncodingConfig>(() => new JspbEncodingConfig());
private pb::UnknownFieldSet _unknownFields; private pb::UnknownFieldSet _unknownFields;
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
@ -1154,6 +1407,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void WriteTo(pb::CodedOutputStream output) { public void WriteTo(pb::CodedOutputStream output) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
output.WriteRawMessage(this);
#else
if (UseJspbArrayAnyFormat != false) { if (UseJspbArrayAnyFormat != false) {
output.WriteRawTag(8); output.WriteRawTag(8);
output.WriteBool(UseJspbArrayAnyFormat); output.WriteBool(UseJspbArrayAnyFormat);
@ -1161,8 +1417,22 @@ namespace Conformance {
if (_unknownFields != null) { if (_unknownFields != null) {
_unknownFields.WriteTo(output); _unknownFields.WriteTo(output);
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalWriteTo(ref pb::WriteContext output) {
if (UseJspbArrayAnyFormat != false) {
output.WriteRawTag(8);
output.WriteBool(UseJspbArrayAnyFormat);
}
if (_unknownFields != null) {
_unknownFields.WriteTo(ref output);
}
}
#endif
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public int CalculateSize() { public int CalculateSize() {
int size = 0; int size = 0;
@ -1188,6 +1458,9 @@ namespace Conformance {
[global::System.Diagnostics.DebuggerNonUserCodeAttribute] [global::System.Diagnostics.DebuggerNonUserCodeAttribute]
public void MergeFrom(pb::CodedInputStream input) { public void MergeFrom(pb::CodedInputStream input) {
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
input.ReadRawMessage(this);
#else
uint tag; uint tag;
while ((tag = input.ReadTag()) != 0) { while ((tag = input.ReadTag()) != 0) {
switch(tag) { switch(tag) {
@ -1200,8 +1473,27 @@ namespace Conformance {
} }
} }
} }
#endif
} }
#if !GOOGLE_PROTOBUF_REFSTRUCT_COMPATIBILITY_MODE
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
void pb::IBufferMessage.InternalMergeFrom(ref pb::ParseContext input) {
uint tag;
while ((tag = input.ReadTag()) != 0) {
switch(tag) {
default:
_unknownFields = pb::UnknownFieldSet.MergeFieldFrom(_unknownFields, ref input);
break;
case 8: {
UseJspbArrayAnyFormat = input.ReadBool();
break;
}
}
}
}
#endif
} }
#endregion #endregion

View File

@ -83,44 +83,52 @@ namespace Google.Protobuf.Conformance
private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry) private static ConformanceResponse PerformRequest(ConformanceRequest request, TypeRegistry typeRegistry)
{ {
ExtensionRegistry proto2ExtensionRegistry = new ExtensionRegistry
{
ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32,
ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension,
ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension
};
IMessage message; IMessage message;
try try
{ {
switch (request.PayloadCase) switch (request.PayloadCase)
{ {
case ConformanceRequest.PayloadOneofCase.JsonPayload: case ConformanceRequest.PayloadOneofCase.JsonPayload:
if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest) { if (request.TestCategory == global::Conformance.TestCategory.JsonIgnoreUnknownParsingTest)
{
return new ConformanceResponse { Skipped = "CSharp doesn't support skipping unknown fields in json parsing." }; return new ConformanceResponse { Skipped = "CSharp doesn't support skipping unknown fields in json parsing." };
} }
var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry)); var parser = new JsonParser(new JsonParser.Settings(20, typeRegistry));
message = parser.Parse<ProtobufTestMessages.Proto3.TestAllTypesProto3>(request.JsonPayload); switch (request.MessageType)
{
case "protobuf_test_messages.proto3.TestAllTypesProto3":
message = parser.Parse<ProtobufTestMessages.Proto3.TestAllTypesProto3>(request.JsonPayload);
break;
case "protobuf_test_messages.proto2.TestAllTypesProto2":
message = parser.Parse<ProtobufTestMessages.Proto2.TestAllTypesProto2>(request.JsonPayload);
break;
default:
throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})");
}
break; break;
case ConformanceRequest.PayloadOneofCase.ProtobufPayload: case ConformanceRequest.PayloadOneofCase.ProtobufPayload:
{ switch (request.MessageType)
if (request.MessageType.Equals("protobuf_test_messages.proto3.TestAllTypesProto3"))
{ {
message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload); case "protobuf_test_messages.proto3.TestAllTypesProto3":
} message = ProtobufTestMessages.Proto3.TestAllTypesProto3.Parser.ParseFrom(request.ProtobufPayload);
else if (request.MessageType.Equals("protobuf_test_messages.proto2.TestAllTypesProto2")) break;
{ case "protobuf_test_messages.proto2.TestAllTypesProto2":
ExtensionRegistry registry = new ExtensionRegistry() message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser
{ .WithExtensionRegistry(proto2ExtensionRegistry)
ProtobufTestMessages.Proto2.TestMessagesProto2Extensions.ExtensionInt32, .ParseFrom(request.ProtobufPayload);
ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension1.Extensions.MessageSetExtension, break;
ProtobufTestMessages.Proto2.TestAllTypesProto2.Types.MessageSetCorrectExtension2.Extensions.MessageSetExtension default:
}; throw new Exception($" Protobuf request doesn't have specific payload type ({request.MessageType})");
message = ProtobufTestMessages.Proto2.TestAllTypesProto2.Parser.WithExtensionRegistry(registry).ParseFrom(request.ProtobufPayload);
}
else
{
throw new Exception(" Protobuf request doesn't have specific payload type");
} }
break; break;
}
case ConformanceRequest.PayloadOneofCase.TextPayload: case ConformanceRequest.PayloadOneofCase.TextPayload:
{
return new ConformanceResponse { Skipped = "CSharp doesn't support text format" }; return new ConformanceResponse { Skipped = "CSharp doesn't support text format" };
}
default: default:
throw new Exception("Unsupported request payload: " + request.PayloadCase); throw new Exception("Unsupported request payload: " + request.PayloadCase);
} }

View File

@ -6,7 +6,7 @@
and without the internal visibility from the test project (all of which have caused issues in the past). and without the internal visibility from the test project (all of which have caused issues in the past).
--> -->
<PropertyGroup> <PropertyGroup>
<TargetFrameworks>net45;netstandard1.0;netstandard2.0</TargetFrameworks> <TargetFrameworks>net45;netstandard1.1;netstandard2.0</TargetFrameworks>
<LangVersion>3.0</LangVersion> <LangVersion>3.0</LangVersion>
<AssemblyOriginatorKeyFile>../../keys/Google.Protobuf.snk</AssemblyOriginatorKeyFile> <AssemblyOriginatorKeyFile>../../keys/Google.Protobuf.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly> <SignAssembly>true</SignAssembly>

Some files were not shown because too many files have changed in this diff Show More