Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

keyexpr test fix #85

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading