First line of `got` that differs from `want`, copied into out (for the * failure diagnostic). Returns false when the strings are identical. */
| 3294 | /* First line of `got` that differs from `want`, copied into out (for the |
| 3295 | * failure diagnostic). Returns false when the strings are identical. */ |
| 3296 | static bool cx_order_first_diff(const char *want, const char *got, char *out, size_t cap) { |
| 3297 | if (strcmp(want, got) == 0) { |
| 3298 | return false; |
| 3299 | } |
| 3300 | while (*want && *got) { |
| 3301 | size_t lw = strcspn(want, "\n"); |
| 3302 | size_t lg = strcspn(got, "\n"); |
| 3303 | if (lw != lg || memcmp(want, got, lw) != 0) { |
| 3304 | snprintf(out, cap, "want '%.*s' got '%.*s'", (int)lw, want, (int)lg, got); |
| 3305 | return true; |
| 3306 | } |
| 3307 | want += lw + (want[lw] == '\n'); |
| 3308 | got += lg + (got[lg] == '\n'); |
| 3309 | } |
| 3310 | snprintf(out, cap, "line count differs"); |
| 3311 | return true; |
| 3312 | } |
| 3313 | |
| 3314 | TEST(pipeline_complexity_props_independent_of_worker_order) { |
| 3315 | char tmp[256]; |