diff --git a/Projet_M2/run.c b/Projet_M2/run.c index aa4e1f9cd7109abc3e43428821b011da1e8a80d3..bcfa02b86103857d9a498ea661532aab5062cbb0 100755 --- a/Projet_M2/run.c +++ b/Projet_M2/run.c @@ -411,7 +411,7 @@ void thread_create_join(struct buffer_rc *ptr1,struct buffer_cw *ptr2,struct buf int run (char *input,char *output, int n_threads){ N = n_threads; - printf("check2\n"); + FILE *file1 = NULL; FILE *file2 = NULL; @@ -436,7 +436,7 @@ int run (char *input,char *output, int n_threads){ sem_2_initializer(ptr2); thread_create_join(ptr1,ptr2,ptr3); - printf("check3\n"); + fclose(file1); fclose(file2); diff --git a/Projet_M2/test.c b/Projet_M2/test.c index 1c516b12655d74ecf60919c1bd58869cc3e847f1..a6ce9f7f6e101cdea4af8a0840f149cd6cc5434e 100644 --- a/Projet_M2/test.c +++ b/Projet_M2/test.c @@ -18,6 +18,7 @@ void test_is_not_prime(void){ CU_ASSERT_FALSE(is_prime(14)); } void empty_file_test(void){ + printf("check1\n"); FILE *file1 = NULL; int err = run("Test_files/empty_input.txt","actual_output.txt",4); @@ -36,7 +37,7 @@ void empty_file_test(void){ CU_ASSERT_EQUAL(fgets(chaine1,20,file1),NULL); fclose(file1); - + printf("check2\n"); } void short_file_test(void){ @@ -171,7 +172,7 @@ int main(int argc, char *argv[]){ return CU_get_error(); } - printf("check1\n"); + CU_basic_run_tests(); //CU_automated_run_tests(); CU_basic_show_failures(CU_get_failure_list());