THRIFT-5591 Add uuid type to IDL and implement reference code (+ improved self-tests)
Client: compiler general, netstd, Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/test/serializer/TestSerializer.Data.pas b/lib/delphi/test/serializer/TestSerializer.Data.pas
index 4b8cc66..269e307 100644
--- a/lib/delphi/test/serializer/TestSerializer.Data.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Data.pas
@@ -23,6 +23,8 @@
uses
SysUtils,
+ ActiveX,
+ ComObj,
Thrift.Protocol,
Thrift.Collections,
DebugProtoTest;
@@ -193,6 +195,8 @@
// !!
result.setZomg_unicode( UnicodeString( us));
+ result.Rfc4122_uuid := TGuid.Create('{00112233-4455-6677-8899-aabbccddeeff}');
+
{$IF cDebugProtoTest_Option_AnsiStr_Binary}
result.SetBase64('base64');
{$ELSEIF cDebugProtoTest_Option_COM_Types}
diff --git a/lib/delphi/test/serializer/TestSerializer.Tests.pas b/lib/delphi/test/serializer/TestSerializer.Tests.pas
index 443a22d..6ed1a48 100644
--- a/lib/delphi/test/serializer/TestSerializer.Tests.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Tests.pas
@@ -43,6 +43,7 @@
System_,
DebugProtoTest;
+{$TYPEINFO ON}
type
TFactoryPair = record
@@ -208,6 +209,7 @@
ASSERT( Abs( tested.Double_precision - correct.Double_precision) < 1E-12);
ASSERT( tested.Some_characters = correct.Some_characters);
ASSERT( tested.Zomg_unicode = correct.Zomg_unicode);
+ ASSERT( tested.Rfc4122_uuid = correct.Rfc4122_uuid);
ASSERT( tested.What_who = correct.What_who);
ASSERT( LengthOf(tested.Base64) = LengthOf(correct.Base64));
@@ -303,9 +305,9 @@
class function TTestSerializer.UserFriendlyName( const method : TMethod) : string;
+const NAMES : array[TMethod] of string = ('TBytes','Stream');
begin
- result := EnumUtils<TMethod>.ToString(Ord(method));
- result := StringReplace( result, 'mt_', '', [rfReplaceAll]);
+ result := NAMES[method];
end;
@@ -342,7 +344,7 @@
config : IThriftConfiguration;
begin
config := TThriftConfigurationImpl.Create;
- config.MaxMessageSize := 0; // we don't read anything here
+ //config.MaxMessageSize := 0; // we don't read anything here
serial := TSerializer.Create( factory.prot, factory.trans, config);
try
@@ -358,7 +360,7 @@
config : IThriftConfiguration;
begin
config := TThriftConfigurationImpl.Create;
- config.MaxMessageSize := 0; // we don't read anything here
+ //config.MaxMessageSize := 0; // we don't read anything here
serial := TSerializer.Create( factory.prot, factory.trans, config);
try