• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ Work类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中Work的典型用法代码示例。如果您正苦于以下问题:C++ Work类的具体用法?C++ Work怎么用?C++ Work使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



在下文中一共展示了Work类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: TEST

TEST(AWorkObject, DefaultsFunctionToNullObject) {
   Work work;
   try {
      work.execute();
   }
   catch(...) {
      FAIL("unable to execute function");
   }
}
开发者ID:ChiahungTai,项目名称:TDD,代码行数:9,代码来源:WorkTest.cpp


示例2: main

int main()
{
	std::deque<Proceso*> procesos;
	Work archivo;
	procesos = archivo.inserta("texto.txt");
	std::sort(procesos.begin(), procesos.end(), archivo.comparaArrival);
	archivo.print(procesos);
	archivo.roundRobin(procesos);
	//archivo.SJF(procesos);
}
开发者ID:colina118,项目名称:SistemasOperativos,代码行数:10,代码来源:main.cpp


示例3: while

int Worker::Run() {
	while (!workQueue.IsShutdown()){
		Work* now = workQueue.GetWork();
		if (now == NULL) continue;
		int ret = now->DoWork();
		if (ret){
			//printf("Woerker error code : %d\n", ret);
		}
	}
	return 0;
}
开发者ID:mayf3,项目名称:homework,代码行数:11,代码来源:threadpool.cpp


示例4: QMainWindow

MainWindow::MainWindow(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainWindow)
{
    ui->setupUi(this);

    Work work;
    work.setAutoDelete(false);
    QThreadPool *threadPool = QThreadPool::globalInstance();
    threadPool->start(&work);
    qDebug() << "hello from GUI thread " << QThread::currentThread();
    threadPool->waitForDone();
}
开发者ID:martinedelmann,项目名称:personal,代码行数:13,代码来源:mainwindow.cpp


示例5: impl

 void impl(Work w)
 {
   try {
     w();
   } catch (const boost::exception& e) {
     ECTO_LOG_DEBUG("post thrower(boost::exception) %s", __PRETTY_FUNCTION__);
     w.post(thrower(boost::current_exception()));
   } catch (const std::exception& e) {
     ECTO_LOG_DEBUG("post thrower (std::exception) %s", __PRETTY_FUNCTION__);
     w.post(thrower(boost::current_exception()));
   }
   w.post(boost::bind(&runandjoin::join, this));
 }
开发者ID:straszheim,项目名称:ecto,代码行数:13,代码来源:util.hpp


示例6: while

void esp::Worklist::solveWorklist(){
  while(works.size() != 0){
    Work *currentWork = selectAWork();
    removeFromWorklist(currentWork);
    //do real work here
    if(currentWork != NULL)
      doEachWork(currentWork);

    printDebugMsg("Instructions in worklist:");
    for(set<Work*>::iterator it = works.begin(); it!=works.end(); it++){
      Work *workInList = (*it);
      workInList->printContent();
    }
  }
}
开发者ID:poeliu,项目名称:LUPA,代码行数:15,代码来源:Worklist.cpp


示例7: while

int Worker::Run() {
    // TODO: 工作循环
    while (1) {
	Work* work = workQueue.GetWork();
	if (work != NULL) {
	    work->DoWork();
	    if (work->NeedDelete()) {
		delete work;
	    }
	}
	else if (workQueue.IsShutdown())
	    break;
    }

    return 0;
}
开发者ID:apir8181,项目名称:training,代码行数:16,代码来源:threadpool.cpp


示例8: OnWorkCrashed

void CreateDatabaseDialogue::OnWorkCrashed(wxCommandEvent& event)
{
  Work *work = static_cast<Work*>(event.GetClientData());
  wxLogDebug(_T("%p: work crashed (on create database dialogue)"), work);

  if (!work->GetCrashMessage().empty()) {
    wxLogError(_T("%s\n%s"), _("An unexpected error occurred interacting with the database. Failure will ensue."), work->GetCrashMessage().c_str());
  }
  else {
    wxLogError(_T("%s"), _("An unexpected and unidentified error occurred interacting with the database. Failure will ensue."));
  }

  if (work->crashHandler != NULL)
    CALL_WORK_COMPLETION(*this, work->crashHandler)(work);

  delete work;
}
开发者ID:araqnid,项目名称:pqwx,代码行数:17,代码来源:create_database_dialogue.cpp


