Browse Source

* Add test for case of pointer and size

Michaël Van Canneyt 3 years ago
parent
commit
1b6219823b
1 changed files with 7 additions and 0 deletions
  1. 7 0
      packages/vcl-compat/tests/tcnetencoding.pp

+ 7 - 0
packages/vcl-compat/tests/tcnetencoding.pp

@@ -26,6 +26,7 @@ type
   published
     procedure TestHookUp;
     procedure TestBytesToString;
+    procedure TestPointerLengthToString;
     procedure TestBytesToBytes;
     procedure TestStringToString;
   end;
@@ -210,6 +211,12 @@ begin
   AssertBytes(EncDefBytes,Enc.Encode(DefBytes));
 end;
 
+procedure  TTestBase64Encoding.TestPointerLengthToString;
+
+begin
+ AssertEquals('Encoding',SDefBytes,Enc.EncodeBytesToString(Pointer(DefBytes),Length(DefBytes)));
+end;
+
 procedure TTestBase64Encoding.TestStringToString;
 begin
   AssertEquals('Encoding', SDefLetters,Enc.Encode('ABCDE'));