Changeset 7901 for trunk/psLib/test/sys
- Timestamp:
- Jul 13, 2006, 4:26:25 PM (20 years ago)
- Location:
- trunk/psLib/test/sys
- Files:
-
- 1 added
- 3 edited
-
Makefile.am (modified) (2 diffs)
-
tst_psLine.c (added)
-
tst_psString.c (modified) (4 diffs)
-
verified/tst_psString.stderr (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sys/Makefile.am
r7884 r7901 12 12 tst_psString \ 13 13 tst_psTrace \ 14 tap_psStringSubstitute 14 tap_psStringSubstitute \ 15 tst_psLine 15 16 16 17 tst_psAbort_SOURCES = tst_psAbort.c … … 21 22 tst_psString_SOURCES = tst_psString.c 22 23 tst_psTrace_SOURCES = tst_psTrace.c 24 tst_psLine_SOURCES = tst_psLine.c 23 25 24 26 tap_psStringSubstitute_CPPFLAGS = $(AM_CPPFLAGS) -I$(top_srcdir)/test/tap/src -
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 -
trunk/psLib/test/sys/verified/tst_psString.stderr
r7880 r7901 175 175 ---> TESTPOINT PASSED (psString{Test NULL String Error Handling} | tst_psString.c) 176 176 177 /***************************** TESTPOINT ******************************************\ 178 * TestFile: tst_psString.c * 179 * TestPoint: psString{Test String Allocation and MemCheck} * 180 * TestType: Positive * 181 \**********************************************************************************/ 182 183 184 ---> TESTPOINT PASSED (psString{Test String Allocation and MemCheck} | tst_psString.c) 185
Note:
See TracChangeset
for help on using the changeset viewer.
