Révision 312
Ajouté par Florentin GAMEL il y a presque 3 ans
branch/gamel/sp4a12/main.c | ||
---|---|---|
}
|
||
|
||
|
||
float decode_trame(char*trame,position p)
|
||
position decode_trame(char*trame)
|
||
{
|
||
position p;
|
||
p.Lat=0;
|
||
p.Long=0;
|
||
int i;
|
||
|
||
if (trame_cmp(trame[i],"GPGGA")==1)
|
||
{
|
||
decode_position(trame[i],p)
|
||
p=decode_position(trame);
|
||
}
|
||
return p;
|
||
}
|
||
|
||
|
||
... | ... | |
}
|
||
}
|
||
|
||
|
||
void test_decode_trame (void){
|
||
if(decode_trame(trames[4]).Lat!=45.75){
|
||
printf("Erreur test unitaire decode_trame1\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_trame(trames[4]).Long!=3.1100599765777588){
|
||
printf("Erreur test unitaire decode_trame2\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_trame(trames[0]).Lat!=0){
|
||
printf("Erreur test unitaire decode_trame3\n");
|
||
exit(-1);
|
||
}
|
||
if(decode_trame(trames[0]).Long!=0){
|
||
printf("Erreur test unitaire decode_trame4\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
Formats disponibles : Unified diff
TP2 question 1 et 2, insertion de la fonction decode trame et tests unitaires.