From 6d17156a23948c7d990fc6a467689176b72b1ffd Mon Sep 17 00:00:00 2001 From: Ivan Mahonin Date: Jun 22 2022 06:41:35 +0000 Subject: fix dates test --- diff --git a/onefile/history-dates-test.c b/onefile/history-dates-test.c index b08a562..9240035 100644 --- a/onefile/history-dates-test.c +++ b/onefile/history-dates-test.c @@ -124,6 +124,15 @@ void load(const char *filename) { dates[dateCount++] = r->date; } + for(int i = 0; i < 2*recCount; ++i) { + int a = randomNumber(0, recCount - 1); + int b = randomNumber(0, recCount - 1); + if (a == b) continue; + Record r; + memcpy(&r, &records[a], sizeof(r)); + memcpy(&records[a], &records[b], sizeof(r)); + memcpy(&records[b], &r, sizeof(r)); + } if (recCount > MAXQUESTS) recCount = MAXQUESTS; }