Révision 63
Ajouté par mamorales il y a environ 4 ans
main.c | ||
---|---|---|
return comp;
|
||
}
|
||
|
||
//fonction qui retourne l'entier correspondant au caractere mis en argument. (le caract?re '1' retourne l'entier 1)
|
||
int decode_int (char c)
|
||
{
|
||
int i=0;
|
||
if ((c>=48)&&(c<=57))
|
||
{
|
||
i=c-48;
|
||
}
|
||
else
|
||
{
|
||
(i=-1);
|
||
}
|
||
return i;
|
||
}
|
||
|
||
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
}
|
||
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
exit(-1);
|
||
}
|
||
if ((decode_int('0')!=0)||(decode_int('9')!=9)||(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 decode_int() et d'un test unitaire dans la fonction tests_unitaires(void).