Révision 76
Ajouté par Titouan PODGORSKI il y a environ 3 ans
main.c | ||
---|---|---|
|
||
}
|
||
|
||
int decode_int(char a){
|
||
|
||
int b=a;
|
||
if(48<=b && b<=57){
|
||
b-=48;
|
||
}
|
||
else{
|
||
b=-1;
|
||
}
|
||
return b;
|
||
}
|
||
|
||
int trame_cmp(char *trame, char *type){
|
||
|
||
int i,j,test=1;
|
||
int i,test=1;
|
||
|
||
for(i=0;i<5;i++){
|
||
|
||
... | ... | |
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
||
void test_decode_int(void){
|
||
|
||
if (decode_int('1')!=1){
|
||
printf ("Erreur Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('9')!=9){
|
||
printf ("Erreur Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('A')!=-1){
|
||
printf ("Erreur Test unitaire decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
|
||
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
Formats disponibles : Unified diff
Implémentation de la fonction decode_int et de la fonction test_decode_int (Question 6)