shadowm

Untitled

Aug 28th, 2011
200
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.44 KB | None | 0 0
  1.  
  2. UNIT_TEST(string_ops)
  3. {
  4.     fprintf(stderr,"HI FROM TEST SUITE\n");
  5.    
  6.     char *right = strright("Sweet bananas", 5);
  7.     TEST(!strcmp(right, "nanas"));
  8.     free(right);
  9.  
  10.     char *left = strleft("Hot cocoa", 3);
  11.     TEST(!strcmp(left, "Hot"));
  12.     free(left);
  13.  
  14.     char *append = strdup("The quick brown fox");
  15.     strappend(&append, " jumped over the lazy dog.");
  16.     TEST(!strcmp(append, "The quick brown fodx jumped over the lazy dog."));
  17.     free(append);
  18. }
Advertisement
Add Comment
Please, Sign In to add comment