Add plugin tests for mjSpec.

Fixes #1903.

PiperOrigin-RevId: 663352920
Change-Id: I3a9e17aec5694e49c20b542f4b0a4402f88a2f17
This commit is contained in:
Alessio Quaglino
2024-08-15 10:18:56 -07:00
committed by Copybara-Service
parent 64575f399b
commit e0e134ca63
5 changed files with 79 additions and 5 deletions
@@ -39,8 +39,10 @@ def _value_binding_code(
fullvarname = 'ptr->' + varname
if field.name.startswith('mjs'): # all other mjs are raw structs
fulltype = field.name.replace('mjs', 'raw::Mjs')
if field.name != 'mjsPlugin' and field.name != 'mjsOrientation':
fulltype = fulltype + '*' # plugin and orientation are pointers
if field.name == 'mjsPlugin' or field.name == 'mjsOrientation':
fulltype = fulltype + '&' # plugin and orientation are not pointers
else:
fulltype = fulltype + '*'
def_property_args = (
f'"{varname}"',