Projet

Général

Profil

« Précédent | Suivant » 

Révision 153

Ajouté par anclaud il y a presque 4 ans

Question 4 et 5 : fonctions trame_cmp tests unitaires OK

Voir les différences:

branch/CLAUD/sp4a12/main.c
"$GPZDA,141914.00,01,02,2006,00,00*69",
0};
int trame_cmp(char* a,char* b){
return 0;
// Fonction trame_cmp
int trame_cmp(char * trame, char * type)
{
int i = 0, j = 0, resultat = 1;
while(type[i] != '\0')
{
i++;
}
while(j<i)
{
if (trame[j+1] != type[j])
{
resultat = 0;
}
j++;
}
return resultat;
}
//Fonction ? modifier !!!!!
......
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);
......
exit(-1);
}
if (trame_cmp("$APRMC...", "GPGGA")!=0){
printf ("Erreur Test unitaire trame_cmp.\n");
printf ("Erreur Test unitaire trame_cmp4.\n");
exit(-1);
}*/
}
}
// Fonction trame_cmp
int trame_cmp(char * trame, char * type)
{
int i = 0, j = 0, resultat = 1;
while(type[i] != '\0')
{
i++;
}
while(j<i)
{
if (trame[j] != type[j])
{
resultat = 0;
}
j++;
}
return resultat;
}
// Ne pas modifier cette fonction
int main(int argc,char ** argv)

Formats disponibles : Unified diff