Skip to content

Commit

Permalink
Update z_api_alignment_test for compatiblity with zenoh-c build
Browse files Browse the repository at this point in the history
  • Loading branch information
sashacmc committed Dec 14, 2023
1 parent f502cb7 commit b76ab23
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions tests/z_api_alignment_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@
#include <unistd.h>
#endif

#ifdef ZENOH_PICO
#include "zenoh-pico.h"
#else
#include "zenoh.h"
#endif

#define SLEEP 2
#define SCOUTING_TIMEOUT "1000"
Expand Down Expand Up @@ -121,7 +125,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);

Expand Down Expand Up @@ -215,9 +221,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);
printf("Ok\n");
z_sleep_s(SLEEP);
sleep(SLEEP);

z_owned_session_t s1 = z_open(z_move(_ret_config));
assert(z_check(s1));
Expand All @@ -234,11 +240,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();
Expand Down

0 comments on commit b76ab23

Please sign in to comment.