示例#1
0
void UniquePtrTest()
{
    TestUniquePtr myTest(new Test());
    doSomethig(std::move(myTest));

    // myTest->m_value = 10;	// runtime error, but this time on purpose!
}
void write_viennaprofiler(TimingType & timings, std::string function_prefix, std::string kernel_name)
{
  ViennaProfiler::MySQLDB dbConn("myhost.example.com", "database", "user", "password");
  ViennaProfiler::PreciseTimer timer; // choose a timer for measuring the execution time
  
  //ViennaProfiler::Host host = dbConn.getHost("pcrupp"); // create a host
  ViennaProfiler::Profiler<ViennaProfiler::MySQLDB, ViennaProfiler::PreciseTimer> myTest(dbConn, timer, "my_machine_name"); // create a Profiler
  myTest.setCollection("ViennaCL");
  myTest.setFunction(function_prefix + " " + kernel_name);
  myTest.setImplementation("default");
  myTest.setSourceCode("not available");
  myTest.setOperations(0);
  
  //do a dummy start (otherwise, date is not written properly)
  myTest.start();
  myTest.stop();

  for (typename TimingType::iterator it = timings.begin();
       it != timings.end(); ++it)
  {
    myTest.addParameter("work groups", it->second.first);
    myTest.addParameter("work group size", it->second.second);
    myTest.setExternalTiming(it->first, BENCHMARK_RUNS);
    myTest.send();
  }
  
  std::cout << "Optimization for " << kernel_name << " written to ViennaProfiler." << std::endl;
}
示例#3
0
void AutoPtrTest()
{
    TestAutoPtr myTest(new Test());
    doSomethig(myTest);

    myTest->m_value = 10;
}
示例#4
0
LOCAL_D void ThreadDoTestsL()
    {
    RTestPtr myTest(new(ELeave) RTest(KThreadFunc));
    
    myTest->Start(KThreadFunc);        
    ThreadFirstTestL(myTest.Ref());    
    myTest->End();    
    }
示例#5
0
int main()
{
    Test myTest(1);

    std::cout << "value: " << myTest.getValue()
        << "\ntest: " << myTest.getTest() << std::endl;
    return 0;
}
示例#6
0
文件: main.cpp 项目: mgriffin1994/312
int main(void) {
	testStage1();
	testStage2();
	testStage3();

#ifdef READY_FOR_STAGE_4	
	testStage4();
#endif /* READY_FOR_STAGE_4 */
	myTest();
	return 0;
}
示例#7
0
int main (void)
{
  GC_set_all_interior_pointers(0);
  GC_set_max_heap_size(16000000);
  /*GC_set_java_finalization(1);*/
  GC_INIT();

  myTest();

  return 0;
}
示例#8
0
/**
@SYMTestCaseID PIM-T-OWNCARDDELETE-0001
@SYMTestType UT
@SYMTestPriority Medium
@SYMDEF PDEF107246
@SYMTestCaseDependencies CntModel CoreAppsTest
@SYMTestCaseDesc Check that updates to one CContactDatabase-instance will propagate to a second instance
@SYMTestActions Add some contacts. Set one as own card. Check that the count is the same for all instances. 
                Check that the own card id is the same for all instances. Delete all contacts and check that 
                the count is zero and own card id is KNullContactId (-1) for all instances.                
@SYMTestExpectedResults see above.
*/
LOCAL_D void DoTestsL()
    {  
    RTestPtr myTest(new(ELeave) RTest(KOwnCard));
        
    myTest->Start(KOwnCard);          
    TestFirstL(myTest.Ref());                          
    TestSecondL(myTest.Ref());         
    
    CContactDatabase::DeleteDatabaseL(KDatabaseFileName);   
    myTest->Printf(_L("Completed OK \n"));        
    myTest->End();  
    }
