@@ -316,7 +316,8 @@ void loop()
316316 if (sent % 3 )
317317 mpr_sig_set_value (sendsig , 0 , 1 , MPR_INT32 , & sent );
318318
319- mpr_dev_poll (src , period );
319+ if (!shared_graph )
320+ mpr_dev_poll (src , period );
320321
321322 if (!verbose ) {
322323 printf ("\r Received: %4i" , received );
@@ -332,7 +333,7 @@ int run_test(test_config *config)
332333 double period_sec = period * 0.001 ;
333334 mpr_time t_start ;
334335 int result = 0 ;
335- // int zero = 0;
336+ int use_inst = 0 ;
336337 mpr_map map ;
337338 char expr [256 ];
338339
@@ -350,8 +351,10 @@ int run_test(test_config *config)
350351 /* set expression */
351352 mpr_obj_set_prop ((mpr_obj )map , MPR_PROP_EXPR , NULL , 1 , MPR_STR , expr , 1 );
352353
353- // TODO: ensure can set this with an int, etc
354- // mpr_obj_set_prop((mpr_obj)map, MPR_PROP_USE_INST, NULL, 1, MPR_BOOL, &zero, 1);
354+ /* set use_inst property to False since the destination will claim an instance locally */
355+ /* TODO: test with multiple instances, instanced periods, etc. */
356+ /* also test setting boolean property with integer value */
357+ mpr_obj_set_prop ((mpr_obj )map , MPR_PROP_USE_INST , NULL , 1 , MPR_INT32 , & use_inst , 1 );
355358
356359 mpr_obj_push (map );
357360
@@ -384,6 +387,12 @@ int run_test(test_config *config)
384387 }
385388 } while (!done );
386389
390+ /* double-check that the map instancing is correct */
391+ if (mpr_obj_get_prop_as_int32 ((mpr_obj )map , MPR_PROP_USE_INST , NULL ) != use_inst ) {
392+ eprintf ("error: map.use_inst=%d but should be %d\n" , !use_inst , use_inst );
393+ return 1 ;
394+ }
395+
387396 /* activate a destination instance */
388397// mpr_sig_activate_inst(recvsig, 0);
389398
0 commit comments