THRIFT-2694 Minor glitches in Delphi cross-test code
Client: Delphi
Patch: Jens Geyer
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index 9fb0b7a..5e4d91c 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -410,6 +410,11 @@
if FTransport.IsOpen then FTransport.Close;
FTransport.Open; // re-open connection, server has already closed
end;
+ on e:TApplicationException do begin
+ Console.WriteLine( e.ClassName+' = '+e.Message); // this is what we get
+ if FTransport.IsOpen then FTransport.Close;
+ FTransport.Open; // re-open connection, server has already closed
+ end;
on e:TException do Expect( FALSE, 'Unexpected exception type "'+e.ClassName+'"');
on e:Exception do Expect( FALSE, 'Unexpected exception type "'+e.ClassName+'"');
end;
@@ -800,9 +805,11 @@
i := client.testMultiException( 'need more pizza', 'run out of beer');
Expect( i.String_thing = 'run out of beer', 'i.String_thing = "' +i.String_thing+ '"');
Expect( i.__isset_String_thing, 'i.__isset_String_thing = '+BoolToString(i.__isset_String_thing));
- Expect( not i.__isset_Byte_thing, 'i.__isset_Byte_thing = '+BoolToString(i.__isset_Byte_thing));
+ { this is not necessarily true, these fields are default-serialized
+ Expect( not i.__isset_Byte_thing, 'i.__isset_Byte_thing = '+BoolToString(i.__isset_Byte_thing));
Expect( not i.__isset_I32_thing, 'i.__isset_I32_thing = '+BoolToString(i.__isset_I32_thing));
Expect( not i.__isset_I64_thing, 'i.__isset_I64_thing = '+BoolToString(i.__isset_I64_thing));
+ }
except
on e:Exception do Expect( FALSE, 'Unexpected exception "'+e.ClassName+'"');
end;
@@ -832,9 +839,11 @@
Expect( x.ErrorCode = 2002, 'x.ErrorCode = '+IntToStr(x.ErrorCode));
Expect( x.Struct_thing.String_thing = 'This is an Xception2', 'x.Struct_thing.String_thing = "'+x.Struct_thing.String_thing+'"');
Expect( x.Struct_thing.__isset_String_thing, 'x.Struct_thing.__isset_String_thing = '+BoolToString(x.Struct_thing.__isset_String_thing));
+ { this is not necessarily true, these fields are default-serialized
Expect( not x.Struct_thing.__isset_Byte_thing, 'x.Struct_thing.__isset_Byte_thing = '+BoolToString(x.Struct_thing.__isset_Byte_thing));
Expect( not x.Struct_thing.__isset_I32_thing, 'x.Struct_thing.__isset_I32_thing = '+BoolToString(x.Struct_thing.__isset_I32_thing));
Expect( not x.Struct_thing.__isset_I64_thing, 'x.Struct_thing.__isset_I64_thing = '+BoolToString(x.Struct_thing.__isset_I64_thing));
+ }
end;
on e:Exception do Expect( FALSE, 'Unexpected exception "'+e.ClassName+'"');
end;
diff --git a/lib/delphi/test/client.dpr b/lib/delphi/test/client.dpr
index 209e29d..dc576d9 100644
--- a/lib/delphi/test/client.dpr
+++ b/lib/delphi/test/client.dpr
@@ -35,6 +35,7 @@
Thrift.Server in '..\src\Thrift.Server.pas',
Thrift.Stream in '..\src\Thrift.Stream.pas',
Thrift.Console in '..\src\Thrift.Console.pas',
+ Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas',
Thrift.Utils in '..\src\Thrift.Utils.pas';
var
diff --git a/lib/delphi/test/server.dpr b/lib/delphi/test/server.dpr
index 7cf26a4..6dbc914 100644
--- a/lib/delphi/test/server.dpr
+++ b/lib/delphi/test/server.dpr
@@ -34,6 +34,7 @@
Thrift.Collections in '..\src\Thrift.Collections.pas',
Thrift.Server in '..\src\Thrift.Server.pas',
Thrift.Console in '..\src\Thrift.Console.pas',
+ Thrift.TypeRegistry in '..\src\Thrift.TypeRegistry.pas',
Thrift.Utils in '..\src\Thrift.Utils.pas',
Thrift.Stream in '..\src\Thrift.Stream.pas';