Fix typos (#7050)
Uses https://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines to find likely typos, with https://github.com/bwignall/typochecker to help automate the checking.
This commit is contained in:
parent
3214d0b0b2
commit
a104dffcb6
@ -265,7 +265,7 @@
|
||||
* Introduce Proto C API.
|
||||
* FindFileContainingSymbol in descriptor pool is now able to find field and enum values.
|
||||
* reflection.MakeClass() and reflection.ParseMessage() are deprecated.
|
||||
* Added DescriptorPool.FindMethodByName() method in pure python (c extension alreay has it)
|
||||
* Added DescriptorPool.FindMethodByName() method in pure python (c extension already has it)
|
||||
* Flipped proto3 to preserve unknown fields by default.
|
||||
* Added support for memoryview in python3 proto message parsing.
|
||||
* Added MergeFrom for repeated scalar fields in c extension (pure python already has it)
|
||||
@ -428,7 +428,7 @@
|
||||
PHP
|
||||
* Fixed memory leak in C-extension implementation.
|
||||
* Added discardUnknokwnFields API.
|
||||
* Removed duplicatd typedef in C-extension headers.
|
||||
* Removed duplicated typedef in C-extension headers.
|
||||
* Avoided calling private php methods (timelib_update_ts).
|
||||
* Fixed Any.php to use fully-qualified name for DescriptorPool.
|
||||
|
||||
|
@ -168,7 +168,7 @@ $ ./cpp-benchmark $(specific generated dataset file name) [$(benchmark options)]
|
||||
|
||||
### Python:
|
||||
|
||||
For Python benchmark we have `--json` for outputing the json result
|
||||
For Python benchmark we have `--json` for outputting the json result
|
||||
|
||||
#### Pure Python:
|
||||
|
||||
|
@ -218,7 +218,7 @@ conformance_test_runner_SOURCES = conformance_test.h conformance_test.cc \
|
||||
nodist_conformance_test_runner_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
|
||||
conformance_test_runner_CPPFLAGS = -I$(top_srcdir)/src -I$(srcdir)
|
||||
conformance_test_runner_CXXFLAGS = -std=c++11
|
||||
# Explicit deps beacuse BUILT_SOURCES are only done before a "make all/check"
|
||||
# Explicit deps because BUILT_SOURCES are only done before a "make all/check"
|
||||
# so a direct "make test_cpp" could fail if parallel enough.
|
||||
conformance_test_runner-conformance_test.$(OBJEXT): conformance.pb.h
|
||||
conformance_test_runner-conformance_test_runner.$(OBJEXT): conformance.pb.h
|
||||
@ -227,7 +227,7 @@ conformance_cpp_LDADD = $(top_srcdir)/src/libprotobuf.la
|
||||
conformance_cpp_SOURCES = conformance_cpp.cc
|
||||
nodist_conformance_cpp_SOURCES = conformance.pb.cc google/protobuf/test_messages_proto3.pb.cc google/protobuf/test_messages_proto2.pb.cc
|
||||
conformance_cpp_CPPFLAGS = -I$(top_srcdir)/src
|
||||
# Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
|
||||
# Explicit dep because BUILT_SOURCES are only done before a "make all/check"
|
||||
# so a direct "make test_cpp" could fail if parallel enough.
|
||||
conformance_cpp-conformance_cpp.$(OBJEXT): conformance.pb.h
|
||||
|
||||
@ -243,7 +243,7 @@ nodist_conformance_objc_SOURCES = Conformance.pbobjc.m google/protobuf/TestMessa
|
||||
# setup for Xcode and old frameworks are being found.
|
||||
conformance_objc_CPPFLAGS = -I$(top_srcdir)/objectivec -isysroot `xcrun --sdk macosx --show-sdk-path`
|
||||
conformance_objc_LDFLAGS = -framework Foundation
|
||||
# Explicit dep beacuse BUILT_SOURCES are only done before a "make all/check"
|
||||
# Explicit dep because BUILT_SOURCES are only done before a "make all/check"
|
||||
# so a direct "make test_objc" could fail if parallel enough.
|
||||
conformance_objc-conformance_objc.$(OBJEXT): Conformance.pbobjc.h google/protobuf/TestMessagesProto2.pbobjc.h google/protobuf/TestMessagesProto3.pbobjc.h
|
||||
|
||||
|
@ -1973,7 +1973,7 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
|
||||
ExpectParseFailureForJson(
|
||||
"Uint64FieldNotNumber", REQUIRED,
|
||||
R"({"optionalUint64": "3x3"})");
|
||||
// JSON does not allow "+" on numric values.
|
||||
// JSON does not allow "+" on numeric values.
|
||||
ExpectParseFailureForJson(
|
||||
"Int32FieldPlusSign", REQUIRED,
|
||||
R"({"optionalInt32": +1})");
|
||||
@ -2080,7 +2080,7 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
|
||||
"FloatFieldNegativeInfinity", REQUIRED,
|
||||
R"({"optionalFloat": "-Infinity"})",
|
||||
"optional_float: -inf");
|
||||
// Non-cannonical Nan will be correctly normalized.
|
||||
// Non-canonical Nan will be correctly normalized.
|
||||
{
|
||||
TestAllTypesProto3 message;
|
||||
// IEEE floating-point standard 32-bit quiet NaN:
|
||||
@ -2139,7 +2139,7 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
|
||||
"DoubleFieldQuotedValue", REQUIRED,
|
||||
R"({"optionalDouble": "1"})",
|
||||
"optional_double: 1");
|
||||
// Speical values.
|
||||
// Special values.
|
||||
RunValidJsonTest(
|
||||
"DoubleFieldNan", REQUIRED,
|
||||
R"({"optionalDouble": "NaN"})",
|
||||
@ -2152,7 +2152,7 @@ void BinaryAndJsonConformanceSuite::RunJsonTestsForNonRepeatedTypes() {
|
||||
"DoubleFieldNegativeInfinity", REQUIRED,
|
||||
R"({"optionalDouble": "-Infinity"})",
|
||||
"optional_double: -inf");
|
||||
// Non-cannonical Nan will be correctly normalized.
|
||||
// Non-canonical Nan will be correctly normalized.
|
||||
{
|
||||
TestAllTypesProto3 message;
|
||||
message.set_optional_double(
|
||||
|
@ -113,7 +113,7 @@ message ConformanceRequest {
|
||||
string message_type = 4;
|
||||
|
||||
// Each test is given a specific test category. Some category may need
|
||||
// spedific support in testee programs. Refer to the defintion of TestCategory
|
||||
// spedific support in testee programs. Refer to the definition of TestCategory
|
||||
// for more information.
|
||||
TestCategory test_category = 5;
|
||||
|
||||
@ -170,7 +170,7 @@ message ConformanceResponse {
|
||||
|
||||
// Encoding options for jspb format.
|
||||
message JspbEncodingConfig {
|
||||
// Encode the value field of Any as jspb array if ture, otherwise binary.
|
||||
// Encode the value field of Any as jspb array if true, otherwise binary.
|
||||
bool use_jspb_array_any_format = 1;
|
||||
}
|
||||
|
||||
|
@ -191,7 +191,7 @@ class ConformanceTestSuite {
|
||||
// Test cases are classified into a few categories:
|
||||
// REQUIRED: the test case must be passed for an implementation to be
|
||||
// interoperable with other implementations. For example, a
|
||||
// parser implementaiton must accept both packed and unpacked
|
||||
// parser implementation must accept both packed and unpacked
|
||||
// form of repeated primitive fields.
|
||||
// RECOMMENDED: the test case is not required for the implementation to
|
||||
// be interoperable with other implementations, but is
|
||||
|
6
conformance/third_party/jsoncpp/json.h
vendored
6
conformance/third_party/jsoncpp/json.h
vendored
@ -1019,7 +1019,7 @@ private:
|
||||
* - ".name1.name2.name3"
|
||||
* - ".[0][1][2].name1[3]"
|
||||
* - ".%" => member name is provided as parameter
|
||||
* - ".[%]" => index is provied as parameter
|
||||
* - ".[%]" => index is provided as parameter
|
||||
*/
|
||||
class JSON_API Path {
|
||||
public:
|
||||
@ -1371,7 +1371,7 @@ public:
|
||||
*/
|
||||
std::string getFormattedErrorMessages() const;
|
||||
|
||||
/** \brief Returns a vector of structured erros encounted while parsing.
|
||||
/** \brief Returns a vector of structured errors encounted while parsing.
|
||||
* \return A (possibly empty) vector of StructuredError objects. Currently
|
||||
* only one error can be returned, but the caller should tolerate
|
||||
* multiple
|
||||
@ -1816,7 +1816,7 @@ public:
|
||||
*
|
||||
* The JSON document is written in a single line. It is not intended for 'human'
|
||||
*consumption,
|
||||
* but may be usefull to support feature such as RPC where bandwith is limited.
|
||||
* but may be useful to support feature such as RPC where bandwidth is limited.
|
||||
* \sa Reader, Value
|
||||
* \deprecated Use StreamWriterBuilder.
|
||||
*/
|
||||
|
2
conformance/third_party/jsoncpp/jsoncpp.cpp
vendored
2
conformance/third_party/jsoncpp/jsoncpp.cpp
vendored
@ -4112,7 +4112,7 @@ std::string valueToString(double value, bool useSpecialFloats, unsigned int prec
|
||||
sprintf(formatString, "%%.%dg", precision);
|
||||
|
||||
// Print into the buffer. We need not request the alternative representation
|
||||
// that always has a decimal point because JSON doesn't distingish the
|
||||
// that always has a decimal point because JSON doesn't distinguish the
|
||||
// concepts of reals and integers.
|
||||
if (isfinite(value)) {
|
||||
len = snprintf(buffer, sizeof(buffer), formatString, value);
|
||||
|
@ -142,7 +142,7 @@ message TestAllTypes {
|
||||
}
|
||||
}
|
||||
|
||||
// This proto includes a recusively nested message.
|
||||
// This proto includes a recursively nested message.
|
||||
message NestedTestAllTypes {
|
||||
NestedTestAllTypes child = 1;
|
||||
TestAllTypes payload = 2;
|
||||
|
@ -37,7 +37,7 @@ TEST_VERSION=3.0.0
|
||||
# The old version of protobuf that we are testing compatibility against. This
|
||||
# is usually the same as TEST_VERSION (i.e., we use the tests extracted from
|
||||
# that version to test compatibility of the newest runtime against it), but it
|
||||
# is also possible to use this same test set to test the compatibiilty of the
|
||||
# is also possible to use this same test set to test the compatibility of the
|
||||
# latest version against other versions.
|
||||
OLD_VERSION=$1
|
||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||
|
@ -182,7 +182,7 @@ message TestAllTypes {
|
||||
}
|
||||
}
|
||||
|
||||
// This proto includes a recusively nested message.
|
||||
// This proto includes a recursively nested message.
|
||||
message NestedTestAllTypes {
|
||||
optional NestedTestAllTypes child = 1;
|
||||
optional TestAllTypes payload = 2;
|
||||
|
@ -286,7 +286,7 @@ message Aggregate {
|
||||
}
|
||||
|
||||
// Allow Aggregate to be used as an option at all possible locations
|
||||
// in the .proto grammer.
|
||||
// in the .proto grammar.
|
||||
extend google.protobuf.FileOptions { Aggregate fileopt = 15478479; }
|
||||
extend google.protobuf.MessageOptions { Aggregate msgopt = 15480088; }
|
||||
extend google.protobuf.FieldOptions { Aggregate fieldopt = 15481374; }
|
||||
|
@ -130,7 +130,7 @@ message TestAllTypes {
|
||||
}
|
||||
}
|
||||
|
||||
// This proto includes a recusively nested message.
|
||||
// This proto includes a recursively nested message.
|
||||
message NestedTestAllTypes {
|
||||
NestedTestAllTypes child = 1;
|
||||
TestAllTypes payload = 2;
|
||||
|
@ -370,7 +370,7 @@ namespace Conformance {
|
||||
private global::Conformance.TestCategory testCategory_ = global::Conformance.TestCategory.UnspecifiedTest;
|
||||
/// <summary>
|
||||
/// Each test is given a specific test category. Some category may need
|
||||
/// spedific support in testee programs. Refer to the defintion of TestCategory
|
||||
/// spedific support in testee programs. Refer to the definition of TestCategory
|
||||
/// for more information.
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
@ -1110,7 +1110,7 @@ namespace Conformance {
|
||||
public const int UseJspbArrayAnyFormatFieldNumber = 1;
|
||||
private bool useJspbArrayAnyFormat_;
|
||||
/// <summary>
|
||||
/// Encode the value field of Any as jspb array if ture, otherwise binary.
|
||||
/// Encode the value field of Any as jspb array if true, otherwise binary.
|
||||
/// </summary>
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute]
|
||||
public bool UseJspbArrayAnyFormat {
|
||||
|
@ -1773,7 +1773,7 @@ namespace Google.Protobuf.TestProtos {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This proto includes a recusively nested message.
|
||||
/// This proto includes a recursively nested message.
|
||||
/// </summary>
|
||||
public sealed partial class NestedTestAllTypes : pb::IMessage<NestedTestAllTypes> {
|
||||
private static readonly pb::MessageParser<NestedTestAllTypes> _parser = new pb::MessageParser<NestedTestAllTypes>(() => new NestedTestAllTypes());
|
||||
|
@ -96,7 +96,7 @@ namespace Google.Protobuf
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adds the specified extensions to the reigstry
|
||||
/// Adds the specified extensions to the registry
|
||||
/// </summary>
|
||||
public void AddRange(IEnumerable<Extension> extensions)
|
||||
{
|
||||
|
@ -85,7 +85,7 @@ namespace Google.Protobuf.Reflection
|
||||
/// Finds a method by name.
|
||||
/// </summary>
|
||||
/// <param name="name">The unqualified name of the method (e.g. "Foo").</param>
|
||||
/// <returns>The method's decsriptor, or null if not found.</returns>
|
||||
/// <returns>The method's descriptor, or null if not found.</returns>
|
||||
public MethodDescriptor FindMethodByName(String name)
|
||||
{
|
||||
return File.DescriptorPool.FindSymbol<MethodDescriptor>(FullName + "." + name);
|
||||
|
@ -19,7 +19,7 @@ local_repository(
|
||||
)
|
||||
|
||||
# Similar to com_google_protobuf but for Java lite. If you are building
|
||||
# for Android, the lite version should be prefered because it has a much
|
||||
# for Android, the lite version should be preferred because it has a much
|
||||
# smaller code size.
|
||||
local_repository(
|
||||
name = "com_google_protobuf_javalite",
|
||||
|
@ -146,7 +146,7 @@ library (without the util package).
|
||||
are guaranteed for minor version releases if the user follows the guideline
|
||||
described in this section.
|
||||
|
||||
* Protobuf major version releases may also be backwards-compatbile with the
|
||||
* Protobuf major version releases may also be backwards-compatible with the
|
||||
last release of the previous major version. See the release notice for more
|
||||
details.
|
||||
|
||||
|
@ -228,7 +228,7 @@ message MethodDescriptorProto {
|
||||
// * For options which will be published and used publicly by multiple
|
||||
// independent entities, e-mail protobuf-global-extension-registry@google.com
|
||||
// to reserve extension numbers. Simply provide your project name (e.g.
|
||||
// Object-C plugin) and your porject website (if available) -- there's no need
|
||||
// Object-C plugin) and your project website (if available) -- there's no need
|
||||
// to explain how you intend to use them. Usually you only need one extension
|
||||
// number. You can declare multiple options with only one extension number by
|
||||
// putting them in a sub-message. See the Custom Options section of the docs
|
||||
|
@ -321,7 +321,7 @@ message Aggregate {
|
||||
}
|
||||
|
||||
// Allow Aggregate to be used as an option at all possible locations
|
||||
// in the .proto grammer.
|
||||
// in the .proto grammar.
|
||||
extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; }
|
||||
extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; }
|
||||
extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; }
|
||||
|
@ -43,7 +43,7 @@ package protobuf_unittest_import;
|
||||
|
||||
option optimize_for = SPEED;
|
||||
|
||||
// Excercise the java_package option.
|
||||
// Exercise the java_package option.
|
||||
option java_package = "com.google.protobuf.test";
|
||||
|
||||
// Do not set a java_outer_classname here to verify that Proto2 works without
|
||||
|
@ -228,7 +228,7 @@ message MethodDescriptorProto {
|
||||
// * For options which will be published and used publicly by multiple
|
||||
// independent entities, e-mail protobuf-global-extension-registry@google.com
|
||||
// to reserve extension numbers. Simply provide your project name (e.g.
|
||||
// Object-C plugin) and your porject website (if available) -- there's no need
|
||||
// Object-C plugin) and your project website (if available) -- there's no need
|
||||
// to explain how you intend to use them. Usually you only need one extension
|
||||
// number. You can declare multiple options with only one extension number by
|
||||
// putting them in a sub-message. See the Custom Options section of the docs
|
||||
|
@ -321,7 +321,7 @@ message Aggregate {
|
||||
}
|
||||
|
||||
// Allow Aggregate to be used as an option at all possible locations
|
||||
// in the .proto grammer.
|
||||
// in the .proto grammar.
|
||||
extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; }
|
||||
extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; }
|
||||
extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; }
|
||||
|
@ -43,7 +43,7 @@ package protobuf_unittest_import;
|
||||
|
||||
option optimize_for = SPEED;
|
||||
|
||||
// Excercise the java_package option.
|
||||
// Exercise the java_package option.
|
||||
option java_package = "com.google.protobuf.test";
|
||||
|
||||
// Do not set a java_outer_classname here to verify that Proto2 works without
|
||||
|
@ -15,7 +15,7 @@ TEST_VERSION=`grep "^ <version>.*</version>" pom.xml | sed "s| <version>\(.*\)
|
||||
# The old version of protobuf that we are testing compatibility against. This
|
||||
# is usually the same as TEST_VERSION (i.e., we use the tests extracted from
|
||||
# that version to test compatibility of the newest runtime against it), but it
|
||||
# is also possible to use this same test set to test the compatibiilty of the
|
||||
# is also possible to use this same test set to test the compatibility of the
|
||||
# latest version against other versions.
|
||||
OLD_VERSION=$1
|
||||
OLD_VERSION_PROTOC=https://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||
|
@ -87,7 +87,7 @@ public class LiteralByteStringTest extends TestCase {
|
||||
stillEqual = (iter.hasNext() && referenceBytes[i] == iter.nextByte());
|
||||
}
|
||||
assertTrue(classUnderTest + " must capture the right bytes", stillEqual);
|
||||
assertFalse(classUnderTest + " must have exhausted the itertor", iter.hasNext());
|
||||
assertFalse(classUnderTest + " must have exhausted the iterator", iter.hasNext());
|
||||
|
||||
try {
|
||||
iter.nextByte();
|
||||
@ -317,7 +317,7 @@ public class LiteralByteStringTest extends TestCase {
|
||||
assertEquals("InputStream.skip(), no more input", 0, input.available());
|
||||
assertEquals("InputStream.skip(), no more input", -1, input.read());
|
||||
input.reset();
|
||||
assertEquals("InputStream.reset() succeded",
|
||||
assertEquals("InputStream.reset() succeeded",
|
||||
stringSize - skipped1, input.available());
|
||||
assertEquals("InputStream.reset(), read()",
|
||||
stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read());
|
||||
|
@ -873,7 +873,7 @@ final class ArrayDecoders {
|
||||
}
|
||||
} else {
|
||||
Object value = null;
|
||||
// Enum is a special case becasue unknown enum values will be put into UnknownFieldSetLite.
|
||||
// Enum is a special case because unknown enum values will be put into UnknownFieldSetLite.
|
||||
if (extension.getLiteType() == WireFormat.FieldType.ENUM) {
|
||||
position = decodeVarint32(data, position, registers);
|
||||
Object enumValue = extension.descriptor.getEnumType().findValueByNumber(registers.int1);
|
||||
|
@ -193,7 +193,7 @@ final class ExtensionSchemaLite extends ExtensionSchema<ExtensionDescriptor> {
|
||||
extensions.setField(extension.descriptor, value);
|
||||
} else {
|
||||
Object value = null;
|
||||
// Enum is a special case becasue unknown enum values will be put into UnknownFieldSetLite.
|
||||
// Enum is a special case because unknown enum values will be put into UnknownFieldSetLite.
|
||||
if (extension.getLiteType() == WireFormat.FieldType.ENUM) {
|
||||
int number = reader.readInt32();
|
||||
Object enumValue = extension.descriptor.getEnumType().findValueByNumber(number);
|
||||
|
@ -359,7 +359,7 @@ public abstract class GeneratedMessage extends AbstractMessage
|
||||
* TODO(xiaofeng): remove this after b/29368482 is fixed. We need to move this
|
||||
* interface to AbstractMessage in order to versioning GeneratedMessage but
|
||||
* this move breaks binary compatibility for AppEngine. After AppEngine is
|
||||
* fixed we can exlude this from google3.
|
||||
* fixed we can exclude this from google3.
|
||||
*/
|
||||
protected interface BuilderParent extends AbstractMessage.BuilderParent {}
|
||||
|
||||
|
@ -515,7 +515,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage
|
||||
* TODO(xiaofeng): remove this after b/29368482 is fixed. We need to move this
|
||||
* interface to AbstractMessage in order to versioning GeneratedMessageV3 but
|
||||
* this move breaks binary compatibility for AppEngine. After AppEngine is
|
||||
* fixed we can exlude this from google3.
|
||||
* fixed we can exclude this from google3.
|
||||
*/
|
||||
protected interface BuilderParent extends AbstractMessage.BuilderParent {}
|
||||
|
||||
@ -3086,7 +3086,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage
|
||||
serializeMapTo(out, m, defaultEntry, fieldNumber);
|
||||
return;
|
||||
}
|
||||
// Sorting the unboxed keys and then look up the values during serialziation is 2x faster
|
||||
// Sorting the unboxed keys and then look up the values during serialization is 2x faster
|
||||
// than sorting map entries with a custom comparator directly.
|
||||
int[] keys = new int[m.size()];
|
||||
int index = 0;
|
||||
@ -3142,7 +3142,7 @@ public abstract class GeneratedMessageV3 extends AbstractMessage
|
||||
return;
|
||||
}
|
||||
|
||||
// Sorting the String keys and then look up the values during serialziation is 25% faster than
|
||||
// Sorting the String keys and then look up the values during serialization is 25% faster than
|
||||
// sorting map entries with a custom comparator directly.
|
||||
String[] keys = new String[m.size()];
|
||||
keys = m.keySet().toArray(keys);
|
||||
|
@ -274,7 +274,7 @@ public class LazyFieldLite {
|
||||
|
||||
// At least one is parsed and both contain data. We won't drop any extensions here directly, but
|
||||
// in the case that the extension registries are not the same then we might in the future if we
|
||||
// need to serialze and parse a message again.
|
||||
// need to serialize and parse a message again.
|
||||
if (this.value == null && other.value != null) {
|
||||
setValue(mergeValueAndBytes(other.value, this.delayedBytes, this.extensionRegistry));
|
||||
return;
|
||||
|
@ -767,7 +767,7 @@ final class SchemaUtil {
|
||||
* logic in the JDK</a>.
|
||||
*
|
||||
* @param lo the lowest fieldNumber contained within the message.
|
||||
* @param hi the higest fieldNumber contained within the message.
|
||||
* @param hi the highest fieldNumber contained within the message.
|
||||
* @param numFields the total number of fields in the message.
|
||||
* @return {@code true} if tableswitch should be used, rather than lookupswitch.
|
||||
*/
|
||||
|
@ -103,7 +103,7 @@ public class FieldPresenceTest extends TestCase {
|
||||
public void testOneofEquals() throws Exception {
|
||||
TestAllTypes.Builder builder = TestAllTypes.newBuilder();
|
||||
TestAllTypes message1 = builder.build();
|
||||
// Set message2's oneof_uint32 field to defalut value. The two
|
||||
// Set message2's oneof_uint32 field to default value. The two
|
||||
// messages should be different when check with oneof case.
|
||||
builder.setOneofUint32(0);
|
||||
TestAllTypes message2 = builder.build();
|
||||
|
@ -75,7 +75,7 @@ public class LiteEqualsAndHashTest extends TestCase {
|
||||
assertEquals(foo1a, foo1b);
|
||||
assertEquals(foo1a.hashCode(), foo1b.hashCode());
|
||||
|
||||
// Check that a diffeent object is not equal.
|
||||
// Check that a different object is not equal.
|
||||
assertFalse(foo1a.equals(foo2));
|
||||
|
||||
// Check that two objects which have different types but the same field values are not
|
||||
|
@ -94,7 +94,7 @@ public class LiteralByteStringTest extends TestCase {
|
||||
stillEqual = (iter.hasNext() && referenceBytes[i] == iter.nextByte());
|
||||
}
|
||||
assertTrue(classUnderTest + " must capture the right bytes", stillEqual);
|
||||
assertFalse(classUnderTest + " must have exhausted the itertor", iter.hasNext());
|
||||
assertFalse(classUnderTest + " must have exhausted the iterator", iter.hasNext());
|
||||
|
||||
try {
|
||||
iter.nextByte();
|
||||
@ -536,7 +536,7 @@ public class LiteralByteStringTest extends TestCase {
|
||||
assertThat(input.read(new byte[1], /* off= */ 0, /*len=*/ 0)).isEqualTo(-1);
|
||||
|
||||
input.reset();
|
||||
assertEquals("InputStream.reset() succeded", stringSize - skipped1, input.available());
|
||||
assertEquals("InputStream.reset() succeeded", stringSize - skipped1, input.available());
|
||||
assertEquals(
|
||||
"InputStream.reset(), read()", stringUnderTest.byteAt(nearEndIndex) & 0xFF, input.read());
|
||||
}
|
||||
|
@ -84,7 +84,7 @@ public class NioByteStringTest extends TestCase {
|
||||
stillEqual = (iter.hasNext() && BYTES[i] == iter.nextByte());
|
||||
}
|
||||
assertTrue(CLASSNAME + " must capture the right bytes", stillEqual);
|
||||
assertFalse(CLASSNAME + " must have exhausted the itertor", iter.hasNext());
|
||||
assertFalse(CLASSNAME + " must have exhausted the iterator", iter.hasNext());
|
||||
|
||||
try {
|
||||
iter.nextByte();
|
||||
@ -590,7 +590,7 @@ public class NioByteStringTest extends TestCase {
|
||||
assertEquals("InputStream.skip(), no more input", 0, input.available());
|
||||
assertEquals("InputStream.skip(), no more input", -1, input.read());
|
||||
input.reset();
|
||||
assertEquals("InputStream.reset() succeded", stringSize - skipped1, input.available());
|
||||
assertEquals("InputStream.reset() succeeded", stringSize - skipped1, input.available());
|
||||
assertEquals(
|
||||
"InputStream.reset(), read()", testString.byteAt(nearEndIndex) & 0xFF, input.read());
|
||||
}
|
||||
|
@ -28,7 +28,7 @@
|
||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
|
||||
// Regression test for a map initilaization order bug. The bug only manifests
|
||||
// Regression test for a map initialization order bug. The bug only manifests
|
||||
// when:
|
||||
// 1. A message contains map fields and is also extendable.
|
||||
// 2. There is a file-level extension defined in the same file referencing
|
||||
|
@ -1997,7 +1997,7 @@ public class LiteTest extends TestCase {
|
||||
assertEquals(foo1a, foo1b);
|
||||
assertEquals(foo1a.hashCode(), foo1b.hashCode());
|
||||
|
||||
// Check that a diffeent object is not equal.
|
||||
// Check that a different object is not equal.
|
||||
assertFalse(foo1a.equals(foo2));
|
||||
|
||||
// Check that two objects which have different types but the same field values are not
|
||||
|
@ -748,7 +748,7 @@ jspb.BinaryDecoder.prototype.readInt32 = function() {
|
||||
/**
|
||||
* Reads a raw signed 64-bit integer from the binary stream. Note that since
|
||||
* Javascript represents all numbers as double-precision floats, there will be
|
||||
* precision lost if the absolute vlaue of the integer is larger than 2^53.
|
||||
* precision lost if the absolute value of the integer is larger than 2^53.
|
||||
*
|
||||
* @return {number} The signed 64-bit integer read from the binary stream.
|
||||
* Precision will be lost if the integer exceeds 2^53.
|
||||
|
@ -303,7 +303,7 @@ describe('binaryDecoderTest', function() {
|
||||
});
|
||||
|
||||
it('does zigzag encoding properly', function() {
|
||||
// Test cases direcly from the protobuf dev guide.
|
||||
// Test cases directly from the protobuf dev guide.
|
||||
// https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
|
||||
var testCases = [
|
||||
{original: '0', zigzag: '0'},
|
||||
|
@ -117,7 +117,7 @@ jspb.utils.splitInt64 = function(value) {
|
||||
|
||||
|
||||
/**
|
||||
* Convers a signed Javascript integer into zigzag format, splits it into two
|
||||
* Converts a signed Javascript integer into zigzag format, splits it into two
|
||||
* 32-bit halves, and stores it in the temp values above.
|
||||
* @param {number} value The number to split.
|
||||
*/
|
||||
|
@ -506,7 +506,7 @@ describe('binaryUtilsTest', function() {
|
||||
function makeHiLoPair(lo, hi) {
|
||||
return {lo: lo >>> 0, hi: hi >>> 0};
|
||||
}
|
||||
// Test cases direcly from the protobuf dev guide.
|
||||
// Test cases directly from the protobuf dev guide.
|
||||
// https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
|
||||
var testCases = [
|
||||
{original: stringToHiLoPair('0'), zigzag: stringToHiLoPair('0')},
|
||||
|
@ -210,7 +210,7 @@ describe('binaryWriterTest', function() {
|
||||
});
|
||||
|
||||
it('writes zigzag 64 fields', function() {
|
||||
// Test cases direcly from the protobuf dev guide.
|
||||
// Test cases directly from the protobuf dev guide.
|
||||
// https://engdoc.corp.google.com/eng/howto/protocolbuffers/developerguide/encoding.shtml?cl=head#types
|
||||
var testCases = [
|
||||
{original: '0', zigzag: '0'},
|
||||
|
@ -317,7 +317,7 @@ jspb.Message.getIndex_ = function(msg, fieldNumber) {
|
||||
return fieldNumber + msg.arrayIndexOffset_;
|
||||
};
|
||||
|
||||
// This is only here to ensure we are not back sliding on ES6 requiements for
|
||||
// This is only here to ensure we are not back sliding on ES6 requirements for
|
||||
// protos in g3.
|
||||
jspb.Message.hiddenES6Property_ = class {};
|
||||
|
||||
@ -366,7 +366,7 @@ jspb.Message.initialize = function(
|
||||
|
||||
if (!jspb.Message.SERIALIZE_EMPTY_TRAILING_FIELDS) {
|
||||
// TODO(jakubvrana): This is same for all instances, move to prototype.
|
||||
// TODO(jakubvrana): There are indexOf calls on this in serializtion,
|
||||
// TODO(jakubvrana): There are indexOf calls on this in serialization,
|
||||
// consider switching to a set.
|
||||
msg.repeatedFields = repeatedFields;
|
||||
}
|
||||
@ -1860,7 +1860,7 @@ jspb.Message.clone_ = function(obj) {
|
||||
* @param {Function} constructor The message constructor.
|
||||
*/
|
||||
jspb.Message.registerMessageType = function(id, constructor) {
|
||||
// This is needed so we can later access messageId directly on the contructor,
|
||||
// This is needed so we can later access messageId directly on the constructor,
|
||||
// otherwise it is not available due to 'property collapsing' by the compiler.
|
||||
/**
|
||||
* @suppress {strictMissingProperties} messageId is not defined on Function
|
||||
|
@ -5,8 +5,8 @@
|
||||
##
|
||||
# Select Xcode version
|
||||
|
||||
# Remember to udpate the Xcode version when Xcode_11.0.app is not available.
|
||||
# If xcode is not available, it will probaly encounter the failure for
|
||||
# Remember to update the Xcode version when Xcode_11.0.app is not available.
|
||||
# If xcode is not available, it will probably encounter the failure for
|
||||
# "autom4te: need GNU m4 1.4 or later: /usr/bin/m4"
|
||||
# go/kokoro/userdocs/macos/selecting_xcode.md for more information.
|
||||
export DEVELOPER_DIR=/Applications/Xcode_11.0.app/Contents/Developer
|
||||
|
@ -288,7 +288,7 @@ class MacroCollection(object):
|
||||
name = macro_ref_match.group('name')
|
||||
for prev_name, prev_macro_ref in macro_stack:
|
||||
if name == prev_name:
|
||||
raise PDDMError('Found macro recusion, invoking "%s":%s' %
|
||||
raise PDDMError('Found macro recursion, invoking "%s":%s' %
|
||||
(macro_ref_str, self._FormatStack(macro_stack)))
|
||||
macro = self._macros[name]
|
||||
args_str = macro_ref_match.group('args').strip()
|
||||
@ -395,7 +395,7 @@ class SourceFile(object):
|
||||
wasn't append. If SUCCESS is True, then CAN_ADD_MORE is True/False to
|
||||
indicate if more lines can be added after this one.
|
||||
"""
|
||||
assert False, "sublcass should have overridden"
|
||||
assert False, "subclass should have overridden"
|
||||
return (False, False)
|
||||
|
||||
def HitEOF(self):
|
||||
|
@ -314,7 +314,7 @@ foo(x, y)
|
||||
self.fail('Should throw exception! Test failed to catch recursion.')
|
||||
except pddm.PDDMError as e:
|
||||
self.assertEqual(e.message,
|
||||
'Found macro recusion, invoking "foo(1, A)":\n...while expanding "bar(1, A)".\n...while expanding "foo(A,B)".')
|
||||
'Found macro recursion, invoking "foo(1, A)":\n...while expanding "bar(1, A)".\n...while expanding "foo(A,B)".')
|
||||
|
||||
|
||||
class TestParsingSource(unittest.TestCase):
|
||||
|
@ -46,7 +46,7 @@
|
||||
#endif
|
||||
|
||||
// If the headers are imported into Objective-C++, we can run into an issue
|
||||
// where the defintion of NS_ENUM (really CF_ENUM) changes based on the C++
|
||||
// where the definition of NS_ENUM (really CF_ENUM) changes based on the C++
|
||||
// standard that is in effect. If it isn't C++11 or higher, the definition
|
||||
// doesn't allow us to forward declare. We work around this one case by
|
||||
// providing a local definition. The default case has to use NS_ENUM for the
|
||||
|
@ -508,7 +508,7 @@ void GPBDictionaryReadEntry(id mapDictionary,
|
||||
#if defined(__clang_analyzer__)
|
||||
case GPBDataTypeGroup:
|
||||
// Maps can't really have Groups as the value type, but this case is needed
|
||||
// so the analyzer won't report the posibility of send nil in for the value
|
||||
// so the analyzer won't report the possibility of send nil in for the value
|
||||
// in the NSMutableDictionary case below.
|
||||
#endif
|
||||
case GPBDataTypeMessage: {
|
||||
|
@ -564,7 +564,7 @@ static id CreateMapForField(GPBFieldDescriptor *field,
|
||||
// so use of the array/map after the call returns is flagged as a use after
|
||||
// free.
|
||||
// But GPBSetRetainedObjectIvarWithFieldInternal() is "consuming" the retain
|
||||
// count be holding onto the object (it is transfering it), the object is
|
||||
// count be holding onto the object (it is transferring it), the object is
|
||||
// still valid after returning from the call. The other way to avoid this
|
||||
// would be to add a -retain/-autorelease, but that would force every
|
||||
// repeated/map field parsed into the autorelease pool which is both a memory
|
||||
@ -2518,7 +2518,7 @@ static void MergeRepeatedNotPackedFieldFromCodedInputStream(
|
||||
GetOrCreateArrayIvarWithField(self, field, syntax);
|
||||
[resultArray addRawValuesFromArray:otherArray];
|
||||
} else {
|
||||
// The array type doesn't matter, that all implment
|
||||
// The array type doesn't matter, that all implement
|
||||
// -addValuesFromArray:.
|
||||
GPBInt32Array *resultArray =
|
||||
GetOrCreateArrayIvarWithField(self, field, syntax);
|
||||
|
@ -504,7 +504,7 @@ void GPBClearAutocreatedMessageIvarWithField(GPBMessage *self,
|
||||
[oldValue release];
|
||||
}
|
||||
|
||||
// This exists only for briging some aliased types, nothing else should use it.
|
||||
// This exists only for bridging some aliased types, nothing else should use it.
|
||||
static void GPBSetObjectIvarWithField(GPBMessage *self,
|
||||
GPBFieldDescriptor *field, id value) {
|
||||
if (self == nil || field == nil) return;
|
||||
@ -521,7 +521,7 @@ static void GPBSetCopyObjectIvarWithField(GPBMessage *self,
|
||||
// is marked as consuming the value. Note: For some reason this doesn't happen
|
||||
// with the -retain in GPBSetObjectIvarWithField.
|
||||
#if !defined(__clang_analyzer__)
|
||||
// This exists only for briging some aliased types, nothing else should use it.
|
||||
// This exists only for bridging some aliased types, nothing else should use it.
|
||||
static void GPBSetCopyObjectIvarWithField(GPBMessage *self,
|
||||
GPBFieldDescriptor *field, id value) {
|
||||
if (self == nil || field == nil) return;
|
||||
|
@ -355,7 +355,7 @@
|
||||
XCTAssertNil([oneofBar fieldWithNumber:TestOneof2_FieldNumber_FooString]);
|
||||
|
||||
// Check pointers back to the enclosing oneofs.
|
||||
// (pointer comparisions)
|
||||
// (pointer comparisons)
|
||||
XCTAssertEqual(fooStringField.containingOneof, oneofFoo);
|
||||
XCTAssertEqual(barStringField.containingOneof, oneofBar);
|
||||
GPBFieldDescriptor *bazString =
|
||||
|
@ -416,7 +416,7 @@
|
||||
XCTAssertEqual(dst.oOneOfCase, Message2_O_OneOfCase_OneofGroup);
|
||||
Message2_OneofGroup *mergedGroup = [[dst.oneofGroup retain] autorelease];
|
||||
XCTAssertNotNil(mergedGroup);
|
||||
XCTAssertNotEqual(mergedGroup, group); // Pointer comparision.
|
||||
XCTAssertNotEqual(mergedGroup, group); // Pointer comparison.
|
||||
XCTAssertEqualObjects(mergedGroup, group);
|
||||
XCTAssertEqualObjects(dst.oneofBytes, oneofBytesDefault);
|
||||
|
||||
@ -427,10 +427,10 @@
|
||||
XCTAssertEqual(dst.oOneOfCase, Message2_O_OneOfCase_OneofMessage);
|
||||
Message2 *mergedSubMessage = [[dst.oneofMessage retain] autorelease];
|
||||
XCTAssertNotNil(mergedSubMessage);
|
||||
XCTAssertNotEqual(mergedSubMessage, subMessage); // Pointer comparision.
|
||||
XCTAssertNotEqual(mergedSubMessage, subMessage); // Pointer comparison.
|
||||
XCTAssertEqualObjects(mergedSubMessage, subMessage);
|
||||
XCTAssertNotNil(dst.oneofGroup);
|
||||
XCTAssertNotEqual(dst.oneofGroup, mergedGroup); // Pointer comparision.
|
||||
XCTAssertNotEqual(dst.oneofGroup, mergedGroup); // Pointer comparison.
|
||||
|
||||
// Back to something else to make sure message clears out ok.
|
||||
|
||||
@ -439,7 +439,7 @@
|
||||
XCTAssertEqual(dst.oOneOfCase, Message2_O_OneOfCase_OneofInt32);
|
||||
XCTAssertNotNil(dst.oneofMessage);
|
||||
XCTAssertNotEqual(dst.oneofMessage,
|
||||
mergedSubMessage); // Pointer comparision.
|
||||
mergedSubMessage); // Pointer comparison.
|
||||
|
||||
//
|
||||
// Test merging in to message/group when they already had something.
|
||||
@ -452,9 +452,9 @@
|
||||
[dst mergeFrom:src];
|
||||
XCTAssertEqual(dst.oOneOfCase, Message2_O_OneOfCase_OneofGroup);
|
||||
// Shouldn't have been a new object.
|
||||
XCTAssertEqual(dst.oneofGroup, mergedGroup); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofGroup.a, 666); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofGroup.b, 888); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofGroup, mergedGroup); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofGroup.a, 666); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofGroup.b, 888); // Pointer comparison.
|
||||
|
||||
src.oneofMessage = subMessage;
|
||||
mergedSubMessage = [Message2 message];
|
||||
@ -463,9 +463,9 @@
|
||||
[dst mergeFrom:src];
|
||||
XCTAssertEqual(dst.oOneOfCase, Message2_O_OneOfCase_OneofMessage);
|
||||
// Shouldn't have been a new object.
|
||||
XCTAssertEqual(dst.oneofMessage, mergedSubMessage); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt32, 777); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt64, 999); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage, mergedSubMessage); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt32, 777); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt64, 999); // Pointer comparison.
|
||||
}
|
||||
|
||||
- (void)testProto3MergeOneof {
|
||||
@ -637,7 +637,7 @@
|
||||
XCTAssertEqual(dst.oOneOfCase, Message3_O_OneOfCase_OneofMessage);
|
||||
Message3 *mergedSubMessage = [[dst.oneofMessage retain] autorelease];
|
||||
XCTAssertNotNil(mergedSubMessage);
|
||||
XCTAssertNotEqual(mergedSubMessage, subMessage); // Pointer comparision.
|
||||
XCTAssertNotEqual(mergedSubMessage, subMessage); // Pointer comparison.
|
||||
XCTAssertEqualObjects(mergedSubMessage, subMessage);
|
||||
XCTAssertEqualObjects(dst.oneofBytes, oneofBytesDefault);
|
||||
|
||||
@ -648,7 +648,7 @@
|
||||
XCTAssertEqual(dst.oOneOfCase, Message3_O_OneOfCase_OneofInt32);
|
||||
XCTAssertNotNil(dst.oneofMessage);
|
||||
XCTAssertNotEqual(dst.oneofMessage,
|
||||
mergedSubMessage); // Pointer comparision.
|
||||
mergedSubMessage); // Pointer comparison.
|
||||
|
||||
//
|
||||
// Test merging in to message when they already had something.
|
||||
@ -661,9 +661,9 @@
|
||||
[dst mergeFrom:src];
|
||||
XCTAssertEqual(dst.oOneOfCase, Message3_O_OneOfCase_OneofMessage);
|
||||
// Shouldn't have been a new object.
|
||||
XCTAssertEqual(dst.oneofMessage, mergedSubMessage); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt32, 777); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt64, 999); // Pointer comparision.
|
||||
XCTAssertEqual(dst.oneofMessage, mergedSubMessage); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt32, 777); // Pointer comparison.
|
||||
XCTAssertEqual(dst.oneofMessage.optionalInt64, 999); // Pointer comparison.
|
||||
}
|
||||
|
||||
#pragma mark - Subset from from map_tests.cc
|
||||
|
@ -212,7 +212,7 @@
|
||||
// Proto3 gets:
|
||||
|
||||
// Single fields
|
||||
// - has*/setHas* invalid for primative types.
|
||||
// - has*/setHas* invalid for primitive types.
|
||||
// - has*/setHas* valid for Message.
|
||||
|
||||
for (NSString *name in names) {
|
||||
@ -2234,7 +2234,7 @@
|
||||
- (void)testProto3OneofSetToZero {
|
||||
|
||||
// Normally setting a proto3 field to the zero value should result in it being
|
||||
// reset/cleared. But in a oneof, it still gets recored so it can go out
|
||||
// reset/cleared. But in a oneof, it still gets recorded so it can go out
|
||||
// over the wire and the other side can see what was set in the oneof.
|
||||
|
||||
NSString *oneofStringDefault = @"";
|
||||
@ -2367,7 +2367,7 @@
|
||||
XCTAssertNotEqual(msg1, msg2); // Ptr compare, new object.
|
||||
XCTAssertEqualObjects(msg1, msg2); // Equal values.
|
||||
|
||||
// Pointer comparisions, different objects.
|
||||
// Pointer comparisons, different objects.
|
||||
|
||||
XCTAssertNotEqual(msg1.optionalGroup, msg2.optionalGroup);
|
||||
XCTAssertNotEqual(msg1.optionalNestedMessage, msg2.optionalNestedMessage);
|
||||
@ -2423,7 +2423,7 @@
|
||||
XCTAssertNotEqual(msg1, msg2); // Ptr compare, new object.
|
||||
XCTAssertEqualObjects(msg1, msg2); // Equal values.
|
||||
|
||||
// Pointer comparisions, different objects.
|
||||
// Pointer comparisons, different objects.
|
||||
XCTAssertNotEqual(msg1.mapInt32Int32, msg2.mapInt32Int32);
|
||||
XCTAssertNotEqual(msg1.mapInt64Int64, msg2.mapInt64Int64);
|
||||
XCTAssertNotEqual(msg1.mapUint32Uint32, msg2.mapUint32Uint32);
|
||||
@ -2492,7 +2492,7 @@
|
||||
}
|
||||
|
||||
- (void)test_StringFieldsCopy {
|
||||
// ObjC conventions call for NSString properites to be copy, ensure
|
||||
// ObjC conventions call for NSString properties to be copy, ensure
|
||||
// that is done correctly and the string isn't simply retained.
|
||||
|
||||
Message2 *msg1 = [Message2 message];
|
||||
@ -2507,25 +2507,25 @@
|
||||
|
||||
XCTAssertEqualObjects(msg1.optionalString, mutableStr);
|
||||
XCTAssertEqualObjects(msg1.optionalString, @"foo");
|
||||
XCTAssertTrue(msg1.optionalString != mutableStr); // Ptr comparision.
|
||||
XCTAssertTrue(msg1.optionalString != mutableStr); // Ptr comparison.
|
||||
|
||||
XCTAssertEqualObjects(msg2.optionalString, mutableStr);
|
||||
XCTAssertEqualObjects(msg2.optionalString, @"foo");
|
||||
XCTAssertTrue(msg2.optionalString != mutableStr); // Ptr comparision.
|
||||
XCTAssertTrue(msg2.optionalString != mutableStr); // Ptr comparison.
|
||||
|
||||
[mutableStr appendString:@"bar"];
|
||||
|
||||
XCTAssertNotEqualObjects(msg1.optionalString, mutableStr);
|
||||
XCTAssertEqualObjects(msg1.optionalString, @"foo");
|
||||
XCTAssertTrue(msg1.optionalString != mutableStr); // Ptr comparision.
|
||||
XCTAssertTrue(msg1.optionalString != mutableStr); // Ptr comparison.
|
||||
|
||||
XCTAssertNotEqualObjects(msg2.optionalString, mutableStr);
|
||||
XCTAssertEqualObjects(msg2.optionalString, @"foo");
|
||||
XCTAssertTrue(msg2.optionalString != mutableStr); // Ptr comparision.
|
||||
XCTAssertTrue(msg2.optionalString != mutableStr); // Ptr comparison.
|
||||
}
|
||||
|
||||
- (void)test_BytesFieldsCopy {
|
||||
// ObjC conventions call for NSData properites to be copy, ensure
|
||||
// ObjC conventions call for NSData properties to be copy, ensure
|
||||
// that is done correctly and the data isn't simply retained.
|
||||
|
||||
Message2 *msg1 = [Message2 message];
|
||||
@ -2540,21 +2540,21 @@
|
||||
|
||||
XCTAssertEqualObjects(msg1.optionalBytes, mutableData);
|
||||
XCTAssertEqualObjects(msg1.optionalBytes, DataFromCStr("abc"));
|
||||
XCTAssertTrue(msg1.optionalBytes != mutableData); // Ptr comparision.
|
||||
XCTAssertTrue(msg1.optionalBytes != mutableData); // Ptr comparison.
|
||||
|
||||
XCTAssertEqualObjects(msg2.optionalBytes, mutableData);
|
||||
XCTAssertEqualObjects(msg2.optionalBytes, DataFromCStr("abc"));
|
||||
XCTAssertTrue(msg2.optionalBytes != mutableData); // Ptr comparision.
|
||||
XCTAssertTrue(msg2.optionalBytes != mutableData); // Ptr comparison.
|
||||
|
||||
[mutableData appendData:DataFromCStr("123")];
|
||||
|
||||
XCTAssertNotEqualObjects(msg1.optionalBytes, mutableData);
|
||||
XCTAssertEqualObjects(msg1.optionalBytes, DataFromCStr("abc"));
|
||||
XCTAssertTrue(msg1.optionalBytes != mutableData); // Ptr comparision.
|
||||
XCTAssertTrue(msg1.optionalBytes != mutableData); // Ptr comparison.
|
||||
|
||||
XCTAssertNotEqualObjects(msg2.optionalBytes, mutableData);
|
||||
XCTAssertEqualObjects(msg2.optionalBytes, DataFromCStr("abc"));
|
||||
XCTAssertTrue(msg2.optionalBytes != mutableData); // Ptr comparision.
|
||||
XCTAssertTrue(msg2.optionalBytes != mutableData); // Ptr comparison.
|
||||
}
|
||||
|
||||
#pragma mark - Subset from from map_tests.cc
|
||||
|
@ -1131,10 +1131,10 @@
|
||||
XCTAssertNotNil(message.a.iArray);
|
||||
XCTAssertFalse([message hasA]);
|
||||
GPBInt32Array *iArray = [message.a.iArray retain];
|
||||
XCTAssertEqual(iArray->_autocreator, message.a); // Pointer comparision
|
||||
XCTAssertEqual(iArray->_autocreator, message.a); // Pointer comparison
|
||||
message.a.iArray = [GPBInt32Array arrayWithValue:1];
|
||||
XCTAssertTrue([message hasA]);
|
||||
XCTAssertNotEqual(message.a.iArray, iArray); // Pointer comparision
|
||||
XCTAssertNotEqual(message.a.iArray, iArray); // Pointer comparison
|
||||
XCTAssertNil(iArray->_autocreator);
|
||||
[iArray release];
|
||||
}
|
||||
@ -1148,10 +1148,10 @@
|
||||
GPBAutocreatedArray *strArray =
|
||||
(GPBAutocreatedArray *)[message.a.strArray retain];
|
||||
XCTAssertTrue([strArray isKindOfClass:[GPBAutocreatedArray class]]);
|
||||
XCTAssertEqual(strArray->_autocreator, message.a); // Pointer comparision
|
||||
XCTAssertEqual(strArray->_autocreator, message.a); // Pointer comparison
|
||||
message.a.strArray = [NSMutableArray arrayWithObject:@"foo"];
|
||||
XCTAssertTrue([message hasA]);
|
||||
XCTAssertNotEqual(message.a.strArray, strArray); // Pointer comparision
|
||||
XCTAssertNotEqual(message.a.strArray, strArray); // Pointer comparison
|
||||
XCTAssertNil(strArray->_autocreator);
|
||||
[strArray release];
|
||||
}
|
||||
@ -1348,11 +1348,11 @@
|
||||
XCTAssertNotNil(message.a.iToI);
|
||||
XCTAssertFalse([message hasA]);
|
||||
GPBInt32Int32Dictionary *iToI = [message.a.iToI retain];
|
||||
XCTAssertEqual(iToI->_autocreator, message.a); // Pointer comparision
|
||||
XCTAssertEqual(iToI->_autocreator, message.a); // Pointer comparison
|
||||
message.a.iToI = [[[GPBInt32Int32Dictionary alloc] init] autorelease];
|
||||
[message.a.iToI setInt32:6 forKey:7];
|
||||
XCTAssertTrue([message hasA]);
|
||||
XCTAssertNotEqual(message.a.iToI, iToI); // Pointer comparision
|
||||
XCTAssertNotEqual(message.a.iToI, iToI); // Pointer comparison
|
||||
XCTAssertNil(iToI->_autocreator);
|
||||
[iToI release];
|
||||
}
|
||||
@ -1366,11 +1366,11 @@
|
||||
GPBAutocreatedDictionary *strToStr =
|
||||
(GPBAutocreatedDictionary *)[message.a.strToStr retain];
|
||||
XCTAssertTrue([strToStr isKindOfClass:[GPBAutocreatedDictionary class]]);
|
||||
XCTAssertEqual(strToStr->_autocreator, message.a); // Pointer comparision
|
||||
XCTAssertEqual(strToStr->_autocreator, message.a); // Pointer comparison
|
||||
message.a.strToStr =
|
||||
[NSMutableDictionary dictionaryWithObject:@"abc" forKey:@"def"];
|
||||
XCTAssertTrue([message hasA]);
|
||||
XCTAssertNotEqual(message.a.strToStr, strToStr); // Pointer comparision
|
||||
XCTAssertNotEqual(message.a.strToStr, strToStr); // Pointer comparison
|
||||
XCTAssertNil(strToStr->_autocreator);
|
||||
[strToStr release];
|
||||
}
|
||||
@ -1918,7 +1918,7 @@
|
||||
aTime = Time_SomethingElse;
|
||||
Time_IsValidValue(aTime);
|
||||
|
||||
// This block confirms the names in the decriptors is what we wanted.
|
||||
// This block confirms the names in the descriptors is what we wanted.
|
||||
|
||||
GPBEnumDescriptor *descriptor;
|
||||
NSString *valueName;
|
||||
|
@ -35,7 +35,7 @@
|
||||
//
|
||||
// This is just a compile test (here to make sure things never regress).
|
||||
//
|
||||
// Objective C++ can run into issues with how the NS_ENUM/CF_ENUM declartion
|
||||
// Objective C++ can run into issues with how the NS_ENUM/CF_ENUM declaration
|
||||
// works because of the C++ spec being used for that compilation unit. So
|
||||
// the fact that these imports all work without errors/warning means things
|
||||
// are still good.
|
||||
|
@ -276,7 +276,7 @@ class GPBBridgeTests: XCTestCase {
|
||||
msg5.optionalInt32 = 123
|
||||
msg.optional = msg5
|
||||
XCTAssertTrue(msg.hasOptionalMessage)
|
||||
// Modifing the autocreated doesn't replaced the explicit set one.
|
||||
// Modifying the autocreated doesn't replaced the explicit set one.
|
||||
autoCreated?.optionalInt32 = 456
|
||||
XCTAssertTrue(msg.hasOptionalMessage)
|
||||
XCTAssertTrue(msg.optional === msg5)
|
||||
|
@ -34,7 +34,7 @@ package protobuf_unittest;
|
||||
import "unittest_extension_chain_g.proto";
|
||||
|
||||
// The Root for this file should just be merging in the extensions from C's
|
||||
// Root (because G doens't define anything itself).
|
||||
// Root (because G doesn't define anything itself).
|
||||
|
||||
// The generated source will also have to directly import C's .h file so it can
|
||||
// compile the reference to C's Root class.
|
||||
|
@ -85,7 +85,7 @@ static zend_object *repeated_field_iter_create(zend_class_entry *ce TSRMLS_DC);
|
||||
#endif
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// RepeatedField creation/desctruction
|
||||
// RepeatedField creation/destruction
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
zend_class_entry* repeated_field_type;
|
||||
@ -484,7 +484,7 @@ PHP_METHOD(RepeatedField, getIterator) {
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// RepeatedFieldIter creation/desctruction
|
||||
// RepeatedFieldIter creation/destruction
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Define object free method.
|
||||
|
@ -153,7 +153,7 @@ static void map_field_write_dimension(zval *object, zval *key,
|
||||
zval *value TSRMLS_DC);
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// MapField creation/desctruction
|
||||
// MapField creation/destruction
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
zend_class_entry* map_field_type;
|
||||
@ -540,7 +540,7 @@ static zend_function_entry map_field_iter_methods[] = {
|
||||
};
|
||||
|
||||
// -----------------------------------------------------------------------------
|
||||
// MapFieldIter creation/desctruction
|
||||
// MapFieldIter creation/destruction
|
||||
// -----------------------------------------------------------------------------
|
||||
|
||||
// Define object free method.
|
||||
|
@ -106,8 +106,8 @@ PHP_PROTO_OBJECT_DTOR_END
|
||||
// Define object create method.
|
||||
PHP_PROTO_OBJECT_CREATE_START(MessageHeader, message)
|
||||
// Because php call this create func before calling the sub-message's
|
||||
// constructor defined in PHP, it's possible that the decriptor of this class
|
||||
// hasn't been added to descritpor pool (when the class is first
|
||||
// constructor defined in PHP, it's possible that the descriptor of this class
|
||||
// hasn't been added to descriptor pool (when the class is first
|
||||
// instantiated). In that case, we will defer the initialization of the custom
|
||||
// data to the parent Message's constructor, which will be called by
|
||||
// sub-message's constructors after the descriptor has been added.
|
||||
|
@ -9706,7 +9706,7 @@ static bool start_stringval(upb_json_parser *p) {
|
||||
} else if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL &&
|
||||
upb_fielddef_type(p->top->f) != UPB_TYPE_MESSAGE) {
|
||||
/* No need to push a frame -- numeric values in quotes remain in the
|
||||
* current parser frame. These values must accmulate so we can convert
|
||||
* current parser frame. These values must accumulate so we can convert
|
||||
* them all at once at the end. */
|
||||
multipart_startaccum(p);
|
||||
return true;
|
||||
|
@ -6378,7 +6378,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* Space optimization note: we store two pointers here that the JIT
|
||||
* doesn't need at all; the upb_handlers* inside the sink and
|
||||
* the dispatch table pointer. We can optimze so that the JIT uses
|
||||
* the dispatch table pointer. We can optimize so that the JIT uses
|
||||
* smaller stack frames than the interpreter. The only thing we need
|
||||
* to guarantee is that the fallback routines can find end_ofs. */
|
||||
upb_sink sink;
|
||||
@ -6455,7 +6455,7 @@ struct upb_pbdecoder {
|
||||
char residual[UPB_DECODER_MAX_RESIDUAL_BYTES];
|
||||
char *residual_end;
|
||||
|
||||
/* Bytes of data that should be discarded from the input beore we start
|
||||
/* Bytes of data that should be discarded from the input before we start
|
||||
* parsing again. We set this when we internally determine that we can
|
||||
* safely skip the next N bytes, but this region extends past the current
|
||||
* user buffer. */
|
||||
|
@ -1,6 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# Run this script to regenerate desriptor protos after the protocol compiler
|
||||
# Run this script to regenerate descriptor protos after the protocol compiler
|
||||
# changes.
|
||||
|
||||
if test ! -e src/google/protobuf/stubs/common.h; then
|
||||
|
@ -252,13 +252,13 @@ class Any extends \Google\Protobuf\Internal\Message
|
||||
* the method will create a message of the targeted type and fill it with
|
||||
* the decoded value in Any.
|
||||
* @return unpacked message
|
||||
* @throws \Exception Type url needs to be type.googleapis.com/fully-qulified.
|
||||
* @throws \Exception Type url needs to be type.googleapis.com/fully-qualified.
|
||||
* @throws \Exception Class hasn't been added to descriptor pool.
|
||||
* @throws \Exception cannot decode data in value field.
|
||||
*/
|
||||
public function unpack()
|
||||
{
|
||||
// Get fully qualifed name from type url.
|
||||
// Get fully qualified name from type url.
|
||||
$url_prifix_len = strlen(GPBUtil::TYPE_URL_PREFIX);
|
||||
if (substr($this->type_url, 0, $url_prifix_len) !=
|
||||
GPBUtil::TYPE_URL_PREFIX) {
|
||||
@ -296,7 +296,7 @@ class Any extends \Google\Protobuf\Internal\Message
|
||||
return;
|
||||
}
|
||||
|
||||
// Set value using serialzed message.
|
||||
// Set value using serialized message.
|
||||
$this->value = $msg->serializeToString();
|
||||
|
||||
// Set type url.
|
||||
|
@ -220,7 +220,7 @@ class CodedInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
* Read 32-bit unsiged integer to $var. If the buffer has less than 4 bytes,
|
||||
* Read 32-bit unsigned integer to $var. If the buffer has less than 4 bytes,
|
||||
* return false. Advance buffer with consumed bytes.
|
||||
* @param $var.
|
||||
*/
|
||||
@ -236,7 +236,7 @@ class CodedInputStream
|
||||
}
|
||||
|
||||
/**
|
||||
* Read 64-bit unsiged integer to $var. If the buffer has less than 8 bytes,
|
||||
* Read 64-bit unsigned integer to $var. If the buffer has less than 8 bytes,
|
||||
* return false. Advance buffer with consumed bytes.
|
||||
* @param $var.
|
||||
*/
|
||||
@ -283,7 +283,7 @@ class CodedInputStream
|
||||
}
|
||||
|
||||
$result = 0;
|
||||
// The larget tag is 2^29 - 1, which can be represented by int32.
|
||||
// The largest tag is 2^29 - 1, which can be represented by int32.
|
||||
$success = $this->readVarint32($result);
|
||||
if ($success) {
|
||||
return $result;
|
||||
|
@ -405,7 +405,7 @@ class GPBUtil
|
||||
|
||||
public static function parseTimestamp($timestamp)
|
||||
{
|
||||
// prevent parsing timestamps containing with the non-existant year "0000"
|
||||
// prevent parsing timestamps containing with the non-existent year "0000"
|
||||
// DateTime::createFromFormat parses without failing but as a nonsensical date
|
||||
if (substr($timestamp, 0, 4) === "0000") {
|
||||
throw new \Exception("Year cannot be zero.");
|
||||
|
@ -679,8 +679,8 @@ class Message
|
||||
* This method merges the contents of the specified message into the
|
||||
* current message. Singular fields that are set in the specified message
|
||||
* overwrite the corresponding fields in the current message. Repeated
|
||||
* fields are appended. Map fields key-value pairs are overritten.
|
||||
* Singular/Oneof sub-messages are recursively merged. All overritten
|
||||
* fields are appended. Map fields key-value pairs are overwritten.
|
||||
* Singular/Oneof sub-messages are recursively merged. All overwritten
|
||||
* sub-messages are deep-copied.
|
||||
*
|
||||
* @param object $msg Protobuf message to be merged from.
|
||||
|
@ -250,7 +250,7 @@ def cc_proto_library(
|
||||
include: a string indicating the include path of the .proto files.
|
||||
protoc: the label of the protocol compiler to generate the sources.
|
||||
internal_bootstrap_hack: a flag indicate the cc_proto_library is used only
|
||||
for bootstraping. When it is set to True, no files will be generated.
|
||||
for bootstrapping. When it is set to True, no files will be generated.
|
||||
The rule will simply be a provider for .proto files, so that other
|
||||
cc_proto_library can depend on it.
|
||||
use_grpc_plugin: a flag to indicate whether to call the grpc C++ plugin
|
||||
|
@ -228,7 +228,7 @@ message MethodDescriptorProto {
|
||||
// * For options which will be published and used publicly by multiple
|
||||
// independent entities, e-mail protobuf-global-extension-registry@google.com
|
||||
// to reserve extension numbers. Simply provide your project name (e.g.
|
||||
// Object-C plugin) and your porject website (if available) -- there's no need
|
||||
// Object-C plugin) and your project website (if available) -- there's no need
|
||||
// to explain how you intend to use them. Usually you only need one extension
|
||||
// number. You can declare multiple options with only one extension number by
|
||||
// putting them in a sub-message. See the Custom Options section of the docs
|
||||
|
@ -321,7 +321,7 @@ message Aggregate {
|
||||
}
|
||||
|
||||
// Allow Aggregate to be used as an option at all possible locations
|
||||
// in the .proto grammer.
|
||||
// in the .proto grammar.
|
||||
extend google.protobuf.FileOptions { optional Aggregate fileopt = 15478479; }
|
||||
extend google.protobuf.MessageOptions { optional Aggregate msgopt = 15480088; }
|
||||
extend google.protobuf.FieldOptions { optional Aggregate fieldopt = 15481374; }
|
||||
|
@ -43,7 +43,7 @@ package protobuf_unittest_import;
|
||||
|
||||
option optimize_for = SPEED;
|
||||
|
||||
// Excercise the java_package option.
|
||||
// Exercise the java_package option.
|
||||
option java_package = "com.google.protobuf.test";
|
||||
|
||||
// Do not set a java_outer_classname here to verify that Proto2 works without
|
||||
|
@ -12,7 +12,7 @@ TEST_VERSION=2.5.0
|
||||
# The old version of protobuf that we are testing compatibility against. This
|
||||
# is usually the same as TEST_VERSION (i.e., we use the tests extracted from
|
||||
# that version to test compatibility of the newest runtime against it), but it
|
||||
# is also possible to use this same test set to test the compatibiilty of the
|
||||
# is also possible to use this same test set to test the compatibility of the
|
||||
# latest version against other versions.
|
||||
OLD_VERSION=$1
|
||||
OLD_VERSION_PROTOC=http://repo1.maven.org/maven2/com/google/protobuf/protoc/$OLD_VERSION/protoc-$OLD_VERSION-linux-x86_64.exe
|
||||
|
@ -148,7 +148,7 @@ class GeneratorTest(unittest.TestCase):
|
||||
proto = unittest_custom_options_pb2.TestMessageWithCustomOptions()
|
||||
enum_options = proto.DESCRIPTOR.enum_types_by_name['AnEnum'].GetOptions()
|
||||
self.assertTrue(enum_options is not None)
|
||||
# TODO(gps): We really should test for the presense of the enum_opt1
|
||||
# TODO(gps): We really should test for the presence of the enum_opt1
|
||||
# extension and for its value to be set to -789.
|
||||
|
||||
def testNestedTypes(self):
|
||||
|
@ -118,7 +118,7 @@ class FooUnitTest(unittest.TestCase):
|
||||
rpc_controller = 'controller'
|
||||
request = 'request'
|
||||
|
||||
# GetDescriptor now static, still works as instance method for compatability
|
||||
# GetDescriptor now static, still works as instance method for compatibility
|
||||
self.assertEqual(unittest_pb2.TestService_Stub.GetDescriptor(),
|
||||
stub.GetDescriptor())
|
||||
|
||||
|
@ -247,7 +247,7 @@ class TextFormatTest(unittest.TestCase):
|
||||
text = text.replace('e+0','e+').replace('e+0','e+') \
|
||||
.replace('e-0','e-').replace('e-0','e-')
|
||||
# Floating point fields are printed with .0 suffix even if they are
|
||||
# actualy integer numbers.
|
||||
# actually integer numbers.
|
||||
text = re.compile(r'\.0$', re.MULTILINE).sub('', text)
|
||||
return text
|
||||
|
||||
|
@ -186,7 +186,7 @@ class _NestedDescriptorBase(DescriptorBase):
|
||||
file.serialized_pb that describes this descriptor.
|
||||
serialized_end: The end index (exclusive) in block in the
|
||||
file.serialized_pb that describes this descriptor.
|
||||
serialized_options: Protocol message serilized options or None.
|
||||
serialized_options: Protocol message serialized options or None.
|
||||
"""
|
||||
super(_NestedDescriptorBase, self).__init__(
|
||||
options, serialized_options, options_class_name)
|
||||
@ -753,7 +753,7 @@ class ServiceDescriptor(_NestedDescriptorBase):
|
||||
name: (str) Name of the service.
|
||||
full_name: (str) Full name of the service, including package name.
|
||||
index: (int) 0-indexed index giving the order that this services
|
||||
definition appears withing the .proto file.
|
||||
definition appears within the .proto file.
|
||||
methods: (list of MethodDescriptor) List of methods provided by this
|
||||
service.
|
||||
methods_by_name: (dict str -> MethodDescriptor) Same MethodDescriptor
|
||||
|
@ -639,7 +639,7 @@ class DescriptorPool(object):
|
||||
return list(self._extensions_by_number[message_descriptor].values())
|
||||
|
||||
def _TryLoadExtensionFromDB(self, message_descriptor, number):
|
||||
"""Try to Load extensions from decriptor db.
|
||||
"""Try to Load extensions from descriptor db.
|
||||
|
||||
Args:
|
||||
message_descriptor: descriptor of the extended message.
|
||||
@ -1034,7 +1034,7 @@ class DescriptorPool(object):
|
||||
|
||||
Args:
|
||||
field_proto: Data about the field in proto format.
|
||||
field_desc: The descriptor to modiy.
|
||||
field_desc: The descriptor to modify.
|
||||
package: The package the field's container is in.
|
||||
scope: Enclosing scope of available types.
|
||||
"""
|
||||
|
@ -139,7 +139,7 @@ class _ExtensionDict(object):
|
||||
|
||||
# Note that this is only meaningful for non-repeated, scalar extension
|
||||
# fields. Note also that we may have to call _Modified() when we do
|
||||
# successfully set a field this way, to set any necssary "has" bits in the
|
||||
# successfully set a field this way, to set any necessary "has" bits in the
|
||||
# ancestors of the extended message.
|
||||
def __setitem__(self, extension_handle, value):
|
||||
"""If extension_handle specifies a non-repeated, scalar extension
|
||||
|
@ -97,7 +97,7 @@ class TextFormatBase(unittest.TestCase):
|
||||
text = text.replace('e+0','e+').replace('e+0','e+') \
|
||||
.replace('e-0','e-').replace('e-0','e-')
|
||||
# Floating point fields are printed with .0 suffix even if they are
|
||||
# actualy integer numbers.
|
||||
# actually integer numbers.
|
||||
text = re.compile(r'\.0$', re.MULTILINE).sub('', text)
|
||||
return text
|
||||
|
||||
|
@ -38,7 +38,7 @@ TYPE_TO_BYTE_SIZE_FN: A dictionary with field types and a size computing
|
||||
TYPE_TO_SERIALIZE_METHOD: A dictionary with field types and serialization
|
||||
function.
|
||||
FIELD_TYPE_TO_WIRE_TYPE: A dictionary with field typed and their
|
||||
coresponding wire types.
|
||||
corresponding wire types.
|
||||
TYPE_TO_DESERIALIZE_METHOD: A dictionary with field types and deserialization
|
||||
function.
|
||||
"""
|
||||
|
@ -265,7 +265,7 @@ class _Printer(object):
|
||||
else:
|
||||
name = field.json_name
|
||||
if name in js:
|
||||
# Skip the field which has been serailized already.
|
||||
# Skip the field which has been serialized already.
|
||||
continue
|
||||
if _IsMapEntry(field):
|
||||
js[name] = {}
|
||||
|
@ -481,7 +481,7 @@ static PyObject* GetFile(PyBaseDescriptor *self, void *closure) {
|
||||
}
|
||||
|
||||
static PyObject* GetConcreteClass(PyBaseDescriptor* self, void *closure) {
|
||||
// Retuns the canonical class for the given descriptor.
|
||||
// Returns the canonical class for the given descriptor.
|
||||
// This is the class that was registered with the primary descriptor pool
|
||||
// which contains this descriptor.
|
||||
// This might not be the one you expect! For example the returned object does
|
||||
|
@ -246,7 +246,7 @@ static PyObject* GetWireType(PyUnknownFieldRef* self, void *closure) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
// Assign a default value to suppress may-unintialized warnings (errors
|
||||
// Assign a default value to suppress may-uninitialized warnings (errors
|
||||
// when built in some places).
|
||||
WireFormatLite::WireType wire_type = WireFormatLite::WIRETYPE_VARINT;
|
||||
switch (unknown_field->type()) {
|
||||
|
@ -705,7 +705,7 @@ class MockMethod(object):
|
||||
"""Move this method into group of calls which may be called multiple times.
|
||||
|
||||
A group of repeating calls must be defined together, and must be executed in
|
||||
full before the next expected mehtod can be called.
|
||||
full before the next expected method can be called.
|
||||
|
||||
Args:
|
||||
group_name: the name of the unordered group.
|
||||
|
@ -1,5 +1,5 @@
|
||||
# Protobuf Ruby Compatibility Tests
|
||||
|
||||
This drectory contains a snapshot of protobuf ruby 3.0.0 unittest code and
|
||||
This directory contains a snapshot of protobuf ruby 3.0.0 unittest code and
|
||||
test scripts used to verifies whether the latest version of protobuf is
|
||||
still compatible with 3.0.0 generated code.
|
||||
|
@ -136,7 +136,7 @@ static void rewrite_enum_default(const upb_symtab* symtab,
|
||||
* same number.
|
||||
*
|
||||
* Here we do a pass over all enum defaults and rewrite numeric defaults by
|
||||
* looking up their labels. This is compilcated by the fact that the enum
|
||||
* looking up their labels. This is complicated by the fact that the enum
|
||||
* definition can live in either the symtab or the file_proto.
|
||||
* */
|
||||
static void rewrite_enum_defaults(
|
||||
@ -572,7 +572,7 @@ VALUE Descriptor_file_descriptor(VALUE _self) {
|
||||
* call-seq:
|
||||
* Descriptor.name => name
|
||||
*
|
||||
* Returns the name of this message type as a fully-qualfied string (e.g.,
|
||||
* Returns the name of this message type as a fully-qualified string (e.g.,
|
||||
* My.Package.MessageType).
|
||||
*/
|
||||
VALUE Descriptor_name(VALUE _self) {
|
||||
|
@ -9697,7 +9697,7 @@ static bool start_stringval(upb_json_parser *p) {
|
||||
} else if (upb_fielddef_type(p->top->f) != UPB_TYPE_BOOL &&
|
||||
upb_fielddef_type(p->top->f) != UPB_TYPE_MESSAGE) {
|
||||
/* No need to push a frame -- numeric values in quotes remain in the
|
||||
* current parser frame. These values must accmulate so we can convert
|
||||
* current parser frame. These values must accumulate so we can convert
|
||||
* them all at once at the end. */
|
||||
multipart_startaccum(p);
|
||||
return true;
|
||||
|
@ -6368,7 +6368,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
/* Space optimization note: we store two pointers here that the JIT
|
||||
* doesn't need at all; the upb_handlers* inside the sink and
|
||||
* the dispatch table pointer. We can optimze so that the JIT uses
|
||||
* the dispatch table pointer. We can optimize so that the JIT uses
|
||||
* smaller stack frames than the interpreter. The only thing we need
|
||||
* to guarantee is that the fallback routines can find end_ofs. */
|
||||
upb_sink sink;
|
||||
@ -6445,7 +6445,7 @@ struct upb_pbdecoder {
|
||||
char residual[UPB_DECODER_MAX_RESIDUAL_BYTES];
|
||||
char *residual_end;
|
||||
|
||||
/* Bytes of data that should be discarded from the input beore we start
|
||||
/* Bytes of data that should be discarded from the input before we start
|
||||
* parsing again. We set this when we internally determine that we can
|
||||
* safely skip the next N bytes, but this region extends past the current
|
||||
* user buffer. */
|
||||
|
@ -85,7 +85,7 @@ public class RubyDescriptor extends RubyObject {
|
||||
* call-seq:
|
||||
* Descriptor.name => name
|
||||
*
|
||||
* Returns the name of this message type as a fully-qualfied string (e.g.,
|
||||
* Returns the name of this message type as a fully-qualified string (e.g.,
|
||||
* My.Package.MessageType).
|
||||
*/
|
||||
@JRubyMethod(name = "name")
|
||||
|
@ -60,7 +60,7 @@ struct ExpectedOutput {
|
||||
// directory.
|
||||
void AddFile(const std::string& filename, const std::string& data);
|
||||
|
||||
// Runs proto compiler. Captures proto file structrue in FileDescriptorProto.
|
||||
// Runs proto compiler. Captures proto file structure in FileDescriptorProto.
|
||||
// Files will be generated in TestTempDir() folder. Callers of this
|
||||
// function must read generated files themselves.
|
||||
//
|
||||
|
@ -50,7 +50,7 @@ bool CodeGenerator::GenerateAll(const std::vector<const FileDescriptor*>& files,
|
||||
const std::string& parameter,
|
||||
GeneratorContext* generator_context,
|
||||
std::string* error) const {
|
||||
// Default implemenation is just to call the per file method, and prefix any
|
||||
// Default implementation is just to call the per file method, and prefix any
|
||||
// error string with the file to provide context.
|
||||
bool succeeded = true;
|
||||
for (int i = 0; i < files.size(); i++) {
|
||||
|
@ -2280,7 +2280,7 @@ namespace {
|
||||
// Nested Messages:
|
||||
// Note that it only stores the nested message type, iff the nested type is
|
||||
// either a direct child of the given descriptor, or the nested type is a
|
||||
// decendent of the given descriptor and all the nodes between the
|
||||
// descendant of the given descriptor and all the nodes between the
|
||||
// nested type and the given descriptor are group types. e.g.
|
||||
//
|
||||
// message Foo {
|
||||
|
@ -97,7 +97,7 @@ class DiskSourceTree; // importer.h
|
||||
// protoc --cpp_out=outdir --foo_out=outdir --proto_path=src src/foo.proto
|
||||
//
|
||||
// The .proto file to compile can be specified on the command line using either
|
||||
// its physical file path, or a virtual path relative to a diretory specified
|
||||
// its physical file path, or a virtual path relative to a directory specified
|
||||
// in --proto_path. For example, for src/foo.proto, the following two protoc
|
||||
// invocations work the same way:
|
||||
// 1. protoc --proto_path=src src/foo.proto (physical file path)
|
||||
@ -194,7 +194,7 @@ class PROTOC_EXPORT CommandLineInterface {
|
||||
// DEPRECATED. Calling this method has no effect. Protocol compiler now
|
||||
// always try to find the .proto file relative to the current directory
|
||||
// first and if the file is not found, it will then treat the input path
|
||||
// as a virutal path.
|
||||
// as a virtual path.
|
||||
void SetInputsAreProtoPathRelative(bool /* enable */) {}
|
||||
|
||||
// Provides some text which will be printed when the --version flag is
|
||||
|
@ -1074,7 +1074,7 @@ TEST_F(CommandLineInterfaceTest, UnrecognizedExtraParameters) {
|
||||
}
|
||||
|
||||
TEST_F(CommandLineInterfaceTest, ExtraPluginParametersForOutParameters) {
|
||||
// This doesn't rely on the plugin having been registred and instead that
|
||||
// This doesn't rely on the plugin having been registered and instead that
|
||||
// the existence of --[name]_out is enough to make the --[name]_opt valid.
|
||||
// However, running out of process plugins found via the search path (i.e. -
|
||||
// not pre registered with --plugin) isn't support in this test suite, so we
|
||||
|
@ -1185,7 +1185,7 @@ void FileGenerator::GenerateForwardDeclarations(io::Printer* printer) {
|
||||
FlattenMessagesInFile(file_, &classes); // All messages need forward decls.
|
||||
|
||||
if (options_.proto_h) { // proto.h needs extra forward declarations.
|
||||
// All classes / enums refered to as field members
|
||||
// All classes / enums referred to as field members
|
||||
std::vector<const FieldDescriptor*> fields;
|
||||
ListAllFields(file_, &fields);
|
||||
for (int i = 0; i < fields.size(); i++) {
|
||||
|
@ -148,7 +148,7 @@ class FileGenerator {
|
||||
// Generates extension identifiers.
|
||||
void GenerateExtensionIdentifiers(io::Printer* printer);
|
||||
|
||||
// Generates inline function defintions.
|
||||
// Generates inline function definitions.
|
||||
void GenerateInlineFunctionDefinitions(io::Printer* printer);
|
||||
|
||||
void GenerateProto2NamespaceEnumSpecializations(io::Printer* printer);
|
||||
|
@ -232,7 +232,7 @@ bool HasPrivateHasMethod(const FieldDescriptor* field) {
|
||||
}
|
||||
|
||||
// TODO(ckennelly): Cull these exclusions if/when these protos do not have
|
||||
// their methods overriden by subclasses.
|
||||
// their methods overridden by subclasses.
|
||||
|
||||
bool ShouldMarkClassAsFinal(const Descriptor* descriptor,
|
||||
const Options& options) {
|
||||
|
@ -254,7 +254,7 @@ class PROTOBUF_EXPORT DiskSourceTree : public SourceTree {
|
||||
// and then you do:
|
||||
// Open("bar/qux");
|
||||
// the DiskSourceTree will first try to open foo/bar/qux, then baz/bar/qux,
|
||||
// returning the first one that opens successfuly.
|
||||
// returning the first one that opens successfully.
|
||||
//
|
||||
// disk_path may be an absolute path or relative to the current directory,
|
||||
// just like a path you'd pass to open().
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user