Browse Source

Apply same changes as for tstruth2bu.pp to reflect change on HexToBin that checks Length of TBytes parameters

Pierre Muller 2 months ago
parent
commit
abd14e713b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      tests/test/units/strutils/tstruth2b.pp

+ 3 - 3
tests/test/units/strutils/tstruth2b.pp

@@ -175,7 +175,7 @@ begin
   FillChar(BinValueBytes[0], Length(BinValueBytes), 0);
   BinBufLen := Length(BinValueBytes);
   ret := HexToBin(HexValueBytes, 2, BinValueBytes, 2, BinBufLen);
-  if ret <> 2 then halt(14);
+  if ret <> BinBufLen - 2 then halt(14);
   if BinValueBytes[0] <> 0 then halt(14);
   if BinValueBytes[1] <> 0 then halt(14);
   if BinValueBytes[2] <> 236 then halt(14);
@@ -188,7 +188,7 @@ begin
   FillChar(BinValueBytes[0], Length(BinValueBytes), 0);
   BinBufLen := Length(BinValueBytes);
   ret := HexToBin(PChar(HexInputW), 2, BinValueBytes, 2, BinBufLen);
-  if ret <> 2 then halt(15);
+  if ret <> BinBufLen - 2 then halt(15);
   if BinValueBytes[0] <> 0 then halt(15);
   if BinValueBytes[1] <> 0 then halt(15);
   if BinValueBytes[2] <> 236 then halt(15);
@@ -198,7 +198,7 @@ begin
   FillChar(BinValueBytes[0], Length(BinValueBytes), 0);
   BinBufLen := Length(BinValueBytes);
   ret := HexToBin(HexValueBytes, 2, BinValueBytes, 2, BinBufLen);
-  if ret <> 2 then halt(16);
+  if ret <> BinBufLen - 2 then halt(16);
   if BinValueBytes[0] <> 0 then halt(16);
   if BinValueBytes[1] <> 0 then halt(16);
   if BinValueBytes[2] <> 236 then halt(16);