Skip to content
Extraits de code Groupes Projets
Valider a84b1551 rédigé par Andy Laurez's avatar Andy Laurez
Parcourir les fichiers

fix makefile and delete useless test

parent 0cad8c82
Aucune branche associée trouvée
Aucune étiquette associée trouvée
Aucune requête de fusion associée trouvée
...@@ -2,7 +2,7 @@ SHELL := /bin/bash ...@@ -2,7 +2,7 @@ SHELL := /bin/bash
define diff_bash = define diff_bash =
echo "We execute main with the example_input.txt" echo "We execute main with the example_input.txt"
./fact -r example_input.txt -w test_output.txt -N 4 ./fact example_input.txt test_output.txt
diff -q <(sort test_output.txt) <(sort example_output.txt) 1>/dev/null diff -q <(sort test_output.txt) <(sort example_output.txt) 1>/dev/null
if [ $? == 0 ]; then \ if [ $? == 0 ]; then \
echo "output.txt and example_output.txt have the same lines (correct)"; \ echo "output.txt and example_output.txt have the same lines (correct)"; \
...@@ -22,7 +22,7 @@ test: fact ...@@ -22,7 +22,7 @@ test: fact
./test_prime_divs ./test_prime_divs
rm test_prime_divs rm test_prime_divs
$(value diff_bash) $(value diff_bash)
valgrind --tool=memcheck --log-file="valgrind_result.txt" ./fact -r example_input.txt -w test_output.txt valgrind --tool=memcheck --log-file="valgrind_result.txt" ./fact example_input.txt test_output.txt
rm test_output.txt rm test_output.txt
cppcheck --enable=all --output-file=cppcheck_result.txt main.c cppcheck --enable=all --output-file=cppcheck_result.txt main.c
echo "For Valgrind result, check valgrind_result.txt" echo "For Valgrind result, check valgrind_result.txt"
......
...@@ -168,27 +168,7 @@ void test_is_prime(void) ...@@ -168,27 +168,7 @@ void test_is_prime(void)
} }
//test si la fonction test_findnextprime fonctionne
void test_findnextprime(){
long long u;
u = findnextprime(83);
CU_ASSERT(u == 89);
u = findnextprime(40);
CU_ASSERT(u == 41);
u = findnextprime(90);
CU_ASSERT(u == 97);
u = findnextprime(999);
CU_ASSERT(u == 1009);
u = findnextprime(550);
CU_ASSERT(u == 557);
}
// test si la fonction euclide fonctionne correctement // test si la fonction euclide fonctionne correctement
/*void test_euclide(){ /*void test_euclide(){
...@@ -233,8 +213,7 @@ int main(void) { ...@@ -233,8 +213,7 @@ int main(void) {
NULL == CU_add_test(pSUITE1,"\n\n Test si global_args fonction \n\n",test_global_args) || NULL == CU_add_test(pSUITE1,"\n\n Test si global_args fonction \n\n",test_global_args) ||
NULL == CU_add_test(pSUITE1,"\n\n Test si divider_t fonction \n\n",test_struct_divider)|| NULL == CU_add_test(pSUITE1,"\n\n Test si divider_t fonction \n\n",test_struct_divider)||
NULL == CU_add_test(pSUITE1,"\n\n Test si queue_t fonctionne fonction \n\n",test_struct_queue) || NULL == CU_add_test(pSUITE1,"\n\n Test si queue_t fonctionne fonction \n\n",test_struct_queue) ||
NULL == CU_add_test(pSUITE1,"\n\n Test si div_queue fonctionne \n\n",test_struct_div_queue) || NULL == CU_add_test(pSUITE1,"\n\n Test si div_queue fonctionne \n\n",test_struct_div_queue)
NULL == CU_add_test(pSUITE1,"\n\n Test si findnextprime fonctionne \n\n",test_findnextprime)
){ ){
CU_cleanup_registry(); CU_cleanup_registry();
......
0% Chargement en cours ou .
You are about to add 0 people to the discussion. Proceed with caution.
Terminez d'abord l'édition de ce message.
Veuillez vous inscrire ou vous pour commenter