Changeset 7901 for trunk/psLib/test/sys/tst_psString.c
- Timestamp:
- Jul 13, 2006, 4:26:25 PM (20 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sys/tst_psString.c (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/tst_psString.c
r7880 r7901 20 20 * @author Eric Van Alst, MHPCC 21 21 * 22 * @version $Revision: 1.1 0$ $Name: not supported by cvs2svn $23 * @date $Date: 2006-07-1 2 21:25:39$22 * @version $Revision: 1.11 $ $Name: not supported by cvs2svn $ 23 * @date $Date: 2006-07-14 02:26:25 $ 24 24 * 25 25 * Copyright 2004-2005 Maui High Performance Computing Center, University of Hawaii … … 53 53 static psS32 testStrSplit00(void); 54 54 static psS32 testNULLStrings(void); 55 static psS32 testStrCheck(void); 55 56 56 57 testDescription tests[] = { … … 74 75 {testStrSplit00,15, "Test String Splitting", 0, false}, 75 76 {testNULLStrings,666, "Test NULL String Error Handling", 0, false}, 77 {testStrCheck,16, "Test String Allocation and MemCheck", 0, false}, 76 78 {NULL} 77 79 }; … … 709 711 return 0; 710 712 } 713 714 psS32 testStrCheck(void) 715 { 716 psString str = NULL; 717 str = psStringAlloc(10); 718 strcpy(str, "Hello"); 719 if (!psMemCheckString(str)) { 720 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 721 "psString wasn't properly allocated!\n"); 722 return 1; 723 } 724 if (!psMemCheckType(PS_DATA_STRING, str)) { 725 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 726 "psString wasn't properly allocated!\n"); 727 return 2; 728 } 729 psFree(str); 730 731 char charStr[10]; 732 if (psMemCheckType(PS_DATA_STRING, charStr)) { 733 psError(PS_ERR_BAD_PARAMETER_VALUE, true, 734 "Input string is not a psDataType!!! (Should have returned false)\n"); 735 return 3; 736 } 737 738 return 0; 739 } 740
Note:
See TracChangeset
for help on using the changeset viewer.
