-
Notifications
You must be signed in to change notification settings - Fork 85
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
Update z_api_alignment_test for compatiblity with zenoh-c build #296
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,8 @@ | |
#include <unistd.h> | ||
#endif | ||
|
||
// This only one line which can be different between zenoh-c and zenoh-pico instances of this file | ||
// TODO: make the files completely identical | ||
#include "zenoh-pico.h" | ||
|
||
#define SLEEP 2 | ||
|
@@ -121,7 +123,9 @@ void data_handler(const z_sample_t *sample, void *arg) { | |
} | ||
|
||
int main(int argc, char **argv) { | ||
#ifdef ZENOH_PICO | ||
assert_eq(argc, 2); | ||
#endif | ||
(void)(argc); | ||
setvbuf(stdout, NULL, _IOLBF, 1024); | ||
|
||
|
@@ -215,9 +219,9 @@ int main(int argc, char **argv) { | |
assert(hellos >= 1); | ||
|
||
uint32_t _scouting_timeout = strtoul(SCOUTING_TIMEOUT, NULL, 10); | ||
z_sleep_ms(_scouting_timeout); | ||
sleep(_scouting_timeout / 1000); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. In Zenoh-Pico/Zenoh-C we should better use There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. But as far as I understand, the idea is for the files to be identical in both repos, do you think adding a There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I would say that the additional functions shall be added in zenoh-c, as referred by @Mallets. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, sure, but until we have no them in zenohc, api alignment test on them has no sense. |
||
printf("Ok\n"); | ||
z_sleep_s(SLEEP); | ||
sleep(SLEEP); | ||
|
||
z_owned_session_t s1 = z_open(z_move(_ret_config)); | ||
assert(z_check(s1)); | ||
|
@@ -234,11 +238,13 @@ int main(int argc, char **argv) { | |
sleep(SLEEP); | ||
assert_eq(zids, 0); | ||
|
||
#ifdef ZENOH_PICO // zenoh-c test has no router | ||
_ret_int8 = z_info_routers_zid(z_loan(s1), z_move(_ret_closure_zid)); | ||
assert_eq(_ret_int8, 0); | ||
|
||
sleep(SLEEP); | ||
assert_eq(zids, 1); | ||
#endif | ||
|
||
#ifdef ZENOH_PICO | ||
zp_task_read_options_t _ret_read_opt = zp_task_read_options_default(); | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tests are also failing because the
ZENOH_PICO
checked before its definition inzenoh-pico.h
include