Changeset 2204 for trunk/psLib/test/sysUtils/tst_psString.c
- Timestamp:
- Oct 26, 2004, 2:57:34 PM (22 years ago)
- File:
-
- 1 edited
-
trunk/psLib/test/sysUtils/tst_psString.c (modified) (12 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/psLib/test/sysUtils/tst_psString.c
r1977 r2204 17 17 * @author Eric Van Alst, MHPCC 18 18 * 19 * @version $Revision: 1. 9$ $Name: not supported by cvs2svn $20 * @date $Date: 2004-10- 06 01:59:08$19 * @version $Revision: 1.10 $ $Name: not supported by cvs2svn $ 20 * @date $Date: 2004-10-27 00:57:33 $ 21 21 * 22 22 * Copyright 2004 Maui High Performance Computing Center, University of Hawaii … … 28 28 #include "psTest.h" 29 29 30 static inttestStringCopy00(void);31 static inttestStringCopy01(void);32 static inttestStringCopy02(void);33 static inttestStringCopy03(void);34 static inttestStringCopy04(void);35 static inttestStringCopy05(void);36 static inttestStringCopy06(void);30 static psS32 testStringCopy00(void); 31 static psS32 testStringCopy01(void); 32 static psS32 testStringCopy02(void); 33 static psS32 testStringCopy03(void); 34 static psS32 testStringCopy04(void); 35 static psS32 testStringCopy05(void); 36 static psS32 testStringCopy06(void); 37 37 38 38 testDescription tests[] = { … … 47 47 }; 48 48 49 int main( intargc, char* argv[] )49 psS32 main( psS32 argc, char* argv[] ) 50 50 { 51 51 psLogSetLevel( PS_LOG_INFO ); … … 55 55 56 56 /* 57 int main( intargc,57 psS32 main( psS32 argc, 58 58 char * argv[] ) 59 59 { 60 bool tpResult = false;60 psBool tpResult = false; 61 61 char stringval[20] = "E R R O R"; 62 62 char stringval1[20] = "e r r o r"; 63 63 char *stringvalnocopy = "F A I L"; 64 64 char *substringval = "e r r"; 65 intsubstringlen = 6;65 psS32 substringlen = 6; 66 66 char *emptyval = ""; 67 inttpFails = 0;68 char *strResult; 69 intincreaseSize = 5;70 intnegativeSize = -5;71 intresult = 0;72 intresult1 = 0;73 intmemBlockAllocated = 0;67 psS32 tpFails = 0; 68 char *strResult; 69 psS32 increaseSize = 5; 70 psS32 negativeSize = -5; 71 psS32 result = 0; 72 psS32 result1 = 0; 73 psS32 memBlockAllocated = 0; 74 74 psMemBlock ***memBlockPtr = NULL; 75 75 76 76 */ 77 77 78 static inttestStringCopy00(void)79 { 80 char stringval[20] = "E R R O R"; 81 intresult = 0;82 intresult1 = 0;78 static psS32 testStringCopy00(void) 79 { 80 char stringval[20] = "E R R O R"; 81 psS32 result = 0; 82 psS32 result1 = 0; 83 83 char *strResult; 84 84 … … 107 107 } 108 108 109 static inttestStringCopy01(void)109 static psS32 testStringCopy01(void) 110 110 { 111 111 char *emptyval = ""; 112 intresult = 0;112 psS32 result = 0; 113 113 char *strResult; 114 114 … … 130 130 } 131 131 132 static inttestStringCopy02(void)133 { 134 intresult = 0;135 intresult1 = 0;132 static psS32 testStringCopy02(void) 133 { 134 psS32 result = 0; 135 psS32 result1 = 0; 136 136 char *strResult; 137 137 char stringval1[20] = "e r r o r"; 138 intsubstringlen = 5;138 psS32 substringlen = 5; 139 139 char *substringval = "e r r"; 140 140 … … 161 161 } 162 162 163 static inttestStringCopy03(void)164 { 165 intresult = 0;166 intresult1 = 0;163 static psS32 testStringCopy03(void) 164 { 165 psS32 result = 0; 166 psS32 result1 = 0; 167 167 char *strResult; 168 168 char *stringvalnocopy = "F A I L"; … … 185 185 } 186 186 187 static inttestStringCopy04(void)188 { 189 intresult = 0;190 intresult1 = 0;191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 intincreaseSize = 5;187 static psS32 testStringCopy04(void) 188 { 189 psS32 result = 0; 190 psS32 result1 = 0; 191 char *strResult; 192 char stringval[20] = "E R R O R"; 193 psS32 increaseSize = 5; 194 194 195 195 // Test point #5 Copy string to larger string - psStringNCopy … … 205 205 strResult, stringval); 206 206 fprintf(stderr," strlne result = %d expected %d\n",result1, 207 ( int)strlen(stringval));207 (psS32)strlen(stringval)); 208 208 return 1; 209 209 } … … 214 214 } 215 215 216 static inttestStringCopy05(void)217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 intnegativeSize = -5;216 static psS32 testStringCopy05(void) 217 { 218 char *strResult; 219 char stringval[20] = "E R R O R"; 220 psS32 negativeSize = -5; 221 221 222 222 // Test point #6 Copy string with negative size - psStringNCopy … … 224 224 if ( strResult != NULL ) { 225 225 fprintf(stderr,"Failed test point #6 return value = %ld expected NULL\n", 226 ( unsigned long)strResult);226 (psU64)strResult); 227 227 return 1; 228 228 } … … 232 232 } 233 233 234 static inttestStringCopy06(void)235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 intresult = 0;234 static psS32 testStringCopy06(void) 235 { 236 char *strResult; 237 char stringval[20] = "E R R O R"; 238 psS32 result = 0; 239 239 240 240 // Test point #7 Verify creation of string literal - PS_STRING
Note:
See TracChangeset
for help on using the changeset viewer.
