Révision 256
Ajouté par Damien REGENT il y a environ 3 ans
branch/Regent/sp4a12/main.c | ||
---|---|---|
}
|
||
return 1;
|
||
}
|
||
|
||
int decode_nombre(char *ch, int n)//Fonction qui permet de passer d'une chaine de caratere a un entier
|
||
{
|
||
int temp=0, i=0;
|
||
for(i;i<n;i++)
|
||
{
|
||
temp=(temp*10)+decode_int(ch[i]);
|
||
}
|
||
return temp;
|
||
}
|
||
|
||
int test_decode_nombre()
|
||
{
|
||
if(decode_nombre("758961",2)!=75)
|
||
{
|
||
printf("Erreur Test unitaire nombre. \n");
|
||
exit(-1);
|
||
}
|
||
if(decode_nombre("758961",5)!=75896)
|
||
{
|
||
printf("Erreur Test unitaire nombre. \n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
Formats disponibles : Unified diff
Implantation de decode_nombre et de son test unitaire