- Timestamp:
- Nov 8, 2010 5:07:49 PM (14 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Main/ExtPackUtil.cpp
r33806 r33862 180 180 * Make a duplicate of the name and return it. 181 181 */ 182 iprt::MiniString *pStrRet = new iprt::MiniString( off, pszSrc);182 iprt::MiniString *pStrRet = new iprt::MiniString(pszSrc, off); 183 183 Assert(VBoxExtPackIsValidName(pStrRet->c_str())); 184 184 return pStrRet; -
trunk/src/VBox/Runtime/testcase/tstIprtMiniString.cpp
r33819 r33862 39 39 static void test1Hlp1(const char *pszExpect, const char *pszFormat, ...) 40 40 { 41 #if 0 41 42 va_list va; 42 43 va_start(va, pszFormat); … … 44 45 va_end(va); 45 46 RTTESTI_CHECK_MSG(strTst.equals(pszExpect), ("strTst='%s' expected='%s'\n", strTst.c_str(), pszExpect)); 47 #endif 46 48 } 47 49 … … 61 63 if (!(expr)) \ 62 64 RTTestFailed(hTest, "%d: FAILED %s, got \"%d\"", __LINE__, #expr, expr); \ 65 } while (0) 66 #define CHECK_EQUAL(Str, szExpect) \ 67 do { \ 68 if (!(Str).equals(szExpect)) \ 69 RTTestIFailed("line %u: expected \"%s\" got \"%s\"", __LINE__, szExpect, (Str).c_str()); \ 63 70 } while (0) 64 71 … … 167 174 test1Hlp1("foobar", "%s", "foobar"); 168 175 176 /* substring constructors */ 177 iprt::MiniString SubStr1("", (size_t)0); 178 CHECK_EQUAL(SubStr1, ""); 179 180 iprt::MiniString SubStr2("abcdef", 2); 181 CHECK_EQUAL(SubStr2, "ab"); 182 183 iprt::MiniString SubStr3("abcdef", 1); 184 CHECK_EQUAL(SubStr3, "a"); 185 186 iprt::MiniString SubStr4("abcdef", 6); 187 CHECK_EQUAL(SubStr4, "abcdef"); 188 189 iprt::MiniString SubStr5("abcdef", 7); 190 CHECK_EQUAL(SubStr5, "abcdef"); 191 192 193 iprt::MiniString SubStrBase("abcdef"); 194 195 iprt::MiniString SubStr10(SubStrBase, 0); 196 CHECK_EQUAL(SubStr10, "abcdef"); 197 198 iprt::MiniString SubStr11(SubStrBase, 1); 199 CHECK_EQUAL(SubStr11, "bcdef"); 200 201 iprt::MiniString SubStr12(SubStrBase, 1, 1); 202 CHECK_EQUAL(SubStr12, "b"); 203 204 iprt::MiniString SubStr13(SubStrBase, 2, 3); 205 CHECK_EQUAL(SubStr13, "cde"); 206 207 iprt::MiniString SubStr14(SubStrBase, 2, 4); 208 CHECK_EQUAL(SubStr14, "cdef"); 209 210 iprt::MiniString SubStr15(SubStrBase, 2, 5); 211 CHECK_EQUAL(SubStr15, "cdef"); 212 213 169 214 /* special constructor and assignment arguments */ 170 215 iprt::MiniString StrCtor1(""); … … 211 256 #undef CHECK_DUMP 212 257 #undef CHECK_DUMP_I 258 #undef CHECK_EQUAL 213 259 } 214 260
Note:
See TracChangeset
for help on using the changeset viewer.