- Timestamp:
- Oct 20, 2016 7:28:01 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTStrFormat.cpp
r64341 r64342 214 214 const size_t cchCompare = cbBuf >= sizeof(g_szCheck42Expect) ? sizeof(g_szCheck42Expect) - 1 \ 215 215 : cbBuf > 0 ? cbBuf - 1 : 0; \ 216 /*size_t cch1Expect = cchCompare; */\216 size_t cch1Expect = cchCompare; \ 217 217 ssize_t cch2Expect = cbBuf >= sizeof(g_szCheck42Expect) \ 218 218 ? sizeof(g_szCheck42Expect) - 1 : -(ssize_t)sizeof(g_szCheck42Expect); \ 219 219 \ 220 cch 2= RTStrPrintf(pszBuf, cbBuf, g_szCheck42Fmt, arg, 42, arg, 42);\220 cch = RTStrPrintf(pszBuf, cbBuf, g_szCheck42Fmt, arg, 42, arg, 42);\ 221 221 if ( memcmp(pszBuf, g_szCheck42Expect, cchCompare) != 0 \ 222 222 || pszBuf[cchCompare] != chAfter) \ … … 225 225 " wanted: '%s'\n", \ 226 226 __LINE__, fmt, cbBuf, cbBuf ? pszBuf : "", g_szCheck42Expect); \ 227 /*if (cch != cch1Expect) - code is buggy */\228 /* RTTestIFailed("at line %d: Invalid length %d returned for cbBuf=%zu, expected %zd! (#1)\n", */\229 /* __LINE__, cch, cbBuf, cch1Expect); */\227 if (cch != cch1Expect) \ 228 RTTestIFailed("at line %d: Invalid length %d returned for cbBuf=%zu, expected %zd! (#1)\n", \ 229 __LINE__, cch, cbBuf, cch1Expect); \ 230 230 \ 231 231 cch2 = RTStrPrintf2(pszBuf, cbBuf, g_szCheck42Fmt, arg, 42, arg, 42);\ … … 246 246 if (strcmp(pszBuf, Correct)) \ 247 247 RTTestIFailed("error: '%s'\n" \ 248 "expected: '%s'\n", pszBuf, Correct); \ 248 "expected: '%s'\n", pszBuf, Correct); 249 250 /* 251 * Test the waters. 252 */ 253 CHECK42("%d", 127, "127"); 254 CHECK42("%s", "721", "721"); 249 255 250 256 /*
Note:
See TracChangeset
for help on using the changeset viewer.