Skip to content

Commit

Permalink
Rename objc_test_utils -> objc2_test_utils
Browse files Browse the repository at this point in the history
  • Loading branch information
madsmtm committed Sep 8, 2021
1 parent 215f406 commit 7e2868b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
2 changes: 1 addition & 1 deletion objc2_block/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,4 @@ exclude = [
objc2_encode = { path = "../objc2_encode" }

[dev-dependencies]
objc_test_utils = { path = "../objc2_test_utils", version = "0.0" }
objc2_test_utils = { path = "../objc2_test_utils" }
10 changes: 4 additions & 6 deletions objc2_block/src/test_utils.rs
Original file line number Diff line number Diff line change
@@ -1,27 +1,25 @@
use objc_test_utils;

use crate::{Block, RcBlock};

pub fn get_int_block_with(i: i32) -> RcBlock<(), i32> {
unsafe {
let ptr = objc_test_utils::get_int_block_with(i);
let ptr = objc2_test_utils::get_int_block_with(i);
RcBlock::new(ptr as *mut _)
}
}

pub fn get_add_block_with(i: i32) -> RcBlock<(i32,), i32> {
unsafe {
let ptr = objc_test_utils::get_add_block_with(i);
let ptr = objc2_test_utils::get_add_block_with(i);
RcBlock::new(ptr as *mut _)
}
}

pub fn invoke_int_block(block: &Block<(), i32>) -> i32 {
let ptr = block as *const _;
unsafe { objc_test_utils::invoke_int_block(ptr as *mut _) }
unsafe { objc2_test_utils::invoke_int_block(ptr as *mut _) }
}

pub fn invoke_add_block(block: &Block<(i32,), i32>, a: i32) -> i32 {
let ptr = block as *const _;
unsafe { objc_test_utils::invoke_add_block(ptr as *mut _, a) }
unsafe { objc2_test_utils::invoke_add_block(ptr as *mut _, a) }
}
4 changes: 2 additions & 2 deletions objc2_test_utils/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[package]
name = "objc_test_utils"
name = "objc2_test_utils"
version = "0.0.2"
authors = ["Steven Sheldon", "Mads Marquart <mads@marquart.dk>"]
edition = "2018"
Expand All @@ -13,7 +13,7 @@ categories = [
"os::macos-apis",
]
repository = "https://github.com/madsmtm/objc2"
documentation = "https://docs.rs/objc_test_utils/"
documentation = "https://docs.rs/objc2_test_utils/"
license = "MIT"

build = "build.rs"
Expand Down

0 comments on commit 7e2868b

Please sign in to comment.