void str_rot_13_test_cases() { char const input[4] = {'a', 'd', 't', '\0'}; char result[4]; str_rot_13(input, result); checkit_string(result, "nqg"); char const input1[4] = {'d', 'a', 't', '\0'}; char result1[4]; str_rot_13(input1, result1); checkit_string(result1, "qng"); }
void str_cat_101_test_cases() { char const input1[3] = {'t', 'e', '\0'}; char const input2[3] = {'s', 't' , '\0'}; char result[6]; str_cat_101(input1, input2, result); checkit_string(result, "test"); char const input3[7] = {'p', 'l', 'e', 'a', 's', 'e', '\0'}; char const input4[5] = {'p', 'a', 's', 's', '\0'}; char result1[11]; str_cat_101(input3, input4, result1); checkit_string(result1, "pleasepass"); }
/* SLLcheck checks that each node in a string-linked-list against an array of string */ void SLLcheck(SLL *list, char* strArray[]) { int i; SLL *p; for ( p=list, i=0; p!=NULL; p=p->next, i++){ printf("SLL check : "); checkit_string(p->s, strArray[i]); } /* if expected value is NULL, checks that argument evaluates to NULL */ if (strArray==NULL) { printf("SLL check : "); checkit_int(1, (list==NULL)); } return; }