Index: third_party/grpc/src/csharp/Grpc.Core.Tests/Internal/ChannelArgsSafeHandleTest.cs |
diff --git a/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs b/third_party/grpc/src/csharp/Grpc.Core.Tests/Internal/ChannelArgsSafeHandleTest.cs |
similarity index 61% |
copy from third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs |
copy to third_party/grpc/src/csharp/Grpc.Core.Tests/Internal/ChannelArgsSafeHandleTest.cs |
index e547d834986de8d80703504469e9c39b3d8ae93d..af0aaa5f0129e922b623296584cdc4643851fa9b 100644 |
--- a/third_party/protobuf/csharp/src/Google.Protobuf/Reflection/PackageDescriptor.cs |
+++ b/third_party/grpc/src/csharp/Grpc.Core.Tests/Internal/ChannelArgsSafeHandleTest.cs |
@@ -1,7 +1,7 @@ |
#region Copyright notice and license |
-// Protocol Buffers - Google's data interchange format |
-// Copyright 2008 Google Inc. All rights reserved. |
-// https://developers.google.com/protocol-buffers/ |
+ |
+// Copyright 2015, Google Inc. |
+// All rights reserved. |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,41 +28,48 @@ |
// 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 |
-namespace Google.Protobuf.Reflection |
+using System; |
+using Grpc.Core; |
+using Grpc.Core.Internal; |
+using Grpc.Core.Utils; |
+using NUnit.Framework; |
+ |
+namespace Grpc.Core.Internal.Tests |
{ |
- /// <summary> |
- /// Represents a package in the symbol table. We use PackageDescriptors |
- /// just as placeholders so that someone cannot define, say, a message type |
- /// that has the same name as an existing package. |
- /// </summary> |
- internal sealed class PackageDescriptor : IDescriptor |
+ public class ChannelArgsSafeHandleTest |
{ |
- private readonly string name; |
- private readonly string fullName; |
- private readonly FileDescriptor file; |
- |
- internal PackageDescriptor(string name, string fullName, FileDescriptor file) |
+ [Test] |
+ public void CreateEmptyAndDestroy() |
{ |
- this.file = file; |
- this.fullName = fullName; |
- this.name = name; |
+ var channelArgs = ChannelArgsSafeHandle.Create(0); |
+ channelArgs.Dispose(); |
} |
- public string Name |
+ [Test] |
+ public void CreateNonEmptyAndDestroy() |
{ |
- get { return name; } |
+ var channelArgs = ChannelArgsSafeHandle.Create(5); |
+ channelArgs.Dispose(); |
} |
- public string FullName |
+ [Test] |
+ public void CreateNullAndDestroy() |
{ |
- get { return fullName; } |
+ var channelArgs = ChannelArgsSafeHandle.CreateNull(); |
+ channelArgs.Dispose(); |
} |
- public FileDescriptor File |
+ [Test] |
+ public void CreateFillAndDestroy() |
{ |
- get { return file; } |
+ var channelArgs = ChannelArgsSafeHandle.Create(3); |
+ channelArgs.SetInteger(0, "somekey", 12345); |
+ channelArgs.SetString(1, "somekey", "abcdefghijkl"); |
+ channelArgs.SetString(2, "somekey", "XYZ"); |
+ channelArgs.Dispose(); |
} |
} |
-} |
+} |