Testcase fixed
diff --git a/lib/delphi/test/serializer/TestSerializer.Data.pas b/lib/delphi/test/serializer/TestSerializer.Data.pas
index 34ad4f6..30d9dd4 100644
--- a/lib/delphi/test/serializer/TestSerializer.Data.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Data.pas
@@ -283,57 +283,57 @@
// superhuge compact proto test struct
begin
result := TCompactProtoTestStructImpl.Create;
- result.A_byte := TConstants.COMPACT_TEST.A_byte;
- result.A_i16 := TConstants.COMPACT_TEST.A_i16;
- result.A_i32 := TConstants.COMPACT_TEST.A_i32;
- result.A_i64 := TConstants.COMPACT_TEST.A_i64;
- result.A_double := TConstants.COMPACT_TEST.A_double;
- result.A_string := TConstants.COMPACT_TEST.A_string;
- result.A_binary := TConstants.COMPACT_TEST.A_binary;
- result.True_field := TConstants.COMPACT_TEST.True_field;
- result.False_field := TConstants.COMPACT_TEST.False_field;
- result.Empty_struct_field := TConstants.COMPACT_TEST.Empty_struct_field;
- result.Byte_list := TConstants.COMPACT_TEST.Byte_list;
- result.I16_list := TConstants.COMPACT_TEST.I16_list;
- result.I32_list := TConstants.COMPACT_TEST.I32_list;
- result.I64_list := TConstants.COMPACT_TEST.I64_list;
- result.Double_list := TConstants.COMPACT_TEST.Double_list;
- result.String_list := TConstants.COMPACT_TEST.String_list;
- result.Binary_list := TConstants.COMPACT_TEST.Binary_list;
- result.Boolean_list := TConstants.COMPACT_TEST.Boolean_list;
- result.Struct_list := TConstants.COMPACT_TEST.Struct_list;
- result.Byte_set := TConstants.COMPACT_TEST.Byte_set;
- result.I16_set := TConstants.COMPACT_TEST.I16_set;
- result.I32_set := TConstants.COMPACT_TEST.I32_set;
- result.I64_set := TConstants.COMPACT_TEST.I64_set;
- result.Double_set := TConstants.COMPACT_TEST.Double_set;
- result.String_set := TConstants.COMPACT_TEST.String_set;
- result.String_set := TConstants.COMPACT_TEST.String_set;
- result.String_set := TConstants.COMPACT_TEST.String_set;
- result.Binary_set := TConstants.COMPACT_TEST.Binary_set;
- result.Boolean_set := TConstants.COMPACT_TEST.Boolean_set;
- result.Struct_set := TConstants.COMPACT_TEST.Struct_set;
- result.Byte_byte_map := TConstants.COMPACT_TEST.Byte_byte_map;
- result.I16_byte_map := TConstants.COMPACT_TEST.I16_byte_map;
- result.I32_byte_map := TConstants.COMPACT_TEST.I32_byte_map;
- result.I64_byte_map := TConstants.COMPACT_TEST.I64_byte_map;
- result.Double_byte_map := TConstants.COMPACT_TEST.Double_byte_map;
- result.String_byte_map := TConstants.COMPACT_TEST.String_byte_map;
- result.Binary_byte_map := TConstants.COMPACT_TEST.Binary_byte_map;
- result.Boolean_byte_map := TConstants.COMPACT_TEST.Boolean_byte_map;
- result.Byte_i16_map := TConstants.COMPACT_TEST.Byte_i16_map;
- result.Byte_i32_map := TConstants.COMPACT_TEST.Byte_i32_map;
- result.Byte_i64_map := TConstants.COMPACT_TEST.Byte_i64_map;
- result.Byte_double_map := TConstants.COMPACT_TEST.Byte_double_map;
- result.Byte_string_map := TConstants.COMPACT_TEST.Byte_string_map;
- result.Byte_binary_map := TConstants.COMPACT_TEST.Byte_binary_map;
- result.Byte_boolean_map := TConstants.COMPACT_TEST.Byte_boolean_map;
- result.List_byte_map := TConstants.COMPACT_TEST.List_byte_map;
- result.Set_byte_map := TConstants.COMPACT_TEST.Set_byte_map;
- result.Map_byte_map := TConstants.COMPACT_TEST.Map_byte_map;
- result.Byte_map_map := TConstants.COMPACT_TEST.Byte_map_map;
- result.Byte_set_map := TConstants.COMPACT_TEST.Byte_set_map;
- result.Byte_list_map := TConstants.COMPACT_TEST.Byte_list_map;
+ result.A_byte := TDebugProtoTestConstants.COMPACT_TEST.A_byte;
+ result.A_i16 := TDebugProtoTestConstants.COMPACT_TEST.A_i16;
+ result.A_i32 := TDebugProtoTestConstants.COMPACT_TEST.A_i32;
+ result.A_i64 := TDebugProtoTestConstants.COMPACT_TEST.A_i64;
+ result.A_double := TDebugProtoTestConstants.COMPACT_TEST.A_double;
+ result.A_string := TDebugProtoTestConstants.COMPACT_TEST.A_string;
+ result.A_binary := TDebugProtoTestConstants.COMPACT_TEST.A_binary;
+ result.True_field := TDebugProtoTestConstants.COMPACT_TEST.True_field;
+ result.False_field := TDebugProtoTestConstants.COMPACT_TEST.False_field;
+ result.Empty_struct_field := TDebugProtoTestConstants.COMPACT_TEST.Empty_struct_field;
+ result.Byte_list := TDebugProtoTestConstants.COMPACT_TEST.Byte_list;
+ result.I16_list := TDebugProtoTestConstants.COMPACT_TEST.I16_list;
+ result.I32_list := TDebugProtoTestConstants.COMPACT_TEST.I32_list;
+ result.I64_list := TDebugProtoTestConstants.COMPACT_TEST.I64_list;
+ result.Double_list := TDebugProtoTestConstants.COMPACT_TEST.Double_list;
+ result.String_list := TDebugProtoTestConstants.COMPACT_TEST.String_list;
+ result.Binary_list := TDebugProtoTestConstants.COMPACT_TEST.Binary_list;
+ result.Boolean_list := TDebugProtoTestConstants.COMPACT_TEST.Boolean_list;
+ result.Struct_list := TDebugProtoTestConstants.COMPACT_TEST.Struct_list;
+ result.Byte_set := TDebugProtoTestConstants.COMPACT_TEST.Byte_set;
+ result.I16_set := TDebugProtoTestConstants.COMPACT_TEST.I16_set;
+ result.I32_set := TDebugProtoTestConstants.COMPACT_TEST.I32_set;
+ result.I64_set := TDebugProtoTestConstants.COMPACT_TEST.I64_set;
+ result.Double_set := TDebugProtoTestConstants.COMPACT_TEST.Double_set;
+ result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
+ result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
+ result.String_set := TDebugProtoTestConstants.COMPACT_TEST.String_set;
+ result.Binary_set := TDebugProtoTestConstants.COMPACT_TEST.Binary_set;
+ result.Boolean_set := TDebugProtoTestConstants.COMPACT_TEST.Boolean_set;
+ result.Struct_set := TDebugProtoTestConstants.COMPACT_TEST.Struct_set;
+ result.Byte_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_byte_map;
+ result.I16_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I16_byte_map;
+ result.I32_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I32_byte_map;
+ result.I64_byte_map := TDebugProtoTestConstants.COMPACT_TEST.I64_byte_map;
+ result.Double_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Double_byte_map;
+ result.String_byte_map := TDebugProtoTestConstants.COMPACT_TEST.String_byte_map;
+ result.Binary_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Binary_byte_map;
+ result.Boolean_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Boolean_byte_map;
+ result.Byte_i16_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i16_map;
+ result.Byte_i32_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i32_map;
+ result.Byte_i64_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_i64_map;
+ result.Byte_double_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_double_map;
+ result.Byte_string_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_string_map;
+ result.Byte_binary_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_binary_map;
+ result.Byte_boolean_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_boolean_map;
+ result.List_byte_map := TDebugProtoTestConstants.COMPACT_TEST.List_byte_map;
+ result.Set_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Set_byte_map;
+ result.Map_byte_map := TDebugProtoTestConstants.COMPACT_TEST.Map_byte_map;
+ result.Byte_map_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_map_map;
+ result.Byte_set_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_set_map;
+ result.Byte_list_map := TDebugProtoTestConstants.COMPACT_TEST.Byte_list_map;
{$IF cDebugProtoTest_Option_AnsiStr_Binary}
result.A_binary := AnsiString( #0#1#2#3#4#5#6#7#8);
@@ -343,5 +343,7 @@
end;
+
+
end.
diff --git a/lib/delphi/test/serializer/TestSerializer.dpr b/lib/delphi/test/serializer/TestSerializer.dpr
index 60e55c1..3d9a453 100644
--- a/lib/delphi/test/serializer/TestSerializer.dpr
+++ b/lib/delphi/test/serializer/TestSerializer.dpr
@@ -17,7 +17,7 @@
* under the License.
*)
-program skiptest_version1;
+program TestSerializer;
{$APPTYPE CONSOLE}
@@ -33,6 +33,7 @@
Thrift.Utils in '..\..\src\Thrift.Utils.pas',
Thrift.Serializer in '..\..\src\Thrift.Serializer.pas',
Thrift.Stream in '..\..\src\Thrift.Stream.pas',
+ Thrift.TypeRegistry in '..\..\src\Thrift.TypeRegistry.pas',
DebugProtoTest,
TestSerializer.Data;
@@ -48,11 +49,13 @@
class procedure Deserialize( const input : TBytes; const target : IBase; const factory : IProtocolFactory); overload;
class procedure Deserialize( const input : TStream; const target : IBase; const factory : IProtocolFactory); overload;
+ procedure Test_Serializer_Deserializer;
+
public
constructor Create;
destructor Destroy; override;
- procedure TestDeserialize;
+ procedure RunTests;
end;
@@ -78,9 +81,10 @@
end;
end;
-
-procedure TTestSerializer.TestDeserialize;
type TMethod = (mt_Bytes, mt_Stream);
+
+
+procedure TTestSerializer.Test_Serializer_Deserializer;
var level3ooe, correct : IOneOfEach;
factory : IProtocolFactory;
bytes : TBytes;
@@ -153,6 +157,19 @@
end;
+procedure TTestSerializer.RunTests;
+begin
+ try
+ Test_Serializer_Deserializer;
+ except
+ on e:Exception do begin
+ Writeln( e.Message);
+ Write('Hit ENTER to close ... '); Readln;
+ end;
+ end;
+end;
+
+
class function TTestSerializer.Serialize(const input : IBase; const factory : IProtocolFactory) : TBytes;
var serial : TSerializer;
begin
@@ -204,7 +221,7 @@
begin
test := TTestSerializer.Create;
try
- test.TestDeserialize;
+ test.RunTests;
finally
test.Free;
end;