Révision 30
Ajouté par Stephen LOPEZ il y a environ 3 ans
branch/LOPEZ_Stephen/tp_sp4_2022_LOPEZ_Stephen/sp4a12/main.c | ||
---|---|---|
return val;
|
||
}
|
||
|
||
int decode_nombre(char *ch, int n)
|
||
{
|
||
int i;
|
||
int S=0;
|
||
for(i=0;i<n;i++)
|
||
{
|
||
S = (S*10)+ decode_int(ch[i]);
|
||
}
|
||
return S;
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
void tests_unitaires(void){
|
||
/*
|
||
if (5!=5){
|
||
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
... | ... | |
if (decode_int('A')!=-1){
|
||
printf ("Erreur Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
if (decode_nombre("7541",2)!=75){
|
||
printf ("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
*/
|
||
|
||
}
|
||
|
||
|
Formats disponibles : Unified diff
question 7 terminée