home *** CD-ROM | disk | FTP | other *** search
/ Nebula 1994 June / NEBULA_SE.ISO / SourceCode / MiscKit / Examples / MiscString / StringTestSybase.m < prev    next >
Encoding:
Text File  |  1994-01-26  |  1.4 KB  |  41 lines

  1. //
  2. // StringTestSybase.m -- test out the String class' Sybase category
  3. //        Written by Don Yacktman (c) 1994 by Don Yacktman.
  4. //                Version 1.0.  All rights reserved.
  5. //
  6. //        This notice may not be removed from this source code.
  7. //
  8. //    This program is included in the MiscKit by permission from the author
  9. //    and its use is governed by the MiscKit license, found in the file
  10. //    "LICENSE.rtf" in the MiscKit distribution.  Please refer to that file
  11. //    for a list of all applicable permissions and restrictions.
  12. //    
  13.  
  14. #define SYSTRINGS 6
  15. void testMiscStringSybase()
  16. {
  17.     int i; id string[SYSTRINGS];
  18.     printf("***** Testing MiscStringSybase category\n");
  19.  
  20. // Test MiscStringSybase.m methods:
  21.     string[0] = [MiscString newWithString:""];
  22.     string[1] = [MiscString
  23.         newWithString:"This* _is_ a? test of% wild*card??s."];
  24.     string[2] = [MiscString newWithString:"Case insensitive."];
  25.     string[3] = [MiscString newWithString:"(#@!)^&-+=."];
  26.     string[4] = [[MiscString alloc] init];
  27.  
  28.     for (i=0; i<SYSTRINGS - 1; i++) {
  29.         printf("Before: \"%s\"\n", [string[i] stringValue]);
  30.         [string[i] convertUnixWildcardsToSybase];
  31.         printf("    wc: \"%s\"\n", [string[i] stringValue]);
  32.         [string[i] convertToCaseInsensitiveSearchString];
  33.         printf("  ciss: \"%s\"\n", [string[i] stringValue]);
  34.         string[SYSTRINGS - 1] = [string[i] makeCaseInsensitiveSearchString];
  35.         printf(" nciss: \"%s\"\n\n",
  36.             [string[SYSTRINGS - 1] stringValueAndFree]);
  37.         [string[i] free];
  38.     }
  39. }
  40.  
  41.