@@ -50,11 +50,7 @@ TEST_F(PlatformAudioTest, DeviceInfoStoresStableId) {
5050
5151TEST_F (PlatformAudioTest, CreateSourceAndTrackWhenAvailable) {
5252 std::unique_ptr<PlatformAudio> platform_audio;
53- try {
54- platform_audio = std::make_unique<PlatformAudio>();
55- } catch (const PlatformAudioError& error) {
56- GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
57- }
53+ EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
5854
5955 const auto source = platform_audio->createAudioSource ();
6056 ASSERT_NE (source, nullptr );
@@ -68,11 +64,7 @@ TEST_F(PlatformAudioTest, CreateSourceAndTrackWhenAvailable) {
6864
6965TEST_F (PlatformAudioTest, MovedFromManagerThrowsOnUseButCountsAreSafe) {
7066 std::unique_ptr<PlatformAudio> platform_audio;
71- try {
72- platform_audio = std::make_unique<PlatformAudio>();
73- } catch (const PlatformAudioError& error) {
74- GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
75- }
67+ EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
7668
7769 PlatformAudio moved_to = std::move (*platform_audio);
7870 PlatformAudio& moved_from = *platform_audio;
@@ -94,11 +86,7 @@ TEST_F(PlatformAudioTest, MovedFromManagerThrowsOnUseButCountsAreSafe) {
9486
9587TEST_F (PlatformAudioTest, CopySharesHandleStateAndOutlivesOriginal) {
9688 std::unique_ptr<PlatformAudio> platform_audio;
97- try {
98- platform_audio = std::make_unique<PlatformAudio>();
99- } catch (const PlatformAudioError& error) {
100- GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
101- }
89+ EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
10290
10391 // A copy shares the underlying handle, so the cached counts agree.
10492 PlatformAudio copy = *platform_audio;
@@ -117,11 +105,7 @@ TEST_F(PlatformAudioTest, CopySharesHandleStateAndOutlivesOriginal) {
117105
118106TEST_F (PlatformAudioTest, CreateSourceWithCustomOptions) {
119107 std::unique_ptr<PlatformAudio> platform_audio;
120- try {
121- platform_audio = std::make_unique<PlatformAudio>();
122- } catch (const PlatformAudioError& error) {
123- GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
124- }
108+ EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
125109
126110 PlatformAudioOptions options;
127111 options.echo_cancellation = false ;
@@ -136,11 +120,7 @@ TEST_F(PlatformAudioTest, CreateSourceWithCustomOptions) {
136120
137121TEST_F (PlatformAudioTest, EnumerateDevicesAndSelectWhenAvailable) {
138122 std::unique_ptr<PlatformAudio> platform_audio;
139- try {
140- platform_audio = std::make_unique<PlatformAudio>();
141- } catch (const PlatformAudioError& error) {
142- GTEST_SKIP () << " PlatformAudio unavailable: " << error.what ();
143- }
123+ EXPECT_NO_THROW (platform_audio = std::make_unique<PlatformAudio>());
144124
145125 // Enumeration must succeed even on headless runners (it may return empty).
146126 std::vector<AudioDeviceInfo> recording_devices;
0 commit comments