Révision 175
Ajouté par anclaud il y a presque 4 ans
main.c | ||
---|---|---|
exit(-1);
|
||
}
|
||
// Appel de la fonction de tests pour decode_int()
|
||
test_decode_int();
|
||
test_decode_int();
|
||
|
||
// Appel de la fonction de tests pour decode_nombre()
|
||
test_decode_nombre();
|
||
}
|
||
|
||
int decode_int(char c) // Fonction permettant de transformer un code ASCII en d?cimal
|
||
... | ... | |
return res;
|
||
}
|
||
|
||
// Fonction de tests unitaire
|
||
// Fonction de tests unitaire
|
||
void test_decode_nombre(void)
|
||
{
|
||
if (decode_nombre("987654321",3) != 987)
|
||
{
|
||
printf ("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
|
||
if (decode_nombre("7541",2) != 75)
|
||
{
|
||
printf ("Erreur Test unitaire decode_nombre.\n");
|
||
exit(-1);
|
||
}
|
||
}
|
||
|
||
|
||
// Ne pas modifier cette fonction
|
||
int main(int argc,char ** argv)
|
||
{
|
Formats disponibles : Unified diff
Question 8 : Test unitaires deocde_nombre() OK