THRIFT-1596 Delphi: Test clients should have a return codes that reflect whether they succeeded or not
Patch: Jens Geyer

git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1334250 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/lib/delphi/test/TestServer.pas b/lib/delphi/test/TestServer.pas
index b8b4d72..fa48e81 100644
--- a/lib/delphi/test/TestServer.pas
+++ b/lib/delphi/test/TestServer.pas
@@ -110,8 +110,15 @@
   Console.WriteLine('testException(' + arg + ')');
   if ( arg = 'Xception') then
   begin
-    raise TXception.Create( 1001, 'This is an Xception');
+    raise TXception.Create( 1001, arg);
   end;
+
+  if (arg = 'TException') then
+  begin
+    raise TException.Create('');
+  end;
+
+  // else do not throw anything
 end;
 
 function TTestServer.TTestHandlerImpl.testI32(thing: Integer): Integer;
@@ -140,7 +147,7 @@
 
   Console.WriteLine('testInsanity()');
   hello := TXtructImpl.Create;
-  hello.String_thing := 'hello';
+  hello.String_thing := 'Hello2';
   hello.Byte_thing := 2;
   hello.I32_thing := 2;
   hello.I64_thing := 2;
@@ -164,7 +171,7 @@
   first_map := TThriftDictionaryImpl<TNumberz, IInsanity>.Create;
   second_map := TThriftDictionaryImpl<TNumberz, IInsanity>.Create;
 
-  first_map.AddOrSetValue( TNumberz.SIX, crazy);
+  first_map.AddOrSetValue( TNumberz.TWO, crazy);
   first_map.AddOrSetValue( TNumberz.THREE, crazy);
 
   second_map.AddOrSetValue( TNumberz.SIX, looney);
@@ -348,8 +355,25 @@
 
 function TTestServer.TTestHandlerImpl.testStringMap(
   const thing: IThriftDictionary<string, string>): IThriftDictionary<string, string>;
+var
+  first : Boolean;
+  key : string;
 begin
-
+  Console.Write('testStringMap({');
+  first := True;
+  for key in thing.Keys do
+  begin
+    if (first) then
+    begin
+      first := false;
+    end else
+    begin
+      Console.Write(', ');
+    end;
+    Console.Write(key + ' => ' + thing[key]);
+  end;
+  Console.WriteLine('})');
+  Result := thing;
 end;
 
 function TTestServer.TTestHandlerImpl.testTypedef( const thing: Int64): Int64;