From a1625a54104da7872c15618db9e68656c6f6ec2a Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Fri, 8 Feb 2008 17:54:30 +0000 Subject: * Applying mantis 339 patches round 2 -- Thanks daedius --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 52 +++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 OpenSim/Tests/Common/DoubleToleranceConstraint.cs (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs new file mode 100644 index 0000000..f3da236 --- /dev/null +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -0,0 +1,52 @@ +using System; +using NUnit.Framework; +using NUnit.Framework.Constraints; +using OpenSim.Tests.Common; + +namespace OpenSim.Tests.Common +{ + public class DoubleToleranceConstraint : ANumericalToleranceConstraint + { + + private double _baseValue; + private double _valueToBeTested; + + public DoubleToleranceConstraint(double baseValue, double tolerance) : base(tolerance) + { + _baseValue = baseValue; + } + + /// + ///Test whether the constraint is satisfied by a given value + /// + ///The value to be tested + /// + ///True for success, false for failure + /// + public override bool Matches(object valueToBeTested) + { + if (valueToBeTested == null) + { + throw new ArgumentException("Constraint cannot be used upon null values."); + } + if( valueToBeTested.GetType() != typeof(double)) + { + throw new ArgumentException("Constraint cannot be used upon non double-values."); + } + + _valueToBeTested = (double)valueToBeTested; + + return IsWithinDoubleConstraint(_valueToBeTested, _baseValue ); + } + + public override void WriteDescriptionTo(MessageWriter writer) + { + writer.WriteExpectedValue(string.Format("A value {0} within tolerance of plus or minus {1}",_baseValue,_tolerance)); + } + + public override void WriteActualValueTo(MessageWriter writer) + { + writer.WriteActualValue(_valueToBeTested); + } + } +} -- cgit v1.1 From 24ac86931a79b3968c5c6c00f93bb92bf967ea75 Mon Sep 17 00:00:00 2001 From: Justin Clarke Casey Date: Fri, 8 Feb 2008 18:18:56 +0000 Subject: update eol-style --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 104 +++++++++++----------- 1 file changed, 52 insertions(+), 52 deletions(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index f3da236..eb71aeb 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -1,52 +1,52 @@ -using System; -using NUnit.Framework; -using NUnit.Framework.Constraints; -using OpenSim.Tests.Common; - -namespace OpenSim.Tests.Common -{ - public class DoubleToleranceConstraint : ANumericalToleranceConstraint - { - - private double _baseValue; - private double _valueToBeTested; - - public DoubleToleranceConstraint(double baseValue, double tolerance) : base(tolerance) - { - _baseValue = baseValue; - } - - /// - ///Test whether the constraint is satisfied by a given value - /// - ///The value to be tested - /// - ///True for success, false for failure - /// - public override bool Matches(object valueToBeTested) - { - if (valueToBeTested == null) - { - throw new ArgumentException("Constraint cannot be used upon null values."); - } - if( valueToBeTested.GetType() != typeof(double)) - { - throw new ArgumentException("Constraint cannot be used upon non double-values."); - } - - _valueToBeTested = (double)valueToBeTested; - - return IsWithinDoubleConstraint(_valueToBeTested, _baseValue ); - } - - public override void WriteDescriptionTo(MessageWriter writer) - { - writer.WriteExpectedValue(string.Format("A value {0} within tolerance of plus or minus {1}",_baseValue,_tolerance)); - } - - public override void WriteActualValueTo(MessageWriter writer) - { - writer.WriteActualValue(_valueToBeTested); - } - } -} +using System; +using NUnit.Framework; +using NUnit.Framework.Constraints; +using OpenSim.Tests.Common; + +namespace OpenSim.Tests.Common +{ + public class DoubleToleranceConstraint : ANumericalToleranceConstraint + { + + private double _baseValue; + private double _valueToBeTested; + + public DoubleToleranceConstraint(double baseValue, double tolerance) : base(tolerance) + { + _baseValue = baseValue; + } + + /// + ///Test whether the constraint is satisfied by a given value + /// + ///The value to be tested + /// + ///True for success, false for failure + /// + public override bool Matches(object valueToBeTested) + { + if (valueToBeTested == null) + { + throw new ArgumentException("Constraint cannot be used upon null values."); + } + if( valueToBeTested.GetType() != typeof(double)) + { + throw new ArgumentException("Constraint cannot be used upon non double-values."); + } + + _valueToBeTested = (double)valueToBeTested; + + return IsWithinDoubleConstraint(_valueToBeTested, _baseValue ); + } + + public override void WriteDescriptionTo(MessageWriter writer) + { + writer.WriteExpectedValue(string.Format("A value {0} within tolerance of plus or minus {1}",_baseValue,_tolerance)); + } + + public override void WriteActualValueTo(MessageWriter writer) + { + writer.WriteActualValue(_valueToBeTested); + } + } +} -- cgit v1.1 From 3b9d332f84c5107b09fcbbdccc2ca96b293fd248 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Sun, 17 Feb 2008 01:16:40 +0000 Subject: Added copyright notices. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 28 +++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index eb71aeb..29b808d 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -1,3 +1,31 @@ +/* +* Copyright (c) Contributors, http://opensimulator.org/ +* See CONTRIBUTORS.TXT for a full list of copyright holders. +* +* Redistribution and use in source and binary forms, with or without +* modification, are permitted provided that the following conditions are met: +* * Redistributions of source code must retain the above copyright +* notice, this list of conditions and the following disclaimer. +* * Redistributions in binary form must reproduce the above copyright +* notice, this list of conditions and the following disclaimer in the +* documentation and/or other materials provided with the distribution. +* * Neither the name of the OpenSim Project nor the +* names of its contributors may be used to endorse or promote products +* derived from this software without specific prior written permission. +* +* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY +* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +* ON ANY 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. +* +*/ + using System; using NUnit.Framework; using NUnit.Framework.Constraints; -- cgit v1.1 From 47180080f0f4b93c60232b47ca4e093bd7c73a1d Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Tue, 18 Mar 2008 05:16:43 +0000 Subject: Formatting cleanup. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 52 +++++++++++------------ 1 file changed, 25 insertions(+), 27 deletions(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index 29b808d..834d1a3 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -1,30 +1,29 @@ /* -* Copyright (c) Contributors, http://opensimulator.org/ -* See CONTRIBUTORS.TXT for a full list of copyright holders. -* -* Redistribution and use in source and binary forms, with or without -* modification, are permitted provided that the following conditions are met: -* * Redistributions of source code must retain the above copyright -* notice, this list of conditions and the following disclaimer. -* * Redistributions in binary form must reproduce the above copyright -* notice, this list of conditions and the following disclaimer in the -* documentation and/or other materials provided with the distribution. -* * Neither the name of the OpenSim Project nor the -* names of its contributors may be used to endorse or promote products -* derived from this software without specific prior written permission. -* -* THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY -* EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED -* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE -* DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY -* DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES -* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; -* LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND -* ON ANY 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. -* -*/ + * Copyright (c) Contributors, http://opensimulator.org/ + * See CONTRIBUTORS.TXT for a full list of copyright holders. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions are met: + * * Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. + * * Redistributions in binary form must reproduce the above copyright + * notice, this list of conditions and the following disclaimer in the + * documentation and/or other materials provided with the distribution. + * * Neither the name of the OpenSim Project nor the + * names of its contributors may be used to endorse or promote products + * derived from this software without specific prior written permission. + * + * THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS'' AND ANY + * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED + * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY + * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; + * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND + * ON ANY 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. + */ using System; using NUnit.Framework; @@ -35,7 +34,6 @@ namespace OpenSim.Tests.Common { public class DoubleToleranceConstraint : ANumericalToleranceConstraint { - private double _baseValue; private double _valueToBeTested; -- cgit v1.1 From fef3b3689492dea63693c964bcdbec9f5137eb5e Mon Sep 17 00:00:00 2001 From: Adam Frisby Date: Mon, 21 Apr 2008 07:09:17 +0000 Subject: * Optimised using statements and namespace references across entire project (this took a while to run). --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 2 -- 1 file changed, 2 deletions(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index 834d1a3..3363c54 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -27,8 +27,6 @@ using System; using NUnit.Framework; -using NUnit.Framework.Constraints; -using OpenSim.Tests.Common; namespace OpenSim.Tests.Common { -- cgit v1.1 From c995d60d37032db3198b8496e186aa7a892dc7a8 Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Wed, 14 May 2008 05:11:23 +0000 Subject: Formatting cleanup. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index 3363c54..a766549 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -53,14 +53,14 @@ namespace OpenSim.Tests.Common { throw new ArgumentException("Constraint cannot be used upon null values."); } - if( valueToBeTested.GetType() != typeof(double)) + if (valueToBeTested.GetType() != typeof(double)) { throw new ArgumentException("Constraint cannot be used upon non double-values."); } _valueToBeTested = (double)valueToBeTested; - return IsWithinDoubleConstraint(_valueToBeTested, _baseValue ); + return IsWithinDoubleConstraint(_valueToBeTested, _baseValue); } public override void WriteDescriptionTo(MessageWriter writer) -- cgit v1.1 From 65c5efe43b68700bad94076d4cd421160203c5de Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Fri, 16 May 2008 01:22:11 +0000 Subject: Formatting cleanup. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index a766549..c7a6ecc 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -39,9 +39,9 @@ namespace OpenSim.Tests.Common { _baseValue = baseValue; } - + /// - ///Test whether the constraint is satisfied by a given value + ///Test whether the constraint is satisfied by a given value /// ///The value to be tested /// @@ -70,7 +70,7 @@ namespace OpenSim.Tests.Common public override void WriteActualValueTo(MessageWriter writer) { - writer.WriteActualValue(_valueToBeTested); + writer.WriteActualValue(_valueToBeTested); } } } -- cgit v1.1 From 840de6c036570d559ec6924cd8405d3f34a99fdd Mon Sep 17 00:00:00 2001 From: Jeff Ames Date: Mon, 1 Jun 2009 06:37:14 +0000 Subject: Minor: Change OpenSim to OpenSimulator in older copyright headers and LICENSE.txt. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index c7a6ecc..c397a62 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -9,7 +9,7 @@ * * Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * * Neither the name of the OpenSim Project nor the + * * Neither the name of the OpenSimulator Project nor the * names of its contributors may be used to endorse or promote products * derived from this software without specific prior written permission. * -- cgit v1.1 From 9456bb77fbf794bb6fc2808e6cfd69c9bb1d1326 Mon Sep 17 00:00:00 2001 From: Justin Clark-Casey (justincc) Date: Wed, 9 Mar 2011 23:25:24 +0000 Subject: Upgrade nunit.framework.dll to version 2.5.9. Fix up tests appropriately. This version removes the NUnit.Framework.SyntaxHelpers namespace, so any modules with their own tests will need to delete this using statement. --- OpenSim/Tests/Common/DoubleToleranceConstraint.cs | 1 + 1 file changed, 1 insertion(+) (limited to 'OpenSim/Tests/Common/DoubleToleranceConstraint.cs') diff --git a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs index c397a62..b2f2057 100644 --- a/OpenSim/Tests/Common/DoubleToleranceConstraint.cs +++ b/OpenSim/Tests/Common/DoubleToleranceConstraint.cs @@ -27,6 +27,7 @@ using System; using NUnit.Framework; +using NUnit.Framework.Constraints; namespace OpenSim.Tests.Common { -- cgit v1.1