Skip to content

Commit 1d1ced6

Browse files
committed
Properly test Id::retain_autoreleased
1 parent 9ba64a4 commit 1d1ced6

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

.github/workflows/apple.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,3 +77,9 @@ jobs:
7777
command: test
7878
# Not using --all-features because some features are nightly-only
7979
args: --verbose --no-fail-fast --features block,exception,catch_all,verify_message
80+
81+
- name: Test objc_retainAutoreleasedReturnValue
82+
uses: actions-rs/cargo@v1
83+
with:
84+
command: test
85+
args: --package objc2-foundation --test objc_id_retain_autoreleased --release

.github/workflows/gnustep.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,3 +115,9 @@ jobs:
115115
command: test
116116
# Not using --all-features because some features are nightly-only
117117
args: --verbose --no-fail-fast --features gnustep-1-9,block,exception,catch_all,verify_message
118+
119+
- name: Test objc_retainAutoreleasedReturnValue
120+
uses: actions-rs/cargo@v1
121+
with:
122+
command: test
123+
args: --package objc2-foundation --test objc_id_retain_autoreleased --release

objc2-foundation/tests/objc_id_retain_autoreleased.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,11 @@ fn create_data(bytes: &[u8]) -> Id<NSData, Shared> {
2525

2626
#[test]
2727
fn test_retain_autoreleased() {
28+
#[cfg(gnustep)]
29+
unsafe {
30+
objc2::__gnustep_hack::get_class_to_force_linkage()
31+
};
32+
2833
autoreleasepool(|_| {
2934
let data = create_data(b"12");
3035
// The autorelease-return-mechanism has to "warm up" somehow? At least

0 commit comments

Comments
 (0)