Projet

Général

Profil

« Précédent | Suivant » 

Révision 105

Ajouté par chsabot il y a presque 4 ans

4) Implantation de la fonction trame_cmp

Voir les différences:

branch/sabot/sp4abc/sp4a12/main.c
#include <stdio.h>
#include <stdlib.h>
#include <strings.h>
#include "trame.h"
#include "trame.h"
//Fonction compare trame
int trame_cmp(char * trame, char * type)
{
int i,j,res;
i= 0;
j=1;
res=1;
while(type[i]!='\0')//Calcul de la taille de la chaine de caract?res type
{
i=i+1;
}
while(j<=5 && res==1)
{
if(trame[j]!= type[j])
{
res=0;
}
j=j+1;
}
return i;
}
//Trames de tests ? modifier si n?cessaire.
char * trames[]= {"$GPGSV,3,2,10,15,03,077,,18,04,041,42,19,85,271,,20,08,214,*7C",
......
"$GPZDA,141914.00,01,02,2006,00,00*69",
0};
int trame_cmp(char* a,char* b){
return 0;
}
//Fonction ? modifier !!!!!
void traitement(char * trame)
......
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

Formats disponibles : Unified diff