From b32e940bebb42593963586df012a3c5600bcd213 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C3=ABl=20Van=20Canneyt?= Date: Tue, 17 Jan 2023 19:51:35 +0100 Subject: [PATCH] * PChar -> PAnsiChar --- packages/fcl-base/tests/testbasenenc.lpr | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/packages/fcl-base/tests/testbasenenc.lpr b/packages/fcl-base/tests/testbasenenc.lpr index 22b160e10b..5f8b75eea8 100644 --- a/packages/fcl-base/tests/testbasenenc.lpr +++ b/packages/fcl-base/tests/testbasenenc.lpr @@ -15,12 +15,15 @@ **********************************************************************} program testbasenenc; +{$mode objfpc} +{$h+} + uses sysutils, basenenc; -Procedure AssertEquals(Const aActual,aExpected : TBytes; aMsg : ); +Procedure AssertEquals(Const aActual,aExpected : TBytes; aMsg : String); - function ToStr(aBytes : TBytes) : ; + function ToStr(aBytes : TBytes) : String; Var I : Integer; @@ -45,7 +48,7 @@ begin end; end; -Procedure AssertEquals(Const aActual,aExpected,aMsg : ); +Procedure AssertEquals(Const aActual,aExpected,aMsg : String); begin if aActual<>aExpected then @@ -55,7 +58,7 @@ begin end; end; -Procedure DoTest(B : Tbytes; aExpected : ; aURL : Boolean = False); +Procedure DoTest(B : Tbytes; aExpected : String; aURL : Boolean = False); Var B2 : TBytes; @@ -74,13 +77,13 @@ begin AssertEquals(B2,B,'DoTest Wrong decode'); end; -Procedure DoTest64(aValue, aExpected : ); +Procedure DoTest64(aValue, aExpected : String); begin DoTest(TEncoding.UTF8.GetAnsiBytes(aValue),aExpected); end; -Procedure DoTest32(aValue, aExpected : ); +Procedure DoTest32(aValue, aExpected : String); Var B2 : TBytes; @@ -93,7 +96,7 @@ begin AssertEquals(b2,TEncoding.UTF8.GetAnsiBytes(aValue),'Base32 Wrong encode for '+aValue); end; -Procedure DoTest32Hex(aValue, aExpected : ); +Procedure DoTest32Hex(aValue, aExpected : String); Var B2 : TBytes; @@ -106,7 +109,7 @@ begin AssertEquals(B2,TEncoding.UTF8.GetAnsiBytes(aValue),'Base32Hex Wrong encode for '+aValue); end; -Procedure DoTest16(aValue, aExpected : ); +Procedure DoTest16(aValue, aExpected : String); Var B2 : TBytes; @@ -161,5 +164,6 @@ begin DoTest16('foob','666F6F62'); DoTest16('fooba','666F6F6261'); DoTest16('foobar','666F6F626172'); + Writeln('All OK'); end.