-- Hoogle documentation, generated by Haddock
-- See Hoogle, http://www.haskell.org/hoogle/


-- | A test-suite for any queue or double-ended queue satisfying an interface
--   
--   This package provides tests that can be used with any queue
--   implementation that satisfies the `abstract-deque` interface.
@package abstract-deque-tests
@version 0.3


-- | This module contains a battery of simple tests for queues implementing
--   the interface defined in ` Data.Concurrent.Deque.Class`.
module Data.Concurrent.Deque.Tests

-- | This test serially fills up a queue and then drains it.
test_fifo_filldrain :: DequeClass d => d Elt -> IO ()

-- | This test splits the <tt>numAgents</tt> threads into producers and
--   consumers which all communicate through a SINGLE queue. Each thread
--   performs its designated operation as fast as possible. The <a>Int</a>
--   argument <tt>total</tt> designates how many total items should be
--   communicated (irrespective of <tt>numAgents</tt>).
test_fifo_OneBottleneck :: DequeClass d => Bool -> Int -> d Elt -> IO ()

-- | This creates an HUnit test list to perform all the tests that apply to
--   a single-ended (threadsafe) queue. It requires thread safety at
--   <i>both</i> ends.
tests_fifo :: DequeClass d => (forall elt. IO (d elt)) -> Test

-- | Trivial test: push then pop.
test_ws_triv1 :: PopL d => d [Char] -> IO ()

-- | Trivial test: push left, pop left and right.
test_ws_triv2 :: PopL d => d [Char] -> IO ()

-- | Aggregate tests for work stealing queues. None of these require
--   thread-safety on the left end. There is some duplication with
--   tests_fifo.
tests_wsqueue :: (PopL d) => (forall elt. IO (d elt)) -> Test
test_parfib_work_stealing :: (DequeClass d, PopL d) => Elt -> IO (d Elt) -> IO ()

-- | This requires double ended queues that are threadsafe on BOTH ends.
tests_all :: (PopL d) => (forall elt. IO (d elt)) -> Test
numElems :: Int

-- | How many communicating agents are there? By default one per thread
--   used by the RTS.
getNumAgents :: IO Int

-- | It is possible to have imbalanced concurrency where there is more
--   contention on the producing or consuming side (which corresponds to
--   settings of this parameter less than or greater than 1).
producerRatio :: Double

-- | Dig through the test constructors to find the leaf IO actions and
--   bracket them with a thread-setting action.
setTestThreads :: Int -> Test -> Test

-- | This version has the option of being smarter about how it handles
--   uniformly labeling many tests.
appendLabels :: String -> [Test] -> Test

-- | Dig through the test constructors and add a new string to the first
--   label found. If no such label exists, add one.
appendLabel :: String -> Test -> Test
stdTestHarness :: (IO Test) -> IO ()
type Elt = Int64
forkJoin :: Int -> (Int -> IO b) -> IO [b]
timeit :: IO a -> IO a
fibSize :: Int64
