Révision 93
Ajouté par Victor SOUDY il y a environ 3 ans
branch/SOUDY/main.c | ||
---|---|---|
}
|
||
return test;
|
||
}
|
||
|
||
int decode_int(char c)
|
||
{
|
||
if(c<='9' && c>='0')
|
||
{
|
||
c=c-48;
|
||
}
|
||
else
|
||
{
|
||
c=-1;
|
||
}
|
||
return(c);
|
||
}
|
||
|
||
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char*trame)
|
||
... | ... | |
exit(-1);
|
||
}
|
||
if (trame_cmp("$APRMC...", "GPGGA")!=0)
|
||
{if (decode_int('0')!=0)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
... | ... | |
{
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
//--------------------------------------------//
|
||
//test unitaire de la fonction decode_int
|
||
|
||
if (decode_int('0')!=0)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('1')!=1)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('2')!=2)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('3')!=3)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('4')!=4)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('5')!=5)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('6')!=6)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('7')!=7)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('8')!=8)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
if (decode_int('9')!=9)
|
||
{
|
||
printf("Erreur test unitaire decode_int\n");
|
||
exit(-1);
|
||
}
|
||
|
||
}
|
||
|
||
|
||
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
||
{
|
Formats disponibles : Unified diff
question 6: ajout fct decode_nombre + tests unitaires