Commit 8669ec14 authored by Laurent Paucot's avatar Laurent Paucot

code ok, validé par test.c

parent 9fd07842
......@@ -116,10 +116,10 @@ int run (char *input,char *output){
struct node *current;
current = malloc(sizeof(node_t));
*current = *pr_divs->tail;
fprintf(file2,"%s ",chaine);
fprintf(file2,"%s",chaine);
for (int i = 0; i < pr_divs->size; i++)
{
fprintf(file2,"%d ",current->value);
fprintf(file2," %d",current->value);
current = current->next;
}
fputc('\n',file2);
......
......@@ -39,17 +39,15 @@ void file_test(void){
return;
}
CU_ASSERT_PTR_EQUAL(file1,file2);
/* char chaine1[50];
char chaine1[50];
char chaine2[50];
while (fgets(chaine1,50,file1) != NULL && fgets(chaine2,50,file2) != NULL)
{
printf(chaine1);
printf(chaine2);
CU_ASSERT_PTR_EQUAL(chaine1,chaine2);
} */
printf("%d\n",chaine1[2]);
printf("%d\n",chaine2[2]);
CU_ASSERT_STRING_EQUAL(chaine1,chaine2);
}
fclose(file1);
fclose(file2);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment