Commit 99a81d29 authored by Jon Skeet's avatar Jon Skeet

Fix build warnings around unused variables

parent dc80689a
......@@ -39,6 +39,7 @@ namespace Google.Protobuf
{
public class FieldCodecTest
{
#pragma warning disable 0414 // Used by tests via reflection - do not remove!
private static readonly List<ICodecTestData> Codecs = new List<ICodecTestData>
{
new FieldCodecTestData<bool>(FieldCodec.ForBool(100), true, "Bool"),
......@@ -61,6 +62,7 @@ namespace Google.Protobuf
new FieldCodecTestData<ForeignMessage>(
FieldCodec.ForMessage(100, ForeignMessage.Parser), new ForeignMessage { C = 10 }, "Message"),
};
#pragma warning restore 0414
[Test, TestCaseSource("Codecs")]
public void RoundTripWithTag(ICodecTestData codec)
......
......@@ -49,8 +49,7 @@ namespace Google.Protobuf
ItemField message = new ItemField { Item = 3 };
FieldDescriptor field = ItemField.Descriptor.FindFieldByName("item");
Assert.NotNull(field);
// TODO(jonskeet): Reflection...
// Assert.AreEqual(3, (int)message[field]);
Assert.AreEqual(3, (int)field.Accessor.GetValue(message));
}
[Test]
......
......@@ -739,7 +739,6 @@ namespace Google.Protobuf
private const string Hex = "0123456789abcdef";
private static void HexEncodeUtf16CodeUnit(StringBuilder builder, char c)
{
uint utf16 = c;
builder.Append("\\u");
builder.Append(Hex[(c >> 12) & 0xf]);
builder.Append(Hex[(c >> 8) & 0xf]);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment