Projet

Général

Profil

« Précédent | Suivant » 

Révision 37

Ajouté par Stephen LOPEZ il y a environ 3 ans

question 8 implantation fonction latitude terminée

Voir les différences:

branch/LOPEZ_Stephen/tp_sp4_2022_LOPEZ_Stephen/sp4a12/main.c
return S;
}
float latitude (char *ch)
{
float deg;
deg = decode_nombre(&ch[17],2)+(decode_nombre(&ch[17+2],2)/60)+(decode_nombre(&ch[17+5],4)/600000);
return deg;
}
//Ajouter vos tests unitaires dans cette fonction.
void tests_unitaires(void){
/*
......
exit(-1);
}
if (trame_cmp("$GPRMC... ", "GPRMC" )!=1){
printf ("Erreur Test unitaire trame_cmp.\n");
printf ("Erreur Test unitaire trame_cmp.\n");3723.2475
exit(-1);
}
if (trame_cmp("$APRMC...", "GPGGA")!=0){
......
if (decode_int('5')!=5){
printf ("Erreur Test unitaire decode_int.\n");
exit(-1);
}
}45
if (decode_int('9')!=9){
printf ("Erreur Test unitaire decode_int.\n");
exit(-1);
......
printf ("Erreur Test unitaire decode_nombre.\n");
exit(-1);
}
if (latitude("3723.2475")-37.387458>0.0001){
printf ("Erreur Test unitaire latitude.\n");
exit(-1);
}
if (latitude("$GPGGA,141921.00,4545.1610,N,00306.6043,E,1,05,3.4,499.8,M,,M,,*7C")-45.75268333>0.01){
printf ("Erreur Test unitaire latitude.\n");
exit(-1);
}
*/
}

Formats disponibles : Unified diff