| 855 | } |
| 856 | |
| 857 | static bool cmdline_roundtrips(const char *const *argv) { |
| 858 | char cmd[4096]; |
| 859 | if (!cbm_build_win_cmdline(cmd, sizeof(cmd), argv)) { |
| 860 | return false; |
| 861 | } |
| 862 | char parsed[16][256]; |
| 863 | int pc = parse_win_cmdline(cmd, parsed, 16); |
| 864 | int oc = 0; |
| 865 | while (argv[oc]) { |
| 866 | oc++; |
| 867 | } |
| 868 | if (pc != oc) { |
| 869 | return false; |
| 870 | } |
| 871 | for (int i = 0; i < oc; i++) { |
| 872 | if (strcmp(argv[i], parsed[i]) != 0) { |
| 873 | return false; |
| 874 | } |
| 875 | } |
| 876 | return true; |
| 877 | } |
| 878 | |
| 879 | /* The exact index-worker argv: the command line with a JSON arg full of quotes. |
| 880 | * Round-trips, AND the emitted line must contain an ESCAPED quote (\") — the bare |
no test coverage detected