Révision 36
Ajouté par Enzo LACHEZE il y a environ 3 ans
main.c | ||
---|---|---|
s=(s*10)+decode_int(ch[i]);
|
||
}
|
||
return s;
|
||
}
|
||
|
||
float latitude(char* ch,int n)
|
||
{
|
||
float deg;
|
||
float minute;
|
||
float diminute;
|
||
float resultat;
|
||
deg=(float)decode_nombre(&ch[n], 2);
|
||
minute=(float)decode_nombre(&ch[n+2],2);
|
||
minute=minute/60;
|
||
diminute=(float)decode_nombre(&ch[n+5],4);
|
||
diminute=diminute/600000;
|
||
resultat=deg+minute+diminute;
|
||
return resultat;
|
||
|
||
|
||
}
|
||
//Fonction ? modifier !!!!!
|
||
void traitement(char * trame)
|
||
... | ... | |
exit(-1);
|
||
}
|
||
if(decode_int('A')!=-1){
|
||
printf ("Erreur Test unitaire traif(decode_nombre("7541",2)!=75){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}me_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_int('Z')!=-1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
//test decode_nombre
|
||
if(decode_nombre("7541",2)!=75){
|
||
/*if(decode_nombre("7541",2)!=75){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_nombre("7541",3)!=754){
|
||
printf ("Erreur Test unitaire trif(decode_nombre("7541",2)!=75){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}ame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_nombre("123",3)!=123){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
... | ... | |
}
|
||
if(decode_nombre("987654321",2)!=98){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);if(decode_nombre("7541",2)!=75){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}
|
||
}*/
|
||
if ((latitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D",17)-45.75)>0.01)
|
||
{
|
||
printf("Erreur Test unitaire trame\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
Formats disponibles : Unified diff
question 8 validé test avec une trame prise au hasard faites