示例9: while

void Worker::workLoopAnyWork()
{
   log.log(4, std::string("Ready (TID: ") + StringTk::uint64ToStr(System::getTID() ) + ")");

   workQueue->incNumWorkers(); // add this worker to queue stats

   while(!getSelfTerminate() || !maySelfTerminateNow() )
   {
      //log.log(4, "Waiting for work...");

      Work* work = workQueue->waitForAnyWork(stats);

      //log.log(4, "Got work");

      #ifdef FHGFS_DEBUG_PROFILING
         Time workStartTime;
      #endif

      HighResolutionStatsTk::resetStats(&stats); // prepare stats

      // process the work packet
      work->process(bufIn, bufInLen, bufOut, bufOutLen);

      // update stats
      stats.incVals.workRequests = 1;
      HighResolutionStatsTk::addHighResIncStats(*work->getHighResolutionStats(), stats);

      #ifdef FHGFS_DEBUG_PROFILING
      Time workEndTime;
      int workElapsedMS = workEndTime.elapsedSinceMS(&workStartTime);
      int workElapsedMicro = workEndTime.elapsedSinceMicro(&workStartTime);

      if(workEndTime.elapsedSinceMS(&workStartTime) )
         LOG_DEBUG("Worker::workLoop", Log_DEBUG, "Work processed. Elapsed ms: " +
            StringTk::intToStr(workElapsedMS) );
      else
         LOG_DEBUG("Worker::workLoop", Log_DEBUG, "Work processed. Elapsed us: " +
            StringTk::intToStr(workElapsedMicro) );
      #endif

      // cleanup
      delete(work);
   }
}
开发者ID:NingLeixueR,项目名称:BeeGFS,代码行数:44,代码来源:Worker.cpp


示例10: _tmain

int _tmain(int argc, _TCHAR* argv[])
{
	Work wk1("Vilka", 25, 400);
	Work* pwk;
	Work *wk[10];

	pwk=&wk1;
	//Work wk2(wk1);
	Work wk2=wk1;
	
	cout<<"headworker:\n FIO:"<<pwk->GetFio()<<" Age:"<<pwk->GetAge()<<" Wage:"<<pwk->GetWage()<<endl;
	cout<<"Copy of headworker:\n FIO:"<<wk2.GetFio()<<" Age:"<<wk2.GetAge()<<" Wage:"<<wk2.GetWage()<<endl;

	int i, ai, wi, tw;
	tw=wk1.GetWage()+wk2.GetWage();

	wk[0]=new Work;
	wk[1]=new Work(18);
	wk[2]=new Work(18, 300);
	wk[3]=new Work(wk2);
	wk[4]=new Work("Sting", 19, 300);
	wk[5]=new Work("Bingo", 28, 350);
	wk[6]=new Work("Flicr", 38, 200);
	wk[7]=new Work("Dream", 34, 330);
	wk[8]=new Work("Steam", 25, 300);
	wk[9]=new Work("Roar", 18, 180);

	for (i=0, ai=18, wi=300;i<10;i++,ai=ai+3,wi=wi+20)
	{
		//wk[i]->SetAge(ai);
		//wk[i]->SetWage(wi);
		tw=tw+wk[i]->GetWage();
		cout<<i+1<<" worker info:\n FIO:"<<wk[i]->GetFio()<<" Age:"<<wk[i]->GetAge()<<" Wage:"<<wk[i]->GetWage()<<endl;
	}

	cout<<"Total m_wage: "<<tw<<endl;

	system("pause");
	return 0;
}
开发者ID:Zandriy,项目名称:Uni2Year,代码行数:40,代码来源:4.cpp


