Changeset 15806 in vbox for trunk/src/VBox/Runtime
- Timestamp:
- Jan 5, 2009 3:09:48 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstPath.cpp
r15756 r15806 98 98 const char *pcszOutput; 99 99 } 100 aRTPathAbsExTests[] =100 s_aRTPathAbsExTests[] = 101 101 { 102 102 #if defined (RT_OS_OS2) || defined (RT_OS_WINDOWS) … … 152 152 }; 153 153 154 for (unsigned i = 0; i < RT_ELEMENTS( aRTPathAbsExTests); ++ i)155 { 156 rc = RTPathAbsEx( aRTPathAbsExTests[i].pcszInputBase,157 aRTPathAbsExTests[i].pcszInputPath,154 for (unsigned i = 0; i < RT_ELEMENTS(s_aRTPathAbsExTests); ++ i) 155 { 156 rc = RTPathAbsEx(s_aRTPathAbsExTests[i].pcszInputBase, 157 s_aRTPathAbsExTests[i].pcszInputPath, 158 158 szPath, sizeof(szPath)); 159 if (rc != aRTPathAbsExTests[i].rc)159 if (rc != s_aRTPathAbsExTests[i].rc) 160 160 { 161 161 RTPrintf("tstPath: RTPathAbsEx unexpected result code!\n" … … 165 165 " rc: %Rrc\n" 166 166 " expected rc: %Rrc\n", 167 aRTPathAbsExTests[i].pcszInputBase,168 aRTPathAbsExTests[i].pcszInputPath,167 s_aRTPathAbsExTests[i].pcszInputBase, 168 s_aRTPathAbsExTests[i].pcszInputPath, 169 169 szPath, rc, 170 aRTPathAbsExTests[i].rc);170 s_aRTPathAbsExTests[i].rc); 171 171 cErrors++; 172 172 continue; … … 175 175 char szTmp[RTPATH_MAX]; 176 176 char *pszExpected = NULL; 177 if ( aRTPathAbsExTests[i].pcszOutput != NULL)177 if (s_aRTPathAbsExTests[i].pcszOutput != NULL) 178 178 { 179 if ( aRTPathAbsExTests[i].pcszOutput[0] == '%')179 if (s_aRTPathAbsExTests[i].pcszOutput[0] == '%') 180 180 { 181 /** @todo Use RTPathGetCurrent(). */ 181 182 if (getcwd(szTmp, sizeof(szTmp)) == NULL) 182 183 { … … 188 189 pszExpected = szTmp; 189 190 190 if ( aRTPathAbsExTests[i].pcszOutput[1] == 'p')191 if (s_aRTPathAbsExTests[i].pcszOutput[1] == 'p') 191 192 { 192 193 size_t cch = strlen(szTmp); 193 if (cch + strlen (aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp))194 strcpy (szTmp + cch,aRTPathAbsExTests[i].pcszOutput + 2);194 if (cch + strlen(s_aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp)) 195 strcpy(szTmp + cch, s_aRTPathAbsExTests[i].pcszOutput + 2); 195 196 } 196 #if defined (RT_OS_OS2) || defined(RT_OS_WINDOWS)197 else if ( aRTPathAbsExTests[i].pcszOutput[1] == 'd')197 #if defined(RT_OS_OS2) || defined(RT_OS_WINDOWS) 198 else if (s_aRTPathAbsExTests[i].pcszOutput[1] == 'd') 198 199 { 199 if (2 + strlen (aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp))200 strcpy (szTmp + 2,aRTPathAbsExTests[i].pcszOutput + 2);200 if (2 + strlen(s_aRTPathAbsExTests[i].pcszOutput) - 2 <= sizeof(szTmp)) 201 strcpy(szTmp + 2, s_aRTPathAbsExTests[i].pcszOutput + 2); 201 202 } 202 203 #endif … … 204 205 else 205 206 { 206 strcpy(szTmp, aRTPathAbsExTests[i].pcszOutput);207 strcpy(szTmp, s_aRTPathAbsExTests[i].pcszOutput); 207 208 pszExpected = szTmp; 208 209 } … … 215 216 " output: '%s'\n" 216 217 " expected: '%s'\n", 217 aRTPathAbsExTests[i].pcszInputBase,218 aRTPathAbsExTests[i].pcszInputPath,218 s_aRTPathAbsExTests[i].pcszInputBase, 219 s_aRTPathAbsExTests[i].pcszInputPath, 219 220 szPath, 220 aRTPathAbsExTests[i].pcszOutput);221 s_aRTPathAbsExTests[i].pcszOutput); 221 222 cErrors++; 222 223 } … … 228 229 */ 229 230 RTPrintf("tstPath: RTPathStripFilename...\n"); 230 static const char * apszStripFilenameTests[] =231 static const char *s_apszStripFilenameTests[] = 231 232 { 232 233 "/usr/include///", "/usr/include//", … … 242 243 #endif 243 244 }; 244 for (unsigned i = 0; i < RT_ELEMENTS( apszStripFilenameTests); i += 2)245 { 246 const char *pszInput = apszStripFilenameTests[i];247 const char *pszExpect = apszStripFilenameTests[i + 1];245 for (unsigned i = 0; i < RT_ELEMENTS(s_apszStripFilenameTests); i += 2) 246 { 247 const char *pszInput = s_apszStripFilenameTests[i]; 248 const char *pszExpect = s_apszStripFilenameTests[i + 1]; 248 249 char szPath[RTPATH_MAX]; 249 250 strcpy(szPath, pszInput);
Note:
See TracChangeset
for help on using the changeset viewer.