summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJens Geyer <jensg@apache.org>2022-10-17 14:21:18 +0200
committerJens Geyer <Jens-G@users.noreply.github.com>2022-10-17 21:25:37 +0200
commitcd7a2aa0985b01a4aeeb6e55bb8c6397c53a662a (patch)
tree53ae5b595bc0303e4f5c2f8b6f5f7131e44543a1 /lib
parent0b1e9513b4fd22b0b382d848cff5201d6d94a06a (diff)
downloadthrift-cd7a2aa0985b01a4aeeb6e55bb8c6397c53a662a.tar.gz
THRIFT-5656 Escape Delphi keywords with '&' prefix instead of '_' suffix
Client: Delphi Patch: Jens Geyer
Diffstat (limited to 'lib')
-rw-r--r--lib/delphi/test/TestClient.pas2
-rw-r--r--lib/delphi/test/codegen/run-Pascal-Codegen-Tests.bat.tmpl4
-rw-r--r--lib/delphi/test/serializer/TestSerializer.Data.pas12
3 files changed, 11 insertions, 7 deletions
diff --git a/lib/delphi/test/TestClient.pas b/lib/delphi/test/TestClient.pas
index d541e186d..1b09d3cf4 100644
--- a/lib/delphi/test/TestClient.pas
+++ b/lib/delphi/test/TestClient.pas
@@ -956,7 +956,7 @@ begin
except
on x:TXception do begin
Expect( x.__isset_ErrorCode, 'x.__isset_ErrorCode = '+BoolToString(x.__isset_ErrorCode));
- Expect( x.__isset_Message_, 'x.__isset_Message_ = '+BoolToString(x.__isset_Message_));
+ Expect( x.__isset_Message, 'x.__isset_Message = '+BoolToString(x.__isset_Message));
Expect( x.ErrorCode = 1001, 'x.ErrorCode = '+IntToStr(x.ErrorCode));
Expect( x.Message_ = 'This is an Xception', 'x.Message = "'+x.Message_+'"');
end;
diff --git a/lib/delphi/test/codegen/run-Pascal-Codegen-Tests.bat.tmpl b/lib/delphi/test/codegen/run-Pascal-Codegen-Tests.bat.tmpl
index dbab0ae7c..79cf0e339 100644
--- a/lib/delphi/test/codegen/run-Pascal-Codegen-Tests.bat.tmpl
+++ b/lib/delphi/test/codegen/run-Pascal-Codegen-Tests.bat.tmpl
@@ -67,6 +67,10 @@ if exist "%TARGET%\*.thrift" del "%TARGET%\*.thrift" /Q
if exist "%TARGET%\%SUBDIR%\*.*" del "%TARGET%\%SUBDIR%\*.*" /Q
if exist "%OUTDCU%\*.*" del "%OUTDCU%\*.*" /Q
+rem init logfile
+echo Errors > "%LOGFILE%"
+echo ---------------- >> "%LOGFILE%"
+
rem * recurse through thrift WC and "my thrift files" folder
rem * copies all .thrift files into thrift-testing
call %0 %SOURCE%
diff --git a/lib/delphi/test/serializer/TestSerializer.Data.pas b/lib/delphi/test/serializer/TestSerializer.Data.pas
index 269e307a6..24f850d2f 100644
--- a/lib/delphi/test/serializer/TestSerializer.Data.pas
+++ b/lib/delphi/test/serializer/TestSerializer.Data.pas
@@ -213,7 +213,7 @@ class function Fixtures.CreateNesting : INesting;
var bonk : IBonk;
begin
bonk := TBonkImpl.Create;
- bonk.Type_ := 31337;
+ bonk.&Type := 31337;
bonk.Message := 'I am a bonk... xor!';
result := TNestingImpl.Create;
@@ -262,11 +262,11 @@ begin
// one with two
stage2 := TThriftListImpl<IBonk>.Create;
b := TBonkImpl.Create;
- b.type_ := 1;
+ b.&type := 1;
b.message := 'Wait.';
stage2.Add( b);
b := TBonkImpl.Create;
- b.type_ := 2;
+ b.&type := 2;
b.message := 'What?';
stage2.Add( b);
result.Bonks.Add( 'two', stage2);
@@ -274,15 +274,15 @@ begin
// one with three
stage2 := TThriftListImpl<IBonk>.Create;
b := TBonkImpl.Create;
- b.type_ := 3;
+ b.&type := 3;
b.message := 'quoth';
stage2.Add( b);
b := TBonkImpl.Create;
- b.type_ := 4;
+ b.&type := 4;
b.message := 'the raven';
stage2.Add( b);
b := TBonkImpl.Create;
- b.type_ := 5;
+ b.&type := 5;
b.message := 'nevermore';
stage2.Add( b);
result.bonks.Add( 'three', stage2);