Révision 106
Ajouté par ahkurklu il y a environ 4 ans
branch/KURKLU/sp4a12/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){
|
||
/*DECLARATION VARIABLE*/
|
||
int j = 0;
|
||
int i = 0;
|
||
int resultat = 1;
|
||
char c = type[0];
|
||
|
||
|
||
while (c!='\0'){//Boucle while pour d?t?rminer la taille de la chaine de caractere type
|
||
i=i+1;
|
||
c = type[i];
|
||
}
|
||
|
||
while(resultat != 0 && j<i ){ // Boucle while pour comparer la trame et le type
|
||
if(trame[j+1] != type[j]){
|
||
resultat = 0;
|
||
}
|
||
j=j+1;
|
||
}
|
||
return resultat;
|
||
|
||
}
|
||
|
||
//Fonction ? modifier !!!!!
|
||
... | ... | |
printf ("Erreur Test unitaire basique.\n");
|
||
exit(-1);
|
||
}
|
||
/*if (trame_cmp("$GPGGA suite chaine","GPGGA")!=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
|
||
int main(int argc,char ** argv)
|
Formats disponibles : Unified diff
Question 5
-Implémentation trame_cmp()
-Validation des test unitaire