示例11: comm

Move::Move(Work& work, db::Comment const& comment, unsigned varNo, unsigned varCount)
	:KeyNode(work.key)
	,m_ply(0)
{
	if (!work.isFolded && !comment.isEmpty())
	{
		db::Comment comm(comment);
		comm.strip(*work.wantedLanguages);

		if (!comm.isEmpty())
		{
			work.pushSpaceOrParagraph(Spacing::Comment);
			work.pop(m_list);
			m_list.push_back(new Comment(comm, move::Post, Comment::AtEnd));
		}
	}

	if (work.m_level > 0)
	{
		Node::Bracket bracket;

		if (work.isFolded)
			bracket = Node::Fold;
		else if (/*varCount > 1 && */(work.m_displayStyle & display::ShowVariationNumbers))
			bracket = Node::End;
		else
			bracket = Node::Close;

		work.pushClose(varNo == varCount);
	   m_list.push_back(new Space(bracket, varNo == varCount));
	}
	else
	{
		m_list.push_back(new Space(0));
	}
}
开发者ID:gkalab,项目名称:cb2pgn,代码行数:36,代码来源:db_edit_node.cpp


示例12: main

//int main(int argc, char** argv)
int main()
{
	
	vector<Token> ex_list;
	//ex_list = sc.scan(argv[1]);
	ex_list = sc.scan("parcertest1.txt");
	//sc.scan("parcertest1.txt", "parceresport.txt");
	p.get_vector(ex_list);
	 
	DLP vect = p.datalogprogram("DLPEXPORT.txt");
	
	w.importDLP(vect);
	//string temp = argv[2];
	string temp = "a.txt";
	ofstream out(temp);
	w.doWork(out);
	w.factEval(out);
	w.printfacts(out);
	w.further_work(out);

	// out.close();


	//vector<Predicate> sh = vect.getSchemes();


	/*
	for (int i = 0; i < sh.size(); i++)
	{
		cout << sh[i].toString() << endl;
	}*/
	 
	
	//system("pause");
	return 0;
}
开发者ID:manymotes,项目名称:CS_236_lab4,代码行数:37,代码来源:Source3.cpp


示例13: catch

void UnloadWorker<BATB>::operator()(Work& work)
{
    // (this is done in other GL context!)

    // unknown how many steps to be taken
    work.indefinite(); 

    try
    {
        // unload Demo
        demo::end( batb.demo );

        // unload race
        //race::begin( batb.race );

        // unload forest
        forest::end( batb.forest );

        // unload the non-core part of run
        run::end( batb.run );


        // unload AL
        work.state( "AL" );
        al::end( batb.al );

        // unload OGRE
        // FIXME!!! current thread is not main. 
        //          OGRE::frameBegin is calledafter delete!
        work.state( "OGRE" );
        ogre::end( batb.ogre );

#ifdef LOAD_PROXY
        work.state( "Proxy library B" );
        std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
        work.state( "Proxy library A" );
        std::this_thread::sleep_for( std::chrono::seconds( 2 ) );
#endif

    } 
    catch (std::exception& e)
    {
        batb.log << "error unloading : " << e.what() << std::endl; 
    }

    // must be done to signalize completion
    work.finish();
}
开发者ID:,项目名称:,代码行数:48,代码来源:


示例14: main

int main()
{
	Work * emp = new Work();
	emp->SetHour(9);
	emp->WriteProgram();
	emp->SetHour(10);
	emp->WriteProgram();
	emp->SetHour(11);
	emp->WriteProgram();
	emp->SetHour(12);
	emp->WriteProgram();
	emp->SetHour(13);
	emp->WriteProgram();
	emp->SetHour(14);
	emp->WriteProgram();
	emp->SetHour(17);
	
	emp->TaskFinished(false);
	emp->WriteProgram();
	emp->SetHour(19);
	emp->WriteProgram();
	emp->SetHour(22);
	emp->WriteProgram();
	return 0;
}
开发者ID:hy-chao,项目名称:StatePattern,代码行数:25,代码来源:main.cpp


