Révision 70
Ajouté par clbouillot2 il y a environ 4 ans
main.c | ||
---|---|---|
|
||
return (res);
|
||
}
|
||
|
||
int decode_nombre (char ch[], int n)
|
||
{
|
||
int i,nb=0;
|
||
for(i=0;i<n;i++)
|
||
{
|
||
nb=nb*10;
|
||
nb=nb+decode_int(ch[i]);
|
||
}
|
||
return nb;
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
if (decode_int('A')!=-1){
|
||
printf ("Erreur2 Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_nombre("2550",3)!=255){
|
||
printf ("Erreur1 Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_nombre("78965324",5)!=78965){
|
||
printf ("Erreur2 Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
Formats disponibles : Unified diff
Question 8