cs_chuckboy
Messages postés64Date d'inscriptionvendredi 16 septembre 2005StatutMembreDernière intervention31 mars 2009
-
17 oct. 2005 à 19:44
SMarmotte
Messages postés53Date d'inscriptionvendredi 17 janvier 2003StatutMembreDernière intervention12 novembre 2005
-
17 oct. 2005 à 20:52
Bonjour
La question est simple , en mode console j'y arrive facilement mais la j'ai vraiment un probleme
Argument : -ut1 ou -ut2 (marche impecable)
Argument -d c:\toto (il me garde uniquement mon c: pkoi ???)
int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE /*hPrevInstance*/, LPSTR lpCmdLine, int nCmdShow)
{
unsigned int i;
std::string sRepertory;
int j=0;
// Parse the command line to find automated unit repertory request
for(i = 0; i < strlen(lpCmdLine); i++)
{
if(!strncmp(lpCmdLine + i, "-d", 2))
{
//Espace entre le parametre et le repertoire
sscanf(lpCmdLine + i + 3,"%s",sRepertory);
//sRepertory="c:\\TESTFRANCKRFTEST";
j=1;
}
}
// Parse the command line to find automated unit test requests
for(i = 0; i < strlen(lpCmdLine); i++)
{
if(!strncmp(lpCmdLine + i, "-ut", 3))
{
unsigned int unTestID = 0;
sscanf(lpCmdLine + i + 3, "%u", &unTestID);
switch(unTestID)
{
case 1:
if(j==0)
{
pApp->SetUnitTest(New UTSky(pApp, true));
}
else
{
pApp->SetUnitTest(New UTSky(pApp, true,sRepertory));
}
break;
case 2:
if(sRepertory.empty())
{
pApp->SetUnitTest(New UTConformingLobes(pApp, true));
}
else
{
//pApp->SetUnitTest(New UTConformingLobes(pApp, true, sRepertory));
}
break;
// UNIT_TEST_TODO: Create an automated version of your test here
}
}
}
// Run the application & return result
int nRetVal = pApp->InitAndRun();
// Delete the application
delete pApp;
// Return result
return nRetVal;
}
A voir également:
Récupération paramètre entrée dans une application win32