Projet

Général

Profil

« Précédent | Suivant » 

Révision 274

Ajouté par Guillaume DAVID il y a environ 3 ans

implantation de decode longitude sont test ne fonctionne pas encore

Voir les différences:

branch/david_guillaume/sp4a12/main.c
return resDecodeLat;
}
float decode_longitude(char *trame){
int i;
char minute[5];
float degreLong;
float minLong;
float resDecodeLong;
for(i=0;i<4;i++){
minute[i]=trame[i+35];
}
degreLong=100*decode_int(trame[29])+10*decode_int(trame[30])+decode_int(trame[31]);
minLong=10*decode_int(trame[32])+decode_int(trame[33])+0.0001*decode_nombre(minute,4);
resDecodeLong=degreLong+minLong/60;
return resDecodeLong;
}
//Ajouter vos tests unitaires dans cette fonction.
void tests_unitaires(void){
......
test_decode_nombre();
test_decode_latitude();
test_decode_latitude();
test_decode_longitude();
}
void test_decode_int(void){
......
exit(-1);
}
}
void test_decode_longitude(void){
if(decode_longitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D")!=3.110060){
printf("Erreur test unitaire decode_longitude\n");
printf("%f",decode_longitude("$GPGGA,141914.00,4545.0000,N,00306.6036,E,1,05,3.4,499.3,M,,M,,*7D"));
exit(-1);
}
}
// Ne pas modifier cette fonction
int main(int argc,char ** argv)

Formats disponibles : Unified diff