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

C++ Test类代码示例

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

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



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

示例1: starting_thread

/**@brief ten watek tworzy nowy test i co sekunde zapisuje do niego data_test
 *@param param parametrem jest obiekt klienta
*/
DWORD WINAPI starting_thread(LPVOID param)
{
    Client *client = (Client*)param; //rzutowanie na wskaźnik typu "Client"
    int sum = 0;
    void **parameters = new void*[2];
    parameters[0] = client;
    parameters[1] = ∑
    Database baza;
             //laczymy sie z baza, tudziez tworzymy nowa jesli nie istnieje
    Test *newTest = baza.StworzTest();  //tworzymy nowy test w bazie
    actualTest = newTest ;
    int second = 1;                   //tworzy nastepny watek, ktory bedzie odbieral 4KB przeslanych danych
                                    //watek zakonczy sie kiedy wykonana zostanie metoda stop_test
    CreateThread(NULL, 0, recieving_thread, (LPVOID)parameters, 0, NULL);
    while(client->is_started())     //petla dziala dopoki nie zostanie wykonana metoda "stop_test"
    {                               //usypia watek na sekunde, aby po uplywie tego czasu
        Sleep(1000);                //dodac kolejny data_test do utworzonego testu
        baza.DodajKolejnyDataTest(newTest->GetID(), second, sum);   //dodajemy co sekunde nowy data_test do nowoutworzonego testu
        sum = 0;                    //zerujemy licznik przeslanych danych
        ++second;
        actualTest->AddDataTest(baza.ZwrocNowyDataTest());                //inkrementujemy zmienna, ktora przechowuje aktualna sekunde dzialania watku
    }
    baza.ZakonczTest(newTest->GetID());// metoda ZakonczTest ustawia nam date i czas konca testu podanego jako parametr
    closesocket(client->get_socket());//przerywa polaczenie z serwerem; dzieki temu serwer przestaje przesylac dane
    delete []parameters;
    return 0;
}
开发者ID:slimocb,项目名称:WinLanTester,代码行数:30,代码来源:client.cpp


示例2: main

int main(void)
{
	Test test;
	test.print();

	return 0;
}
开发者ID:personly,项目名称:learn,代码行数:7,代码来源:double_colon.cpp


示例3: main

int main()
{
    Test b;
    Test c;
    b.function(c);
    return 0;
}
开发者ID:avalonLZ,项目名称:practices,代码行数:7,代码来源:sameclass.cpp


示例4: main

int main()
{
  Test a;
  a.foo();

  return 0;
}
开发者ID:Erickmok,项目名称:Examples,代码行数:7,代码来源:main.cpp


示例5: main

int main()
{
    Test unused;         // { dg-warning "unused variable" }
    Test used;           // { dg-bogus "unused variable" }
    TestNormal normal;   // { dg-bogus "unused variable" }
    used.use();
}
开发者ID:pjump,项目名称:gcc,代码行数:7,代码来源:warn_unused.C


示例6: main

int main()
{
	Test test;
	test.setNum(2);
	cout << test.getNum()<<endl;
	return 0;
}
开发者ID:wk51920,项目名称:3DTerrainDisplay,代码行数:7,代码来源:main.cpp


示例7: main

int main()
{   
    Test test;
    
    std::atomic<bool> quit{};
    
    std::thread t1([&](){
        while (!quit) {
            test.increment_first();
        }
    });
    
    std::thread t2([&](){
        while (!quit) {
            test.increment_second();
        }
    });
    
    std::thread t3([&](){
        while (!quit) {
            auto snapshot = test.get_snapshot();
            std::cout << "Snapshot: " << std::get<0>(snapshot) << ", " << std::get<1>(snapshot) << ", sum: " << std::get<2>(snapshot) << std::endl;
            assert(std::get<0> + std::get<1> == std::get<2>);
        }
    });
    
    std::this_thread::sleep_for(std::chrono::milliseconds(1));
    quit = true;
    t1.join();
    t2.join();
    t3.join();
}
开发者ID:CCJY,项目名称:coliru,代码行数:32,代码来源:main.cpp


示例8: main

int main(){
    Command c1 = Command();
    Test aTest = Test();
    printf("%p\n",&c1.command);
    aTest.a();
    c1.a();
}
开发者ID:hellok,项目名称:address-sanitizer,代码行数:7,代码来源:bypass1.cpp


示例9: main

int main(){
	int (*fefe)(int a,int b)=bba;
	Test t;
	t.go();
	testA(bba);
	return -1;
};
开发者ID:yusongone,项目名称:opencv,代码行数:7,代码来源:test.cpp


示例10: getContext

