Changeset 7523 for branches/GeneralizedQAP/UnitTests
- Timestamp:
- 02/24/12 23:27:06 (13 years ago)
- Location:
- branches/GeneralizedQAP/UnitTests
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/GeneralizedQAP/UnitTests/QAPLIBInstanceProviderTest.cs
r7505 r7523 21 21 22 22 using System; 23 using System.Collections.Generic; 23 24 using System.Text; 24 25 using HeuristicLab.Problems.Instances.QAPLIB; … … 45 46 Assert.IsTrue(erroneousInstances.Length == 0, "Some instances could not be parsed: " + Environment.NewLine + erroneousInstances.ToString()); 46 47 } 48 49 /// <summary> 50 ///A test for GetInstance 51 ///</summary> 52 [TestMethod()] 53 public void GetInstanceTest() { 54 List<string> nonZeroDiagonalInstances = new List<string>(); 55 var target = new QAPLIBInstanceProvider(); 56 foreach (var id in target.GetInstanceDescriptors()) { 57 var instance = target.GetInstance(id); 58 for (int i = 0; i < instance.Dimension; i++) 59 if (instance.Distances[i, i] != 0 || instance.Weights[i, i] != 0) { 60 nonZeroDiagonalInstances.Add(instance.Name); 61 break; 62 } 63 } 64 65 Assert.IsTrue(nonZeroDiagonalInstances.Count == 0, string.Join(Environment.NewLine, nonZeroDiagonalInstances)); 66 } 47 67 } 48 68 } -
branches/GeneralizedQAP/UnitTests/UnitTests.csproj
r7505 r7523 97 97 </ItemGroup> 98 98 <ItemGroup> 99 <Compile Include="CordeauCrossoverTest.cs" /> 99 100 <Compile Include="CordeauGQAPInstanceProviderTest.cs" /> 100 101 <Compile Include="ElloumiCTAPInstanceProviderTest.cs" />
Note: See TracChangeset
for help on using the changeset viewer.