Révision 252
Ajouté par Damien REGENT il y a environ 3 ans
branch/Regent/sp4a12/main.c | ||
---|---|---|
}
|
||
return verif;
|
||
}
|
||
|
||
int decode_int(char c)//Fonction qui permet de passer d'un caratere a un entier
|
||
{
|
||
if(c>='0' && c<='9')
|
||
{
|
||
c-=48;
|
||
}
|
||
else
|
||
{
|
||
return -1;
|
||
}
|
||
}
|
||
|
||
int test_decode_int()
|
||
{
|
||
if(decode_int('0')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('1')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('2')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('3')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('4')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('5')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('6')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('7')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('8')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
if(decode_int('9')!=0)
|
||
{
|
||
exit(-1);
|
||
}
|
||
return 1;
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
Formats disponibles : Unified diff
Implantation de decode_int et de son test unitaire qui fonctionnent.