diff --git a/test/test_analytics/patch_test_files/example7_new.c b/test/test_analytics/patch_test_files/example7_new.c new file mode 100644 index 00000000000..9782b3507f9 --- /dev/null +++ b/test/test_analytics/patch_test_files/example7_new.c @@ -0,0 +1,52 @@ +/* added in H */ +struct node +{ + int data; + struct node *next; +}*head; + +/* added in H, edited in I */ +void append(int num) +{ + struct node *temp, *prev; + temp=head; + while(temp!=NULL) + { + if(temp->data==num) + { + if(temp==head) + { + head=temp->next; + free(temp); + return 1; + } + else + { + prev->next=temp->next; + free(temp); + return 1; + } + } + else + { + prev=temp; + temp= temp->next; + } + } + return 0; +} + +/* added in H, edited in G */ +void add( int num ) +{ + struct node *temp; + temp=(struct node *)malloc(sizeof(struct node)); + temp->data=num; + if (head== NULL) + { + head=temp; + head->next=NULL; + } +} + +/* insert() is deleted in I */ diff --git a/test/test_analytics/patch_test_files/example7_old.c b/test/test_analytics/patch_test_files/example7_old.c new file mode 100644 index 00000000000..6157d001d3f --- /dev/null +++ b/test/test_analytics/patch_test_files/example7_old.c @@ -0,0 +1,65 @@ +/* added in H */ +struct node +{ + int data; + struct node *next; +}*head; + +/* added in H */ +void append(int num) +{ + struct node *temp,*right; + temp= (struct node *)malloc(sizeof(struct node)); + temp->data=num; + right=(struct node *)head; + while(right->next != NULL) + right=right->next; + right->next =temp; + right=temp; + right->next=NULL; +} + +/* added in H */ +void add( int num ) +{ + struct node *temp; + temp=(struct node *)malloc(sizeof(struct node)); + temp->data=num; + if (head== NULL) + { + head=temp; + head->next=NULL; + } + else + { + temp->next=head; + head=temp; + } +} + +/* added in H */ +void insert(int num) +{ + int c=0; + struct node *temp; + temp=head; + if(temp==NULL) + { + add(num); + } + else + { + while(temp!=NULL) + { + if(temp->datanext; + } + if(c==0) + add(num); + else if(c