Changeset 27384 in vbox for trunk/src/VBox/Runtime/testcase
- Timestamp:
- Mar 15, 2010 9:52:18 PM (15 years ago)
- svn:sync-xref-src-repo-rev:
- 58837
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Runtime/testcase/tstRTGetOptArgv.cpp
r26484 r27384 40 40 #include <iprt/test.h> 41 41 42 43 static void tst2(void) 44 { 45 RTTestISub("RTGetOptArgvToString / MS_CRT"); 46 47 static const struct 48 { 49 const char * const apszArgs[5]; 50 const char *pszCmdLine; 51 } s_aTests[] = 52 { 53 { 54 { "abcd", "a ", " b", " c ", NULL }, 55 "abcd \"a \" \" b\" \" c \"" 56 }, 57 { 58 { "a\\\\\\b", "de fg", "h", NULL, NULL }, 59 "a\\\\\\b \"de fg\" h" 60 }, 61 { 62 { "a\\\"b", "c", "d", "\"", NULL }, 63 "\"a\\\\\\\"b\" c d \"\\\"\"" 64 }, 65 { 66 { "a\\\\b c", "d", "e", NULL, NULL }, 67 "\"a\\\\b c\" d e" 68 }, 69 }; 70 71 for (size_t i = 0; i < RT_ELEMENTS(s_aTests); i++) 72 { 73 char *pszCmdLine = NULL; 74 int rc = RTGetOptArgvToString(&pszCmdLine, s_aTests[i].apszArgs, RTGETOPTARGV_CNV_QUOTE_MS_CRT); 75 RTTESTI_CHECK_RC_RETV(rc, VINF_SUCCESS); 76 if (strcmp(s_aTests[i].pszCmdLine, pszCmdLine)) 77 RTTestIFailed("g_aTest[%i] failed:\n" 78 " got '%s'\n" 79 " expected '%s'\n", 80 i, pszCmdLine, s_aTests[i].pszCmdLine); 81 RTStrFree(pszCmdLine); 82 } 83 } 42 84 43 85 static void tst1(void) … … 120 162 */ 121 163 tst1(); 164 tst2(); 122 165 123 166 /*
Note:
See TracChangeset
for help on using the changeset viewer.