From 68cdd7073f13f85d8cc192aea7af17afde91cbee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Mon, 19 Dec 2022 09:56:50 +0100 Subject: [PATCH] * Patch from Ondrej to implement SameArray --- tests/test/trtti24.pp | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tests/test/trtti24.pp b/tests/test/trtti24.pp index 0bca47c3bd..619af8885e 100644 --- a/tests/test/trtti24.pp +++ b/tests/test/trtti24.pp @@ -107,9 +107,16 @@ type TLargeSetP = set of TLargeEnum; {$pop} -function SameArray(const A, B: array of Byte): Boolean; -begin - Result := True; +function SameArray(const A, B: array of Byte): Boolean; +var + I: Integer; +begin + Result := Length(A)=Length(B); + if not Result then + Exit; + for I := Low(A) to High(A) do + if A[I]<>B[I] then + Exit(False); end; const