Révision 90
Ajouté par Clara SOULARD il y a environ 3 ans
main.c | ||
---|---|---|
}
|
||
return ok;
|
||
}
|
||
int decode_int (char c)
|
||
{
|
||
int i=c-48;
|
||
int ok=-1;
|
||
if (i>=0 && i<=9){
|
||
ok=i;
|
||
}
|
||
return ok;
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
printf ("> %s\n",trame);
|
||
}
|
||
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
... | ... | |
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur 4 Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
if(decode_int('G')!=-1){
|
||
printf("Erreur 1 test unitaire decode_int.\n");
|
||
}
|
||
if(decode_int('6')!=6){
|
||
printf("Erreur 2 test unitaire decode_int.\n");
|
||
}
|
||
if(decode_int('B')!=(-1)){
|
||
printf("Erreur 3 test unitaire decode_int.\n");
|
||
}
|
||
if(decode_int('4')!=4){
|
||
printf("Erreur 4 test unitaire decode_int.\n");
|
||
}
|
||
int a=decode_int('F');
|
||
printf("a vaut : %d \n", a);
|
||
|
||
}
|
||
|
Formats disponibles : Unified diff
reponse question 6