Skip to content

Commit

Permalink
Fix throw_catch_raise_catch test in old runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Nov 14, 2024
1 parent 8c16687 commit 22b2560
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions crates/tests/src/exception.rs
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,13 @@ fn throw_catch_raise_catch() {

let exc = NSException::from_exception(res.unwrap_err().unwrap()).unwrap();

// Undesired: The inner pool _should_ have been drained on unwind, but
// it isn't, see `rc::Pool::drain`.
assert_eq!(exc.retainCount(), 2);
if cfg!(all(target_os = "macos", target_arch = "x86")) {
assert_eq!(exc.retainCount(), 1);
} else {
// Undesired: The inner pool _should_ have been drained on unwind,
// but it isn't in newer runtimes, see docs on `rc::Pool::drain`.
assert_eq!(exc.retainCount(), 2);
}
exc
});

Expand Down

0 comments on commit 22b2560

Please sign in to comment.