Révision 188
Ajouté par beclement2 il y a environ 4 ans
branch/CLEMENT/sp4a12/main.c | ||
---|---|---|
int test_decode_nombre(){
|
||
|
||
|
||
char testchar[] = "7541";
|
||
char testchar[] = "9876";
|
||
int test = decode_nombre(testchar, 3);
|
||
return test;
|
||
|
||
}
|
||
|
||
float latitude(char * chaine){
|
||
|
||
int i = 0;
|
||
int j = 0;
|
||
float resultat = 0;
|
||
int temporaire = 0;
|
||
char tempo;
|
||
|
||
while(chaine[i] != NULL){ //Calcul de la taille de la chaine type
|
||
i++;
|
||
}
|
||
|
||
for(j=0; j<4; j++){ //On v?rifie que les premiers caract?res sont identiques
|
||
if (chaine[j] != "."){
|
||
temporaire = temporaire + decode_int(chaine[j]) * pow(10,(3-j));
|
||
}
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
return resultat;
|
||
|
||
|
||
|
||
|
||
}
|
||
|
||
|
||
float longitude(float ch)
|
||
{
|
||
|
||
|
||
|
||
}
|
||
|
||
//Ajouter vos tests unitaires dans cette fonction.
|
||
void tests_unitaires(void){
|
||
if (5!=5){
|
||
... | ... | |
printf ("Erreur Test unitaire test_decode_int.\n");
|
||
exit(-1);
|
||
}
|
||
if(test_decode_nombre() != 754){
|
||
if(test_decode_nombre() != 987){
|
||
printf ("Erreur Test unitaire test_decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
... | ... | |
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
||
{
|
||
printf("Test %f", latitude("3723.2475"));
|
||
|
||
tests_unitaires();
|
||
|
Formats disponibles : Unified diff
question 9 pas fini