Projet

Général

Profil

« Précédent | Suivant » 

Révision 171

Ajouté par faba6 il y a presque 4 ans

Solution à la question_5

Voir les différences:

trunk/sp4abc/sp4a12/main.c
int trame_cmp(char* a,char* b){
return 0;
}
int trame_cmp(char* a,char* b){
int k=0; //Initialisation des variables
int verif = 1;
int j;
while(b[k] != NULL){ //Calcul de la taille de la chaine type
k++;
}
for(j=0; j<k; j++){ //On v?rifie que les premiers caract?res sont identiques
if (a[j+1] != b[j]){
verif = 0;
}
}
return verif; //On retourne, 1 c'est valid?, 0 c'est pas valid?.
}
/*Fonction ? modifier !!!!!*/
......
/*Ajouter vos tests unitaires dans cette fonction.*/
void tests_unitaires(void){
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);
......
printf ("Erreur Test unitaire trame_cmp.\n");
exit(-1);
}
*/
}

Formats disponibles : Unified diff