Context DefTemp::getContext(HttpRequest* request)
{
	Context cnt;
	string dat = "1.js";
	GenericObject dato;
	dato << dat;
	cnt["dat"] = dato;

	Test* t = new Test;
	t->setId(1);
	t->setName("name");
	GenericObject to;
	to << t;
	delete t;
	cnt["test"] = to;

	vector<string>* vect = new vector<string>;
	vect->push_back("vec1");
	vect->push_back("vec2");
	GenericObject vecto;
	vecto << vect;
	delete vect;
	cnt["vect"] = vecto;

	int* num = new int(5);
	GenericObject numo;
	numo << num;
	delete num;
	cnt["number"] = numo;
	return cnt;
}
开发者ID:GYGit,项目名称:ffead-cpp,代码行数:31,代码来源:DefTemp.cpp


示例11: main

int main() {

    bool nothingFailed = true;
    Test model;

    CPPCMSSKEL_TEST_RESULT_WORK(
        "Try to create the tables ... " ,
        model.import_sql_file(
          SQL_PATH TEST_PATH BASIC_SQL
        ),
        nothingFailed
    );


    CPPCMSSKEL_TEST_RESULT_WORK(
        "Try to check if we know that the admin is admin ... " ,
        model.test_work(),
        nothingFailed
    );

    CPPCMSSKEL_TEST_RESULT_NOT_WORK(
        "Try to check if we know an normal user is not admin ... " ,
        model.test_not_work(),
        nothingFailed
    );


    if (nothingFailed) {
        return 0;
    } else {
        return 1;
    }
}
开发者ID:Tatoeba,项目名称:cppcms-skeleton,代码行数:33,代码来源:test.cpp


示例12: main

int main() {
    
    Test test;
    test.run();

    return 0;
}
开发者ID:WojciechMula,项目名称:toys,代码行数:7,代码来源:unittest.cpp


示例13: RunModuleLevelTests

void Module::RunModuleLevelTests(bool runCleanup)
{            
    // We want to run module level tests once only if
    // 1. we are in isolation mode and we are child process
    // 2. we are in non-isolation mode in which case we will run other tests in the parent process and so we should run module setup here
    if(!(Run::GetInstance().IsChild()))
        return;

    // Find and run moduleSetups if any exist    
    for (size_t i = 0; i < m_tests.size(); i++)
    {
        Test *currentTest = m_tests[i];
        if(currentTest->IsNewInterfaceTest())
        {
            struct RegistrationInfo *r = (struct RegistrationInfo *) (currentTest->m_registration);
            if(ModuleSetupFixture == r->fixtureType)
            {
                if(!runCleanup)
                {
                    currentTest->m_cleanupMode = TestSystem::Test::DeferredCleanup;
                    // running ModuleSetups in isolation doesnt make any sense since 
                    // they are run for the module once anyways and any other test which 
                    // will run in isolation will get its ModuleSetup run in the child process
                    currentTest->m_isolation = false;
                    Run::GetInstance().ExecuteTest(currentTest, NULL, r->fixtureType);
                }
                else
                {
                    Run::GetInstance().ExecuteDeferredCleanup(currentTest);
                }
            }
        }                
    }
}
开发者ID:HuaweiSwitch,项目名称:OMI,代码行数:34,代码来源:Run.cpp


示例14: main

int main()
{
  Test obj;
  obj.destroy();
  obj.print();
  return 0;
}
开发者ID:cvora23,项目名称:CodingInterviewQ,代码行数:7,代码来源:ThisPointer.cpp


示例15: PrintGreater

void PrintGreater(Trial *obj)
{
	Test *work = dynamic_cast<Test*>(obj);
	if (work->GetScore() > user)
	{
		work->Print();
	}
}
开发者ID:AndreyLysenkov,项目名称:StudentWork1,代码行数:8,代码来源:lab.cpp


示例16: run

void TestRegistry::run (TestResult& result) 
{
	result.testsStarted ();

	for (Test *test = tests; test != 0; test = test->getNext ())
		test->run (result);
	result.testsEnded ();
}
开发者ID:Arkshine,项目名称:rehlds,代码行数:8,代码来源:TestRegistry.cpp


示例17: testTimerEvent

void testTimerEvent()
{
	LOGT("<testTimerEvent>");
	Test t;
	t.setInterval(500);
	t.start();
	Thread::sleep(3300);
}
开发者ID:CltKitakami,项目名称:MyLib,代码行数:8,代码来源:TestTimer.cpp


示例18: main

int main(int Argc, char* Argv[]) {

Test start;

start.run(Argc, Argv);

return 0;
}
开发者ID:218672,项目名称:PAMSI,代码行数:8,代码来源:main.cpp


示例19: main

int main(int Argc, char ** Argv){

Test test;
test.Przygotuj();
test.Wykonaj();

return 0;   
}
开发者ID:218730,项目名称:PAMSI,代码行数:8,代码来源:main.cpp


示例20: main

void main()
{
	Test test;
	//test.Test(1);
	cout << " hello world " << endl;
	cout << " yes it is! " << endl;
	test.printData();
}
开发者ID:530634028,项目名称:classTest,代码行数:8,代码来源:classTest.cpp



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C++ TestAccount类代码示例发布时间:2022-05-31
下一篇:
C++ Tesselator类代码示例发布时间: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