Révision 151
Ajouté par beclement2 il y a environ 4 ans
main.c | ||
---|---|---|
"$GPZDA,141914.00,01,02,2006,00,00*69",
|
||
0};
|
||
|
||
int trame_cmp(char* a,char* b){
|
||
return 0;
|
||
int trame_cmp(char* trame,char* type){
|
||
|
||
int i=0; //Initialisation des variables
|
||
int verif = 0;
|
||
int j;
|
||
|
||
while(type[i] != NULL){ //Calcul de la taille de la chaine type
|
||
i++;
|
||
}
|
||
|
||
for(j=0; j<i; j++){ //On v?rifie que les premiers caract?res sont identiques
|
||
if (trame[j+1] != type[j]){
|
||
verif = 0;
|
||
}
|
||
else{
|
||
verif = 1;
|
||
}
|
||
|
||
}
|
||
|
||
return verif; //On retourne, 1 c'est valid?, 0 c'est pas valid?.
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
... | ... | |
if (5!=5){
|
||
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
}
|
||
/*
|
||
}
|
||
if (trame_cmp("$GPGGA suite chaine","GPGGA")!=1){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
... | ... | |
if (trame_cmp("$APRMC...", "GPGGA")!=0){
|
||
printf ("Erreur Test unitaire trame_cmp.\n");
|
||
exit(-1);
|
||
}*/
|
||
}
|
||
|
||
}
|
||
|
||
// Ne pas modifier cette fonction
|
||
... | ... | |
{
|
||
|
||
tests_unitaires();
|
||
|
||
|
||
// Affichage des trames definies dans la table trames.
|
||
printf ("Trames de tests tableau trames:\n");
|
||
... | ... | |
char *trame;
|
||
printf ("Trames de tests du fichier gps.log\n");
|
||
while ((trame = trame_suivante()))
|
||
traitement(trame);
|
||
traitement(trame);
|
||
|
||
|
||
return 0;
|
||
}
|
Formats disponibles : Unified diff
Fin question 5