- Timestamp:
- Jan 27, 2012 7:05:59 PM (13 years ago)
- Location:
- trunk/src/VBox/Runtime
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/common/string/ministring.cpp
r39897 r39903 8 8 9 9 /* 10 * Copyright (C) 2007-201 1Oracle Corporation10 * Copyright (C) 2007-2012 Oracle Corporation 11 11 * 12 12 * This file is part of VirtualBox Open Source Edition (OSE), as … … 207 207 if (pszThis) 208 208 { 209 const char *pszHit = strstr(pszThis , pcszFind);209 const char *pszHit = strstr(pszThis + pos, pcszFind); 210 210 if (pszHit) 211 211 return pszHit - pszThis; -
trunk/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
r36561 r39903 5 5 6 6 /* 7 * Copyright (C) 2006-201 0Oracle Corporation7 * Copyright (C) 2006-2012 Oracle Corporation 8 8 * 9 9 * This file is part of VirtualBox Open Source Edition (OSE), as … … 69 69 RTTestIFailed("line %u: expected \"%s\" got \"%s\"", __LINE__, szExpect, (Str).c_str()); \ 70 70 } while (0) 71 #define CHECK_EQUAL_I(iRes, iExpect) \ 72 do { \ 73 if (iRes != iExpect) \ 74 RTTestIFailed("line %u: expected \"%zd\" got \"%zd\"", __LINE__, iExpect, iRes); \ 75 } while (0) 71 76 72 77 RTCString empty; … … 255 260 size_t pos = strTest.find("ß"); 256 261 CHECK_EQUAL(strTest.substr(pos), "ßäbcdef"); 262 263 /* check find() */ 264 CHECK_EQUAL_I(strTest.find("f"), 5); 265 CHECK_EQUAL_I(strTest.find("f", 0), 5); 266 CHECK_EQUAL_I(strTest.find("f", 3), 5); 267 CHECK_EQUAL_I(strTest.find("f", 6), 14); 268 CHECK_EQUAL_I(strTest.find("f", 9), 14); 269 CHECK_EQUAL_I(strTest.substr(pos).find("d"), 6); 257 270 258 271 /* split */
Note:
See TracChangeset
for help on using the changeset viewer.