Skip to content

Commit

Permalink
compilation fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Apr 10, 2024
1 parent d0d97c9 commit 834be85
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 71 deletions.
4 changes: 2 additions & 2 deletions zenoh-ext/src/publication_cache.rs
Original file line number Diff line number Diff line change
Expand Up @@ -181,9 +181,9 @@ impl<'a> PublicationCache<'a> {
sample = sub_recv.recv_async() => {
if let Ok(sample) = sample {
let queryable_key_expr: KeyExpr<'_> = if let Some(prefix) = &queryable_prefix {
prefix.join(&sample.key_expr).unwrap().into()
prefix.join(&sample.key_expr()).unwrap().into()
} else {
sample.key_expr.clone()
sample.key_expr().clone()
};

if let Some(queue) = cache.get_mut(queryable_key_expr.as_keyexpr()) {
Expand Down
69 changes: 0 additions & 69 deletions zenoh/src/net/tests/tables.rs
Original file line number Diff line number Diff line change
Expand Up @@ -234,75 +234,6 @@ fn multisub_test() {
tables::close_face(&tables, &face0);
}

#[test]
fn multisub_test() {
let config = Config::default();
let router = Router::new(
ZenohId::try_from([1]).unwrap(),
WhatAmI::Client,
Some(Arc::new(HLC::default())),
&config,
)
.unwrap();
let tables = router.tables.clone();

let primitives = Arc::new(DummyPrimitives {});
let face0 = Arc::downgrade(&router.new_primitives(primitives).state);
assert!(face0.upgrade().is_some());

// --------------
let sub_info = SubscriberInfo {
reliability: Reliability::Reliable,
};
declare_subscription(
zlock!(tables.ctrl_lock).as_ref(),
&tables,
&mut face0.upgrade().unwrap(),
0,
&"sub".into(),
&sub_info,
NodeId::default(),
);
let optres = Resource::get_resource(zread!(tables.tables)._get_root(), "sub")
.map(|res| Arc::downgrade(&res));
assert!(optres.is_some());
let res = optres.unwrap();
assert!(res.upgrade().is_some());

declare_subscription(
zlock!(tables.ctrl_lock).as_ref(),
&tables,
&mut face0.upgrade().unwrap(),
1,
&"sub".into(),
&sub_info,
NodeId::default(),
);
assert!(res.upgrade().is_some());

undeclare_subscription(
zlock!(tables.ctrl_lock).as_ref(),
&tables,
&mut face0.upgrade().unwrap(),
0,
&WireExpr::empty(),
NodeId::default(),
);
assert!(res.upgrade().is_some());

undeclare_subscription(
zlock!(tables.ctrl_lock).as_ref(),
&tables,
&mut face0.upgrade().unwrap(),
1,
&WireExpr::empty(),
NodeId::default(),
);
assert!(res.upgrade().is_none());

tables::close_face(&tables, &face0);
}

#[tokio::test(flavor = "multi_thread", worker_threads = 1)]
async fn clean_test() {
let config = Config::default();
Expand Down

0 comments on commit 834be85

Please sign in to comment.