Skip to content

Commit

Permalink
Rebase on protocolbuffers#6938. Remove redundant unit test and just k…
Browse files Browse the repository at this point in the history
…eep the code to remove repeated depended files.
  • Loading branch information
owent committed Apr 14, 2020
1 parent 95e4c28 commit 0a09952
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions csharp/src/Google.Protobuf.Test/ExtensionSetTest.cs
Expand Up @@ -98,18 +98,5 @@ public void TestClone()
Assert.AreEqual(message, other);
Assert.AreEqual(message.CalculateSize(), message.CalculateSize());
}

[Test]
public void TestImportedMultipleTImes()
{
var descriptor = UnittestWithExtension1Proto3Reflection.Descriptor.FindTypeByName<Google.Protobuf.Reflection.MessageDescriptor>("TestMessageWithExtension1");

Assert.IsNotNull(descriptor);
var extensionData = descriptor.GetOption(UnittestImportExtensionProto3Extensions.UnittestExtension);
Assert.IsNotNull(extensionData);

Assert.AreEqual(extensionData, "TestMessageWithExtension1");
Assert.AreEqual(descriptor.Name, "TestMessageWithExtension1");
}
}
}
2 changes: 1 addition & 1 deletion csharp/src/Google.Protobuf/Reflection/FileDescriptor.cs
Expand Up @@ -448,7 +448,7 @@ private void CrossLink()

private static IEnumerable<Extension> GetAllExtensions(FileDescriptor[] dependencies, GeneratedClrTypeInfo generatedInfo)
{
return dependencies.SelectMany(GetAllDependedExtensions).Distinct(ExtensionRegistry.ExtensionComparer.Instance).Concat(GetAllGeneratedExtensions(generatedInfo));
return BuildDependedFileDescriptors(dependencies).SelectMany(GetAllDependedExtensions).Distinct(ExtensionRegistry.ExtensionComparer.Instance).Concat(GetAllGeneratedExtensions(generatedInfo));
}

private static IEnumerable<FileDescriptor> BuildDependedFileDescriptors(IEnumerable<FileDescriptor> dependencies)
Expand Down

0 comments on commit 0a09952

Please sign in to comment.