Skip to content

Commit

Permalink
Down-integrate from google3.
Browse files Browse the repository at this point in the history
  • Loading branch information
xfxyjwf committed Mar 29, 2017
1 parent 4a0dd03 commit d36c0c5
Show file tree
Hide file tree
Showing 251 changed files with 13,289 additions and 5,181 deletions.
4 changes: 3 additions & 1 deletion Makefile.am
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,7 @@ java_EXTRA_DIST=
java/core/src/main/java/com/google/protobuf/MutabilityOracle.java \
java/core/src/main/java/com/google/protobuf/NioByteString.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/ProtobufArrayList.java \
java/core/src/main/java/com/google/protobuf/ProtocolMessageEnum.java \
java/core/src/main/java/com/google/protobuf/ProtocolStringList.java \
Expand Down Expand Up @@ -710,6 +711,7 @@ python_EXTRA_DIST= \
python/google/protobuf/internal/packed_field_test.proto \
python/google/protobuf/internal/proto_builder_test.py \
python/google/protobuf/internal/python_message.py \
python/google/protobuf/internal/python_protobuf.cc \
python/google/protobuf/internal/reflection_test.py \
python/google/protobuf/internal/service_reflection_test.py \
python/google/protobuf/internal/symbol_database_test.py \
Expand Down Expand Up @@ -752,13 +754,13 @@ python_EXTRA_DIST= \
python/google/protobuf/pyext/message_module.cc \
python/google/protobuf/pyext/proto2_api_test.proto \
python/google/protobuf/pyext/python.proto \
python/google/protobuf/pyext/python_protobuf.h \
python/google/protobuf/pyext/repeated_composite_container.cc \
python/google/protobuf/pyext/repeated_composite_container.h \
python/google/protobuf/pyext/repeated_scalar_container.cc \
python/google/protobuf/pyext/repeated_scalar_container.h \
python/google/protobuf/pyext/safe_numerics.h \
python/google/protobuf/pyext/scoped_pyobject_ptr.h \
python/google/protobuf/python_protobuf.h \
python/google/protobuf/reflection.py \
python/google/protobuf/service.py \
python/google/protobuf/service_reflection.py \
Expand Down
1 change: 1 addition & 0 deletions cmake/libprotoc.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ set(libprotoc_files
${protobuf_source_dir}/src/google/protobuf/compiler/php/php_generator.cc
${protobuf_source_dir}/src/google/protobuf/compiler/plugin.cc
${protobuf_source_dir}/src/google/protobuf/compiler/plugin.pb.cc
${protobuf_source_dir}/src/google/protobuf/compiler/profile.pb.cc
${protobuf_source_dir}/src/google/protobuf/compiler/python/python_generator.cc
${protobuf_source_dir}/src/google/protobuf/compiler/ruby/ruby_generator.cc
${protobuf_source_dir}/src/google/protobuf/compiler/subprocess.cc
Expand Down
5 changes: 4 additions & 1 deletion cmake/tests.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ set(tests_protos
google/protobuf/unittest_empty.proto
google/protobuf/unittest_import.proto
google/protobuf/unittest_import_public.proto
google/protobuf/unittest_lazy_dependencies.proto
google/protobuf/unittest_lazy_dependencies_custom_option.proto
google/protobuf/unittest_lazy_dependencies_enum.proto
google/protobuf/unittest_lite_imports_nonlite.proto
google/protobuf/unittest_mset.proto
google/protobuf/unittest_mset_wire_format.proto
Expand Down Expand Up @@ -207,7 +210,7 @@ set(lite_test_files
${protobuf_source_dir}/src/google/protobuf/lite_unittest.cc
)
add_executable(lite-test ${lite_test_files} ${common_lite_test_files} ${lite_test_proto_files})
target_link_libraries(lite-test libprotobuf-lite)
target_link_libraries(lite-test libprotobuf-lite gmock_main)

set(lite_arena_test_files
${protobuf_source_dir}/src/google/protobuf/lite_arena_unittest.cc
Expand Down
17 changes: 17 additions & 0 deletions conformance/conformance_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -708,6 +708,21 @@ bool ConformanceTestSuite::CheckSetEmpty(const set<string>& set_to_check,
}
}

void ConformanceTestSuite::TestIllegalTags() {
// field num 0 is illegal
string nullfield[] = {
"\1DEADBEEF",
"\2\1\1",
"\3\4",
"\5DEAD"
};
for (int i = 0; i < 4; i++) {
string name = "IllegalZeroFieldNum_Case_0";
name.back() += i;
ExpectParseFailureForProto(nullfield[i], name, REQUIRED);
}
}

bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
std::string* output) {
runner_ = runner;
Expand All @@ -728,6 +743,8 @@ bool ConformanceTestSuite::RunSuite(ConformanceTestRunner* runner,
TestPrematureEOFForType(static_cast<FieldDescriptor::Type>(i));
}

TestIllegalTags();

int64 kInt64Min = -9223372036854775808ULL;
int64 kInt64Max = 9223372036854775807ULL;
uint64 kUint64Max = 18446744073709551615ULL;
Expand Down
1 change: 1 addition & 0 deletions conformance/conformance_test.h
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,7 @@ class ConformanceTestSuite {
const std::string& test_name,
ConformanceLevel level);
void TestPrematureEOFForType(google::protobuf::FieldDescriptor::Type type);
void TestIllegalTags();
void TestValidDataForType(
google::protobuf::FieldDescriptor::Type,
std::vector<std::pair<std::string, std::string>> values);
Expand Down
2 changes: 0 additions & 2 deletions conformance/failure_list_cpp.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ Recommended.JsonInput.TrailingCommaInAnObject
Recommended.JsonInput.TrailingCommaInAnObjectWithNewlines
Recommended.JsonInput.TrailingCommaInAnObjectWithSpace
Recommended.JsonInput.TrailingCommaInAnObjectWithSpaceCommaSpace
Required.ProtobufInput.PrematureEofBeforeKnownRepeatedValue.MESSAGE
Required.ProtobufInput.PrematureEofInDelimitedDataForKnownNonRepeatedValue.MESSAGE
Required.ProtobufInput.PrematureEofInDelimitedDataForKnownRepeatedValue.MESSAGE
Required.ProtobufInput.PrematureEofInPackedField.BOOL
Expand All @@ -43,4 +42,3 @@ Required.ProtobufInput.PrematureEofInPackedField.SINT32
Required.ProtobufInput.PrematureEofInPackedField.SINT64
Required.ProtobufInput.PrematureEofInPackedField.UINT32
Required.ProtobufInput.PrematureEofInPackedField.UINT64
Required.ProtobufInput.PrematureEofInsideKnownRepeatedValue.MESSAGE
1 change: 1 addition & 0 deletions conformance/failure_list_java.txt
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ Recommended.JsonInput.StringFieldSingleQuoteValue
Recommended.JsonInput.StringFieldSurrogateInWrongOrder
Recommended.JsonInput.StringFieldUnpairedHighSurrogate
Recommended.JsonInput.StringFieldUnpairedLowSurrogate
Recommended.JsonInput.StringFieldUppercaseEscapeLetter
Recommended.JsonInput.Uint32MapFieldKeyNotQuoted
Recommended.JsonInput.Uint64MapFieldKeyNotQuoted
Required.JsonInput.EnumFieldNotQuoted
Expand Down
Loading

0 comments on commit d36c0c5

Please sign in to comment.