Bug 1867183 - Disable gtest cubeb.one_duplex_one_input on macOS 10.15. r=pehrsons,cubeb-reviewers

Differential Revision: https://phabricator.services.mozilla.com/D211005
This commit is contained in:
Paul Adenot 2024-05-21 12:38:51 +00:00
parent 53e03a2808
commit 9b4a7fecb7
3 changed files with 66 additions and 0 deletions

View file

@ -0,0 +1,51 @@
diff --git a/test/test_duplex.cpp b/test/test_duplex.cpp
--- a/test/test_duplex.cpp
+++ b/test/test_duplex.cpp
@@ -12,16 +12,19 @@
#define _XOPEN_SOURCE 600
#endif
#include "cubeb/cubeb.h"
#include <atomic>
#include <math.h>
#include <memory>
#include <stdio.h>
#include <stdlib.h>
+#ifdef __APPLE__
+#include <sys/utsname.h>
+#endif
#include "mozilla/gtest/MozHelpers.h"
// #define ENABLE_NORMAL_LOG
// #define ENABLE_VERBOSE_LOG
#include "common.h"
#define SAMPLE_FREQUENCY 48000
@@ -294,16 +296,28 @@ TEST(cubeb, one_duplex_one_input)
cubeb * ctx;
cubeb_stream * duplex_stream;
cubeb_stream_params input_params;
cubeb_stream_params output_params;
int r;
user_state_duplex duplex_stream_state;
uint32_t latency_frames = 0;
+ // Disabled on 10.15, see bug 1867183
+#ifdef __APPLE__
+ struct utsname uts;
+ uname(&uts);
+ // 10.15 correspond to Darwin 19
+ if (strncmp(uts.release, "19", 2) == 0) {
+ printf("Test disabled on macOS 10.15, exiting.\n");
+ return;
+ }
+#endif
+
r = common_init(&ctx, "Cubeb duplex example");
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";
std::unique_ptr<cubeb, decltype(&cubeb_destroy)> cleanup_cubeb_at_exit(
ctx, cubeb_destroy);
/* This test needs at least two available input devices. */
std::vector<cubeb_devid> input_devices =

View file

@ -22,6 +22,7 @@ vendoring:
- 0003-Only-build-duplex_collection_change_no_unregister-wh.patch
- 0004-audiounit-ios-compile-fixes.patch
- 0005-aaudio-timing-fix.patch
- 0006-disable-cubeb_one_duplex_one_input-macos10.15.patch
skip-vendoring-steps:
- update-moz-build
exclude:

View file

@ -17,6 +17,9 @@
#include <memory>
#include <stdio.h>
#include <stdlib.h>
#ifdef __APPLE__
#include <sys/utsname.h>
#endif
#include "mozilla/gtest/MozHelpers.h"
@ -299,6 +302,17 @@ TEST(cubeb, one_duplex_one_input)
user_state_duplex duplex_stream_state;
uint32_t latency_frames = 0;
// Disabled on 10.15, see bug 1867183
#ifdef __APPLE__
struct utsname uts;
uname(&uts);
// 10.15 correspond to Darwin 19
if (strncmp(uts.release, "19", 2) == 0) {
printf("Test disabled on macOS 10.15, exiting.\n");
return;
}
#endif
r = common_init(&ctx, "Cubeb duplex example");
ASSERT_EQ(r, CUBEB_OK) << "Error initializing cubeb library";