Skip to content

Commit

Permalink
keyexpr test fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Dec 1, 2023
1 parent 968d570 commit 96fda4b
Showing 1 changed file with 7 additions and 12 deletions.
19 changes: 7 additions & 12 deletions tests/universal/keyexpr.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,13 @@ void includes_declared(Session& s) {
assert(foobarv.check());
assert(starbuzv.check());

assert(keyexpr_includes("FOO/*", "FOO/BAR", err));
assert(err == 0);
assert(!keyexpr_includes("*/BUZ", "FOO/BAR", err));
assert(err == 0);
assert(!keyexpr_includes("FOO/*", nul, err));
assert(err < 0);

#ifdef ZENOHCXX_ZENOHC
// zenoh-c is able to check declared keyexprs
assert(foostar.includes(foobar, err));
Expand All @@ -389,12 +396,6 @@ void includes_declared(Session& s) {
assert(err == 0);
assert(!foostar.includes(nul, err));
assert(err < 0);
assert(keyexpr_includes("FOO/*", "FOO/BAR", err));
assert(err == 0);
assert(!keyexpr_includes("*/BUZ", "FOO/BAR", err));
assert(err == 0);
assert(!keyexpr_includes("FOO/*", nul, err));
assert(err < 0);
#else
// zenoh-pico returns error when checking declared keyexprs: the string value is avaliable in session only
assert(!foostar.includes(foobar, err));
Expand All @@ -403,12 +404,6 @@ void includes_declared(Session& s) {
assert(err < 0);
assert(!foostar.includes(nul, err));
assert(err < 0);
assert(!keyexpr_includes("FOO/*", "FOO/BAR", err));
assert(err < 0);
assert(!keyexpr_includes("*/BUZ", "FOO/BAR", err));
assert(err < 0);
assert(!keyexpr_includes("FOO/*", nul, err));
assert(err < 0);
#endif

// both zenoh-c and zenoh-pico are able to check declared keyexprs through the session
Expand Down

0 comments on commit 96fda4b

Please sign in to comment.