示例#9
0
NTSTATUS
DriverEntry (
    __in PDRIVER_OBJECT DriverObject,
    __in PUNICODE_STRING RegistryPath
    )
{
    char buf[100] = {0};
    _asm{pushad}
    myTest(&buf); 
    _asm{popad}
    DbgPrint(buf);    
    return STATUS_SUCCESS;
}
示例#10
0
void Systray::createActions() // Right click on the systray
{
    restoreAction = new QAction(tr("&Restore"), this);
    connect(restoreAction, SIGNAL(triggered()), this, SLOT(myTest()));

    networkAction = new QAction(tr("&Network"), this);
    connect(networkAction, SIGNAL(triggered()), qApp, SLOT(quit()));

    svnAction = new QAction(tr("&SVN"), this);
    connect(svnAction, SIGNAL(triggered()), qApp, SLOT(quit()));

    configAction = new QAction(tr("&Config"), this);
    connect(configAction, SIGNAL(triggered()), qApp, SLOT(quit()));

    quitAction = new QAction(tr("&Quit"), this);
    connect(quitAction, SIGNAL(triggered()), qApp, SLOT(quit()));
}
示例#11
0
int parseCommandLine(int argc, char* argv[])
{
    std::vector<float> floatList={};
    bool floatBoolList[maxSizeFloatPar];
    for(int i=0;i<maxSizeFloatPar;i++)
        floatBoolList[i]=false;
        
    bool boolList[maxSizeBoolPar];
    for(int i=0;i<maxSizeBoolPar;i++)
        boolList[i]=false;
        
    testType test1;
    testType test2;
    bool fin=false;
    if(argc<2)
    {
        std::cout << "Donnez un test à faire, --help pour plus d'info" << std::endl;
        fin=true;
    
    }
    else if(strcmp(argv[1],"--help")==0)
    {
        std::ifstream fichier("help.txt");
        if(!fichier) 
        {
            std::cerr << "Le fichier help n'existe pas" << std::endl;
        }
        else
        {
            std::string line;
            while(std::getline(fichier,line))
            {
                std::cout << line << std::endl;
            }
        }
        fin=true;
    }
    //Premier test
    else if(strcmp(argv[1],"DREC")==0)
    {
        test1=DREC;
    }
    else if(strcmp(argv[1],"DIT")==0)
    {
        test1=DIT;
    }
    else if(strcmp(argv[1],"DLIST")==0)
    {
        test1=DLIST;
    }
    else if(strcmp(argv[1],"SREC")==0)
    {
        test1=SREC;
    }
    else if(strcmp(argv[1],"SIT")==0)
    {
        test1=SIT;
    }
    else if(strcmp(argv[1],"SLIST")==0)
    {
        test1=SLIST;
    }
    else
    {
        std::cerr << "Le test demandé n'existe pas, pour plus d'informations essayez --help" << std::endl;
        fin=true;
    }
    
    //Deuxième test
    if(!fin)
    {
        if(strcmp(argv[2],"DREC")==0)
        {
            test2=DREC;
        }
        else if(strcmp(argv[2],"DIT")==0)
        {
            test2=DIT;
        }
        else if(strcmp(argv[2],"DLIST")==0)
        {
            test2=DLIST;
        }
        else if(strcmp(argv[2],"SREC")==0)
        {
            test2=SREC;
        }
        else if(strcmp(argv[2],"SIT")==0)
        {
            test2=SIT;
        }
        else if(strcmp(argv[2],"SLIST")==0)
        {
            test2=SLIST;
        }
        else
        {
            std::cerr << "Le test demandé n'existe pas, pour plus d'informations essayez --help" << std::endl;
            fin=true;
        }
    }
    for(int i=3;i<argc;i++)
    {
        if(strlen(argv[i])!=2)
        {
            std::cerr << "L'argument numéro " << (i-2) << " n'est pas reconnu" << std::endl;
        }
        else
        {
            if(argv[i][0]=='-')
            {
                bool isFloat=false;
                bool isBool=false;
                int numFloat;
                int numBool;
                
                
                switch((char)argv[i][1])
                {
                    case 'F':
                        isFloat=true;
                        numFloat=0;
                        break;
                    case 'N':
                        isFloat=true;
                        numFloat=1;
                        break;
                    case 'C':
                        isFloat=true;
                        numFloat=2;
                        break;
                    case 'T':
                        isBool=true;
                        numBool=0;
                        break;
                    case 'S':
                        isBool=true;
                        numBool=1;
                        break;
                    case 'H':
                        isBool=true;
                        numBool=2;
                        break;
                    case 'R':
                        isBool=true;
                        numBool=3;
                        break;
                    case 'L':
                        isBool=true;
                        numBool=4;
                        break;
                    case 'v':
                        isBool=true;
                        numBool=5;
                        break;
                }
                
                
                
                if(isFloat)
                {
                    float puissance=1;
                    float nombre=0;
                    floatBoolList[numFloat]=true;
                    i++;
                    for(int j=strlen(argv[i])-1;j>=0;j--)
                    {
                        nombre=nombre+(argv[i][j]-48)*puissance;
                        puissance*=10;
                    }
                    floatList.push_back(nombre);
                }
                else if(isBool)
                {
                    boolList[numBool]=true;
                }
                else
                {
                    std::cerr << "L'argument numéro " << (i-3) << " n'est pas reconnu, début non reconnu" << std::endl;
                }
            }
        }
    }
            
            
    if(!fin)      
    {
        TestEnv myTest(test1,test2,floatList,floatBoolList,boolList);
        myTest.runTest();
    }  

    return 0;
}