ganeti
Safe HaskellNone

Test.Ganeti.HTools.Graph

Description

Unittests for Ganeti.Htools.Graph

Synopsis

Documentation

data TestableGraph Source #

Constructors

TestableGraph Graph 

data TestableClique Source #

Constructors

TestableClique Graph 

undirEdges :: Gen (Bounds, [Edge]) Source #

Generate node bounds and edges for an undirected graph. A graph is undirected if for every (a, b) edge there is a corresponding (b, a) one.

cliqueEdges :: Gen (Bounds, [Edge]) Source #

Generate node bounds and edges for a clique. In a clique all nodes are directly connected to each other.

case_emptyVertColorMapNull :: Assertion Source #

Check that the empty vertex color map is empty.

case_emptyVertColorMapEmpty :: Assertion Source #

Check that the empty vertex color map is zero in size.

anyTwo :: (a -> a -> Bool) -> [a] -> Bool Source #

Check if each two consecutive elements on a list respect a given condition.

prop_verticesByDegreeAscAsc :: TestableGraph -> Bool Source #

Check order of vertices returned by verticesByDegreeAsc.

prop_verticesByDegreeDescDesc :: TestableGraph -> Bool Source #

Check order of vertices returned by verticesByDegreeDesc.

prop_isColorableTestableGraph :: TestableGraph -> Bool Source #

Check that our generated graphs are colorable

prop_isColorableTestableClique :: TestableClique -> Bool Source #

Check that our generated graphs are colorable

prop_colorClique :: (Graph -> VertColorMap) -> TestableClique -> Property Source #

Check that the given algorithm colors a clique with the same number of colors as the vertices number.

prop_colorLFClique :: TestableClique -> Property Source #

Specific check for the LF algorithm.

prop_colorDsaturClique :: TestableClique -> Property Source #

Specific check for the Dsatur algorithm.

prop_colorDcolorClique :: TestableClique -> Property Source #

Specific check for the Dcolor algorithm.

prop_colorLFAllNodes :: TestableGraph -> Property Source #

Specific check for the LF algorithm.

prop_colorDsaturAllNodes :: TestableGraph -> Property Source #

Specific check for the Dsatur algorithm.

prop_colorDcolorAllNodes :: TestableGraph -> Property Source #

Specific check for the Dcolor algorithm.

prop_colorProper :: (Graph -> VertColorMap) -> TestableGraph -> Bool Source #

Check that no two vertices sharing the same edge have the same color.

prop_colorLFProper :: TestableGraph -> Bool Source #

Specific check for the LF algorithm.

prop_colorDsaturProper :: TestableGraph -> Bool Source #

Specific check for the Dsatur algorithm.

prop_colorDcolorProper :: TestableGraph -> Bool Source #

Specific check for the Dcolor algorithm.

testHTools_Graph :: Test Source #

List of tests for the Graph module.