File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -352,8 +352,10 @@ mod tests {
352352
353353 #[ test]
354354 fn uuid_stable ( ) {
355- let handle_a = MonitorHandle :: new ( 1 ) . unwrap ( ) ;
356- let handle_b = MonitorHandle :: new ( 1 ) . unwrap ( ) ;
355+ let primary_id = CGMainDisplayID ( ) ;
356+
357+ let handle_a = MonitorHandle :: new ( primary_id) . unwrap ( ) ;
358+ let handle_b = MonitorHandle :: new ( primary_id) . unwrap ( ) ;
357359 assert_eq ! ( handle_a, handle_b) ;
358360 assert_eq ! ( handle_a. display_id( ) , handle_b. display_id( ) ) ;
359361 assert_eq ! ( handle_a. uuid( ) , handle_b. uuid( ) ) ;
@@ -368,8 +370,10 @@ mod tests {
368370 /// Test the MonitorHandle::new fallback.
369371 #[ test]
370372 fn monitorhandle_from_zero ( ) {
373+ let primary_id = CGMainDisplayID ( ) ;
374+
371375 let handle0 = MonitorHandle :: new ( 0 ) . unwrap ( ) ;
372- let handle1 = MonitorHandle :: new ( 1 ) . unwrap ( ) ;
376+ let handle1 = MonitorHandle :: new ( primary_id ) . unwrap ( ) ;
373377 assert_eq ! ( handle0, handle1) ;
374378 assert_eq ! ( handle0. display_id( ) , handle1. display_id( ) ) ;
375379 assert_eq ! ( handle0. uuid( ) , handle1. uuid( ) ) ;
You can’t perform that action at this time.
0 commit comments