Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
02/06/15 13:28:55 (9 years ago)
Author:
mkommend
Message:

#2282: Moved PPP into the trunk.

Location:
trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3
Files:
1 added
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Tests/HeuristicLab.Algorithms.ParameterlessPopulationPyramid-3.3/EnumerableBoolEqualityComparerTest.cs

    r11935 r11939  
    1 using System;
     1#region License Information
     2/* HeuristicLab
     3 * Copyright (C) 2002-2014 Heuristic and Evolutionary Algorithms Laboratory (HEAL)
     4 *
     5 * This file is part of HeuristicLab.
     6 *
     7 * HeuristicLab is free software: you can redistribute it and/or modify
     8 * it under the terms of the GNU General Public License as published by
     9 * the Free Software Foundation, either version 3 of the License, or
     10 * (at your option) any later version.
     11 *
     12 * HeuristicLab is distributed in the hope that it will be useful,
     13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
     14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     15 * GNU General Public License for more details.
     16 *
     17 * You should have received a copy of the GNU General Public License
     18 * along with HeuristicLab. If not, see <http://www.gnu.org/licenses/>.
     19 */
     20#endregion
     21
     22using System.Collections.Generic;
     23using System.Linq;
     24using HeuristicLab.Algorithms.ParameterlessPopulationPyramid;
     25using HeuristicLab.Random;
    226using Microsoft.VisualStudio.TestTools.UnitTesting;
    3 using HeuristicLab.Random;
    4 using System.Collections.Generic;
    5 using HeuristicLab.Algorithms.ParameterlessPopulationPyramid;
    6 using System.Linq;
    727
    828namespace ParameterlessPopulationPyramid.Test {
     
    1838    }
    1939    [TestMethod]
     40    [TestProperty("Time", "short")]
     41    [TestCategory("Algorithms.ParameterlessPopulationPyramid")]
    2042    public void EnumerableBoolEqualsTest() {
    2143      bool[] array = new bool[10];
     
    2345      randFill(array, rand);
    2446      Assert.IsTrue(compare.Equals(array, array));
    25      
     47
    2648      // Clones equal
    2749      var another = (bool[])array.Clone();
    2850      Assert.IsTrue(compare.Equals(array, another));
    29      
     51
    3052      // Flipping a bit makes unequal
    31       int flip = rand.Next(array.Length-1);
     53      int flip = rand.Next(array.Length - 1);
    3254      another[flip] = !another[flip];
    3355      Assert.IsFalse(compare.Equals(array, another));
     
    4062
    4163    [TestMethod]
     64    [TestProperty("Time", "short")]
     65    [TestCategory("Algorithms.ParameterlessPopulationPyramid")]
    4266    public void EnumerableBoolHashCollisionTest() {
    4367      int collisions = 0;
     
    4670      randFill(array, rand);
    4771      int original = compare.GetHashCode(array);
    48      
     72
    4973      bool[] another = (bool[])array.Clone();
    5074      // Perform random walk around string checking for hash collisions
     
    7094
    7195    [TestMethod]
     96    [TestProperty("Time", "short")]
     97    [TestCategory("Algorithms.ParameterlessPopulationPyramid")]
    7298    public void EnumerableBoolHashSetTest() {
    7399      HashSet<bool[]> set = new HashSet<bool[]>(compare);
Note: See TracChangeset for help on using the changeset viewer.