瀏覽代碼

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

Pierre Muller 4 月之前
父節點
當前提交
abd14e713b
共有 1 個文件被更改,包括 3 次插入3 次删除
  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);