void SudokuBaseParallelRunnerTest::test_Add() { CPPUNIT_ASSERT(pRunner_->evaluatorSet_.empty()); pRunner_->Add(evaluatorT_); CPPUNIT_ASSERT(pRunner_->evaluatorSet_.size() == 1); pRunner_->Add(evaluatorF_); CPPUNIT_ASSERT(pRunner_->evaluatorSet_.size() == 2); return; }
SudokuParallelRunnerTest::LoopCount SudokuParallelRunnerTest::setupEvaluatorSet(NumberOfCores numberOfCores, EvaluatorSet& evaluatorSet) { countTotal_ = 0; countT_ = 0; countF_ = 0; evaluatorT_ = [&] { for(LoopCount i=0; i<loopCount_; ++i) { ++countT_; ++countTotal_; } return true; }; evaluatorF_ = [&] { for(LoopCount i=0; i<loopCount_; ++i) { ++countF_; ++countTotal_; } return false; }; pRunner_ = Sudoku::CreateParallelRunner(); for(decltype(numberOfCores) i = 0; i < numberOfCores; ++i) { evaluatorSet.push_back(evaluatorT_); evaluatorSet.push_back(evaluatorF_); pRunner_->Add(evaluatorT_); pRunner_->Add(evaluatorF_); } return loopCount_; }
bool SudokuBaseParallelRunnerTest::setupTrueEvaluatorSet() { pRunner_ = Sudoku::CreateParallelRunner(); for(auto& f : trueEvaluatorSet_) { pRunner_->Add(f); } return true; }