From f79d213e508e5718b1c7ecd9a55b0178cfdc4ad9 Mon Sep 17 00:00:00 2001 From: Christopher Warrington Date: Wed, 20 Apr 2016 14:22:50 -0700 Subject: [PATCH] Make C# warnings fail the build * Treat warnings as errors * Fix existing warning in Core tests --- cs/build/Common.Internal.props | 4 +- cs/test/core/CustomBondedTests.cs | 64 +++++++++++++++---------------- cs/test/core/Equal.cs | 12 +++--- 3 files changed, 40 insertions(+), 40 deletions(-) diff --git a/cs/build/Common.Internal.props b/cs/build/Common.Internal.props index d4f63dd33d..1ed0c2c437 100644 --- a/cs/build/Common.Internal.props +++ b/cs/build/Common.Internal.props @@ -24,6 +24,7 @@ 512 11.0 1591 + true false @@ -54,5 +55,4 @@ $(DELAY_SIGN_KEY) $(DefineConstants);DELAY_SIGN - - + diff --git a/cs/test/core/CustomBondedTests.cs b/cs/test/core/CustomBondedTests.cs index 4e9d4e3c78..487a0013aa 100644 --- a/cs/test/core/CustomBondedTests.cs +++ b/cs/test/core/CustomBondedTests.cs @@ -108,47 +108,47 @@ public static CustomBonded From(TActual instance) { return new CustomBondedPoly(instance); } + } - internal class CustomBondedPoly : CustomBonded, IBonded - { - public new static readonly CustomBonded Empty = new CustomBondedPoly(GenericFactory.Create()); + internal class CustomBondedPoly : CustomBonded, IBonded + { + public new static readonly CustomBonded Empty = new CustomBondedPoly(GenericFactory.Create()); - private readonly TActual instance; + private readonly TActual instance; - public CustomBondedPoly(TActual instance) - { - this.instance = instance; - } + public CustomBondedPoly(TActual instance) + { + this.instance = instance; + } - public override T Value - { - get { return Deserialize(); } - } + public override T Value + { + get { return Deserialize(); } + } - public T Deserialize() - { - return CustomTransformFactory.Instance.Cloner().Clone(instance); - } + public T Deserialize() + { + return CustomTransformFactory.Instance.Cloner().Clone(instance); + } - public void Serialize(W writer) - { - CustomTransformFactory.Instance.Serializer().Serialize(instance, writer); - } + public void Serialize(W writer) + { + CustomTransformFactory.Instance.Serializer().Serialize(instance, writer); + } - public U Deserialize() - { - return CustomTransformFactory.Instance.Cloner().Clone(instance); - } + public U Deserialize() + { + return CustomTransformFactory.Instance.Cloner().Clone(instance); + } - IBonded IBonded.Convert() - { - return this as IBonded; - } + IBonded IBonded.Convert() + { + return this as IBonded; + } - public override CustomBonded Convert() - { - return new CustomBondedPoly(instance); - } + public override CustomBonded Convert() + { + return new CustomBondedPoly(instance); } } diff --git a/cs/test/core/Equal.cs b/cs/test/core/Equal.cs index 88dbcbf423..5c16d7497a 100644 --- a/cs/test/core/Equal.cs +++ b/cs/test/core/Equal.cs @@ -158,12 +158,12 @@ public static bool IsEqual(this T left, T right) where T : class var equal = comparerEqual.MakeGenericMethod(right.GetType()); var result = (bool)equal.Invoke(null, new object[] { left, right }); - if (!result) - { - // Set breakpoint here to debug unequal test failure - var strLeft = Util.SerializeXmlString(left); - var strRight = Util.SerializeXmlString(right); - } + // Uncomment this block and set breakpoint here to debug unequal test failure + //if (!result) + //{ + // var strLeft = Util.SerializeXmlString(left); + // var strRight = Util.SerializeXmlString(right); + //} return result; }