示例15: OnAdd

void ButtonBox::OnAdd(Work& work) {
	for (auto& button : buttons_) {
		work.addWidget(button);
	}
}
开发者ID:,项目名称:,代码行数:5,代码来源:


示例16: comment

Move::Move(Work& work, MoveNode const* move)
	:KeyNode(work.key)
{
	//M_ASSERT(!move->atLineStart());

	if (work.board.whiteToMove())
	{
		if (work.m_level == 0 && (work.m_displayStyle & display::ColumnStyle))
			work.pushBreak();
		work.needMoveNo = true;
	}

	if (!work.isFolded && move->hasComment(move::Ante))
	{
		db::Comment comment(move->comment(move::Ante));
		comment.strip(*work.wantedLanguages);

		if (!comment.isEmpty())
		{
			if (!move->prev()->hasMark() || move->prev()->hasComment(move::Post))
				work.pushSpaceOrParagraph(Spacing::Comment);
			work.pop(m_list);
			m_list.push_back(new Comment(comment, move::Ante));
			work.m_isVirgin = false;
			work.pushSpaceOrParagraph(Spacing::Comment);
			work.needMoveNo = true;
		}
	}

	work.pop(m_list);

	if (!work.isFolded && move->hasAnnotation())
	{
		m_list.push_back(new Annotation(
			move->annotation(),
			bool(work.m_displayStyle & display::ShowDiagrams)));
	}

	m_ply = work.needMoveNo ? new Ply(move, work.board.moveNumber()) : new Ply(move);
	m_list.push_back(m_ply);
	work.incrPlyCount();
	work.needMoveNo = false;
	work.pushSpace();

	if (work.isFolded)
		return;

	if (move->hasMark())
	{
		m_list.push_back(new Marks(move->marks()));
		work.pushSpace();
	}

	mstl::string info;
	getMoveInfo(work, move, info);

	bool needSpace = false;

	if (move->hasComment(move::Post))
	{
		db::Comment comment(move->comment(move::Post));
		comment.strip(*work.wantedLanguages);

		if (!comment.isEmpty())
		{
			bool isShort =		info.empty()
								&& comment.length() <= work.linebreakMinCommentLength
								&& bool(work.m_displayStyle & display::CompactStyle);

			if (isShort)
				work.pushSpace();
			else
				work.pushSpaceOrParagraph(Spacing::Comment);

			work.pop(m_list);
			m_list.push_back(new Comment(comment, move::Post));

			if (isShort)
				work.pushSpace();
			else
				needSpace = true;
		}
	}

	if (!info.empty())
	{
		if (needSpace)
			work.pushSpace();
		else
			work.pushSpaceOrParagraph(Spacing::Comment);

		work.pop(m_list);
		m_list.push_back(new Comment(db::Comment(info, false, false), move::Post, Comment::Finally));
		needSpace = true;
	}

	if (needSpace)
	{
		work.pushSpaceOrParagraph(Spacing::Comment);
		work.needMoveNo = true;
//.........这里部分代码省略.........
开发者ID:gkalab,项目名称:cb2pgn,代码行数:101,代码来源:db_edit_node.cpp


示例17: Move

void
Root::makeList(Work& work,
					KeyNode::List& result,
					MoveNode const* node,
					unsigned varNo,
					unsigned varCount)
{
	//M_ASSERT(node);
	//M_ASSERT(node->atLineStart());

	bool isFolded = node->isFolded();

	work.isFolded = isFolded;
	result.reserve(2*node->countHalfMoves() + 10);
	work.key.addPly(work.board.plyNumber());

	if (node->prev())
		++work.m_level;

	result.push_back(new Move(work, node, node->isEmptyLine(), varNo, varCount));

	if (	!work.isFolded
		&& (work.m_displayStyle & display::ShowDiagrams)
		&& (	node->annotation().contains(nag::Diagram)
			|| node->annotation().contains(nag::DiagramFromBlack)))
	{
		work.pushParagraph(Spacing::Diagram);
		work.pop(const_cast<Move*>(static_cast<Move const*>(result.back()))->m_list);
		result.push_back(new Diagram(
			work, node->annotation().contains(nag::Diagram) ? color::White : color::Black));
		work.m_isVirgin = false;
		work.pushParagraph(Spacing::Diagram);
		work.needMoveNo = true;
	}

	work.key.removePly();
	node = node->next();
	//M_ASSERT(node);

	if (work.isFolded)
	{
//		too confusing!
//		if (node->next()->atLineEnd() && !node->hasNote() && !node->prev()->hasNote())
//			work.isFolded = false;
		work.key.addPly(work.board.plyNumber() + 1);
		result.push_back(new Move(work, node));
		work.board.doMove(node->move());
		work.key.removePly();
	}
	else
	{
		for ( ; !node->atLineEnd(); node = node->next())
		{
			work.key.addPly(work.board.plyNumber() + 1);
			result.push_back(new Move(work, node));

			if (	(work.m_displayStyle & display::ShowDiagrams)
				&& (	node->annotation().contains(nag::Diagram)
					|| node->annotation().contains(nag::DiagramFromBlack)))
			{
				work.pushParagraph(Spacing::Diagram);
				work.pop(const_cast<Move*>(static_cast<Move const*>(result.back()))->m_list);
				work.board.doMove(node->move());
				result.push_back(new Diagram(
					work,
					node->annotation().contains(nag::Diagram) ? color::White : color::Black));
				work.board.undoMove(node->move());
				work.pushParagraph(Spacing::Diagram);
				work.needMoveNo = true;
			}

			if (node->hasVariation())
			{
				work.pushParagraph(Spacing::StartVariation);

				for (unsigned i = 0; i < node->variationCount(); ++i)
				{
					Board	board(work.board);
					Key	succKey(work.key);

					if (i + 1 < node->variationCount())
					{
						succKey.addVariation(i + 1);
						succKey.addPly(work.board.plyNumber());
					}
					else
					{
						succKey.exchangePly(work.board.plyNumber() + 2);
					}

					work.key.addVariation(i);
					work.pushBreak();
					work.needMoveNo = true;

					Variation* var = new Variation(work.key, succKey);
					result.push_back(var);

					unsigned linebreakMaxLineLength = work.m_linebreakMaxLineLength;

					if (	work.m_linebreakMaxLineLength != ::DontSetBreaks
//.........这里部分代码省略.........
开发者ID:gkalab,项目名称:cb2pgn,代码行数:101,代码来源:db_edit_node.cpp


示例18: qDebug

void Bot::one_step () {
    if (_page == NULL) {
        qDebug("initial load for base url");
        GoTo(_baseurl, true);
        return;
    }

    if (_gpage == NULL && _page->pagekind != page_Login) {
        qWarning("we're not on game page. [re]login");
        GoTo(_baseurl);
        return;
    }

    QDateTime ts = QDateTime::currentDateTime();

    if (_workq.empty()) { // нет никакой работы
        // ищем сперва основную работу
        //        qDebug(u8("ищем основную работу"));
        if (_nextq.empty()) {
            fillNextQ();
        }
        while (!_nextq.empty()) {
            Work *p = _nextq.front();
            _nextq.pop_front();
            if (pushWork(p)) {
                return; // вернёмся в следующем цикле
            }
//            if (p->isEnabled() && (p->isActive() || p->isMyWork())) {
//                if (_workcycle_debug2) {
//                    qDebug(u8("пробуем начать работу: %1").arg(p->getWorkName()));
//                }
//                if (p->processQuery(Work::CanStartWork)) {
//                    if (_workcycle_debug2) {
//                        qDebug(u8("%1 startable").arg(p->getWorkName()));
//                    }
//                    p->wearOnBegin();
//                    if (p->processCommand(Work::StartWork)) {
//                        if (_workcycle_debug) {
//                            qWarning(u8("наша текущая работа: %1").arg(p->getWorkName()));
//                        }
//                        _workq.push_front(p);
//                        //break;
//                        return; // лучше в следующем цикле придём
//                    } else {
//                        p->wearOnEnd();
//                        if (_workcycle_debug) {
//                            qDebug(u8("работа %1 почему-то не запустилась")
//                                   .arg(p->getWorkName()));
//                        }
//                    }
//                } else {
//                    if (_workcycle_debug2) {
//                        qDebug(u8("%1 is not startable").arg(p->getWorkName()));
//                    }
//                }
//            } else {
//                if (_workcycle_debug2) {
//                    qDebug(u8("%1 is not enabled").arg(p->getWorkName()));
//                }
//            }
        }
    }

    if (_workq.empty() || (
            _workq.front()->isPrimaryWork() &&
            _workq.front()->processQuery(Work::CanStartSecondaryWork))) {
        //        qDebug(u8("ищем дополнительную работу"));
        WorkListIterator i(_secworklist);
        while (i.hasNext()) {
            Work *p = i.next();
            if (p->isEnabled() && p->isActive()) {
                if (_workcycle_debug2) {
                    qDebug(u8("пробуем начать подработку: ") + p->getWorkName());
                }
                if (p->processQuery(Work::CanStartWork)) {
                    if (_workcycle_debug2) {
                        qDebug(u8("%1 startable").arg(p->getWorkName()));
                    }
                    if (p->processCommand(Work::StartWork)) {
                        qWarning(u8("запустили подработку: %1").arg(p->getWorkName()));
                        _workq.push_front(p);
                        // break;
                        return; // лучше в следующем цикле придём
                    } else {
                        if (_workcycle_debug) {
                            qDebug(u8("допработа %1 почему-то не запустилась")
                                   .arg(p->getWorkName()));
                        }
                    }
                } else {
                    if (_workcycle_debug2) {
                        qDebug(u8("%1 is not startable").arg(p->getWorkName()));
                    }
                }
            } else {
                if (_workcycle_debug2) {
                    qDebug(u8("%1 is not enabled").arg(p->getWorkName()));
                }
            }
        }
//.........这里部分代码省略.........
开发者ID:gourytch,项目名称:bezzabot,代码行数:101,代码来源:bot_one_step.cpp


示例19: operator

    void operator()() {
        // Database connections don't survive over fork() according to SqLite and PostgreSQL documentation, so open it again
        SqlDatabase::TransactionPtr tx = SqlDatabase::Connection::create(databaseUrl)->transaction();

        // Use zero for the number of tests ran so that this child process doesn't try to update the semantic_history table.
        // If two or more processes try to change the same row (which they will if there's a non-zero number of tests) then
        // they will deadlock with each other.
        static const size_t NO_TESTS_RAN = 0;

        NameSet builtin_function_names;
        add_builtin_functions(builtin_function_names/*out*/);

        InputGroup igroup;
        WorkItem prevWorkItem;
        SgAsmInterpretation *prev_interp = NULL;
        MemoryMap ro_map;
        Disassembler::AddressSet whitelist_exports;         // dynamic functions that should be called
        PointerDetectors pointers;
        InsnCoverage insn_coverage;
        DynamicCallGraph dynamic_cg;
        Tracer tracer;
        ConsumedInputs consumed_inputs;
        FuncAnalyses funcinfo;
        OutputGroups ogroups; // do not load from database (that might take a very long time)
        time_t last_checkpoint = time(NULL);
        for (size_t workIdx=0; workIdx<work.size(); ++workIdx) {
            WorkItem &workItem = work[workIdx];

            // Load the input group from the database if necessary.
            if (workItem.igroup_id!=prevWorkItem.igroup_id) {
                if (!igroup.load(tx, workItem.igroup_id)) {
                    std::cerr <<argv0 <<": input group " <<workItem.igroup_id <<" is empty or does not exist\n";
                    exit(1);
                }
            }

            // Find the function to test
            IdFunctionMap::iterator func_found = functions.find(workItem.func_id);
            assert(func_found!=functions.end());
            SgAsmFunction *func = func_found->second;
            if (opt.verbosity>=LACONIC) {
                if (opt.verbosity>=EFFUSIVE)
                    std::cerr <<argv0 <<": " <<std::string(100, '=') <<"\n";
                std::cerr <<argv0 <<": processing function " <<function_to_str(func, function_ids) <<"\n";
            }
            SgAsmInterpretation *interp = SageInterface::getEnclosingNode<SgAsmInterpretation>(func);
            assert(interp!=NULL);

            // Do per-interpretation stuff
            if (interp!=prev_interp) {
                prev_interp = interp;
                assert(interp->get_map()!=NULL);
                ro_map = *interp->get_map();
                ro_map.require(MemoryMap::READABLE).prohibit(MemoryMap::WRITABLE).keep();
                Disassembler::AddressSet whitelist_imports = get_import_addresses(interp, builtin_function_names);
                whitelist_exports.clear(); // imports are addresses of import table slots; exports are functions
                overmap_dynlink_addresses(interp, *insns, opt.params.follow_calls, &ro_map, GOTPLT_VALUE,
                                          whitelist_imports, whitelist_exports/*out*/);
                if (opt.verbosity>=EFFUSIVE) {
                    std::cerr <<argv0 <<": memory map for SgAsmInterpretation:\n";
                    interp->get_map()->dump(std::cerr, argv0+":   ");
                }
            }

            // Run the test
            assert(insns!=NULL);
            assert(entry2id!=NULL);
            std::cerr <<"process " <<getpid() <<" about to run test " <<workIdx <<"/" <<work.size() <<" " <<workItem <<"\n";
            runOneTest(tx, workItem, pointers, func, function_ids, insn_coverage, dynamic_cg, tracer, consumed_inputs,
                       interp, whitelist_exports, cmd_id, igroup, funcinfo, *insns, &ro_map, *entry2id, ogroups);
            ++ntests_ran;

            // Checkpoint
            if (opt.checkpoint>0 && time(NULL)-last_checkpoint > opt.checkpoint) {
                if (!opt.dry_run)
                    tx = checkpoint(tx, ogroups, tracer, insn_coverage, dynamic_cg, consumed_inputs, NULL, NO_TESTS_RAN,
                                    cmd_id);
                last_checkpoint = time(NULL);
            }

            prevWorkItem = workItem;
        }
        std::cerr <<"process " <<getpid() <<" is done testing; now finishing up...\n";

        if (!tx->is_terminated()) {
            SqlDatabase::StatementPtr stmt = tx->statement("insert into semantic_funcpartials"
                                             " (func_id, ncalls, nretused, ntests, nvoids) values"
                                             " (?,       ?,      ?,        ?,      ?)");
            for (FuncAnalyses::iterator fi=funcinfo.begin(); fi!=funcinfo.end(); ++fi) {
                stmt->bind(0, fi->first);
                stmt->bind(1, fi->second.ncalls);
                stmt->bind(2, fi->second.nretused);
                stmt->bind(3, fi->second.ntests);
                stmt->bind(4, fi->second.nvoids);
                stmt->execute();
            }
        }

        // Cleanup
        if (!tx->is_terminated() && !opt.dry_run) {
//.........这里部分代码省略.........
开发者ID:alexjohn1362,项目名称:rose,代码行数:101,代码来源:25-run-tests-fork.C


示例20: add

 virtual void add(Work work) override { work.execute(); }
开发者ID:ChiahungTai,项目名称:TDD,代码行数:1,代码来源:GeoServerTest.cpp



注:本文中的Work类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ WorkItem类代码示例发布时间:2022-05-31
下一篇:
C++ WordsRange类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap