File tree 2 files changed +27
-0
lines changed
2 files changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -120,6 +120,18 @@ fn test_switch_device_in_scope_while_paused(scope: Scope) {
120
120
stm. core_stream_data . input_unit
121
121
} ;
122
122
123
+ if scope == Scope :: Output {
124
+ assert_eq ! (
125
+ stm. core_stream_data. output_device. id,
126
+ device_switcher. current( )
127
+ ) ;
128
+ } else {
129
+ assert_eq ! (
130
+ stm. core_stream_data. input_device. id,
131
+ device_switcher. current( )
132
+ ) ;
133
+ }
134
+
123
135
// Pause the stream, and change the default device
124
136
assert_eq ! ( unsafe { OPS . stream_stop. unwrap( ) ( stream) } , ffi:: CUBEB_OK ) ;
125
137
@@ -148,6 +160,18 @@ fn test_switch_device_in_scope_while_paused(scope: Scope) {
148
160
// Start the stream, and check that the device in use isn't the same as before pausing
149
161
assert_eq ! ( unsafe { OPS . stream_start. unwrap( ) ( stream) } , ffi:: CUBEB_OK ) ;
150
162
163
+ if scope == Scope :: Output {
164
+ assert_eq ! (
165
+ stm. core_stream_data. output_device. id,
166
+ device_switcher. current( )
167
+ ) ;
168
+ } else {
169
+ assert_eq ! (
170
+ stm. core_stream_data. input_device. id,
171
+ device_switcher. current( )
172
+ ) ;
173
+ }
174
+
151
175
let after = if scope == Scope :: Output {
152
176
stm. core_stream_data . output_unit
153
177
} else {
Original file line number Diff line number Diff line change @@ -780,6 +780,9 @@ impl TestDeviceSwitcher {
780
780
}
781
781
}
782
782
}
783
+ pub fn current ( & self ) -> AudioObjectID {
784
+ self . devices [ self . current_device_index ]
785
+ }
783
786
784
787
fn set_device ( & self , device : AudioObjectID ) -> std:: result:: Result < AudioObjectID , OSStatus > {
785
788
test_set_default_device ( device, self . scope . clone ( ) )
You can’t perform that action at this time.
0 commit comments