From cf61e78d01d992655725b8b2c8de3dd9d4fcc92c Mon Sep 17 00:00:00 2001 From: mattias Date: Tue, 21 Jun 2011 23:01:04 +0000 Subject: [PATCH] tests: started nested structs git-svn-id: trunk@31323 - --- test/codetoolstests/testcth2pas.pas | 33 +++++++++++++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/test/codetoolstests/testcth2pas.pas b/test/codetoolstests/testcth2pas.pas index edf1e6db97..39884088f6 100644 --- a/test/codetoolstests/testcth2pas.pas +++ b/test/codetoolstests/testcth2pas.pas @@ -237,14 +237,43 @@ end; procedure TTestCodetoolsH2Pas.TestCTH2PConvertSimpleStructs; begin - TestIntf('convert struct SwsContext;', + (*TestIntf('convert struct SwsContext;', 'struct SwsContext;', 'type SwsContext = record end;'); + TestIntf('convert struct hidp_connlist_req {uint32_t cnum;};', 'struct hidp_connlist_req {'+LineEnding +' uint32_t cnum;'+LineEnding +'};', - 'type hidp_connlist_req = record cnum:cuint32; end;'); + 'type hidp_connlist_req = record cnum:cuint32; end;');*) + + // nested struct + TestIntf('convert struct hidp_connlist_req {uint32_t cnum;struct hidp_conninfo ci;};', + 'struct hidp_connlist_req {'+LineEnding + +' uint32_t cnum;'+LineEnding + +' struct hidp_conninfo ci;'+LineEnding + +'};', + 'type'+LineEnding + +' hidp_connlist_req = record'+LineEnding + +' cnum:cuint32;'+LineEnding + +' ci:hidp_conninfo;'+LineEnding + +' end;'+LineEnding + +' hidp_conninfo = record'+LineEnding + +' end;'); + + // nested pointer of struct + (*TestIntf('convert struct hidp_connlist_req {uint32_t cnum;struct hidp_conninfo *ci;};', + 'struct hidp_connlist_req {'+LineEnding + +' uint32_t cnum;'+LineEnding + +' struct hidp_conninfo *ci;'+LineEnding + +'};', + 'type'+LineEnding + +' hidp_connlist_req = record'+LineEnding + +' cnum:cuint32;'+LineEnding + +' ci:Phidp_conninfo;'+LineEnding + +' end;'+LineEnding + +' hidp_conninfo = record'+LineEnding + +' end;'); *) end; initialization