| 239 | } |
| 240 | |
| 241 | static bool cmdline_roundtrips(const char *const *argv) { |
| 242 | char cmd[4096]; |
| 243 | if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) { |
| 244 | return false; |
| 245 | } |
| 246 | char parsed[16][256]; |
| 247 | int pc = parse_win_cmdline(cmd, parsed, 16); |
| 248 | int oc = 0; |
| 249 | while (argv[oc]) { |
| 250 | oc++; |
| 251 | } |
| 252 | if (pc != oc) { |
| 253 | return false; |
| 254 | } |
| 255 | for (int i = 0; i < oc; i++) { |
| 256 | if (strcmp(argv[i], parsed[i]) != 0) { |
| 257 | return false; |
| 258 | } |
| 259 | } |
| 260 | return true; |
| 261 | } |
| 262 | |
| 263 | /* The exact index-worker argv: the command line with a JSON arg full of quotes. |
| 264 | * Round-trips, AND the emitted line must contain an ESCAPED quote (\") — the bare |
no test coverage detected