Skip to content

Commit dc582c6

Browse files
committed
Fix reference handling in VIDL generator and add regression test
1 parent ea95790 commit dc582c6

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

test.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,5 +260,16 @@ def test_generate_empty_func(self):
260260
# We can check that the only constructor is the default one or checking string absence
261261
self.assertNotIn("VIDL_DoNothing() :", output)
262262

263+
def test_regression_reference_members(self):
264+
content = """
265+
// VIDL_GENERATE
266+
void vhBeginMarker(const std::string& name);
267+
"""
268+
output = vidl.generate_source(content)
269+
# The member should NOT be a reference
270+
self.assertIn("const std::string name;", output)
271+
# The constructor parameter SHOULD be a reference
272+
self.assertIn("VIDL_vhBeginMarker(const std::string& _name)", output)
273+
263274
if __name__ == '__main__':
264275
unittest.main()

0 commit comments

Comments
 (0)