@@ -82,6 +82,36 @@ def test_geometry(self):
8282 actual = osp .join (self .MATLAB_ACTUAL_DIR , file )
8383 self .compare_and_diff (file , actual )
8484
85+ def test_serializable_template_typedef (self ):
86+ """Serialization metadata applies to one MATLAB typedef only."""
87+ source = osp .join (self .INTERFACE_DIR , 'serializable_typedef.i' )
88+ wrapper = MatlabWrapper (module_name = 'serializable_typedef' ,
89+ top_module_namespace = ['gtsam' ],
90+ ignore_classes = ['' ],
91+ use_boost_serialization = True )
92+ wrapper .wrap ([source ], path = self .MATLAB_ACTUAL_DIR )
93+
94+ with open (osp .join (self .MATLAB_ACTUAL_DIR , '+gtsam' ,
95+ 'SerializableFixture.m' ),
96+ 'r' , encoding = 'UTF-8' ) as generated :
97+ serializable = generated .read ()
98+ with open (osp .join (self .MATLAB_ACTUAL_DIR , '+gtsam' , 'PlainFixture.m' ),
99+ 'r' , encoding = 'UTF-8' ) as generated :
100+ plain = generated .read ()
101+ with open (osp .join (self .MATLAB_ACTUAL_DIR ,
102+ 'serializable_typedef_wrapper.cpp' ),
103+ 'r' , encoding = 'UTF-8' ) as generated :
104+ cpp = generated .read ()
105+
106+ self .assertIn ('string_serialize' , serializable )
107+ self .assertIn ('string_deserialize' , serializable )
108+ self .assertNotIn ('string_serialize' , plain )
109+ self .assertNotIn ('string_deserialize' , plain )
110+ self .assertIn (
111+ 'BOOST_CLASS_EXPORT_GUID(SerializableFixture, '
112+ '"gtsamSerializableFixture")' , cpp )
113+ self .assertNotIn ('BOOST_CLASS_EXPORT_GUID(PlainFixture' , cpp )
114+
85115 def test_matrix_view_arguments (self ):
86116 """Test that matrix view arguments use MATLAB double arrays directly."""
87117 file = osp .join (self .INTERFACE_DIR , 'matrix_views.i' )
0 commit comments