Skip to content

Commit

Permalink
tests fix
Browse files Browse the repository at this point in the history
  • Loading branch information
milyin committed Aug 20, 2024
1 parent eb8683e commit d0cead6
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
22 changes: 11 additions & 11 deletions tests/z_api_alignment_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -186,10 +186,10 @@ int main(int argc, char **argv) {
printf("Testing Configs...");
z_owned_config_t _ret_config;
z_config_new(&_ret_config);
assert(!_z_check(_ret_config)); // null config corresponds to empty one
assert(!z_internal_check(_ret_config)); // null config corresponds to empty one
z_drop(z_move(_ret_config));
z_config_default(&_ret_config);
assert(_z_check(_ret_config));
assert(z_internal_check(_ret_config));
#ifdef ZENOH_PICO
_ret_int8 = zp_config_insert(z_loan_mut(_ret_config), Z_CONFIG_CONNECT_KEY, argv[1]);
assert_eq(_ret_int8, 0);
Expand All @@ -200,7 +200,7 @@ int main(int argc, char **argv) {

z_owned_config_t _ret_sconfig;
z_config_default(&_ret_sconfig);
assert(_z_check(_ret_sconfig));
assert(z_internal_check(_ret_sconfig));

printf("Ok\n");
z_sleep_s(SLEEP);
Expand All @@ -219,7 +219,7 @@ int main(int argc, char **argv) {

z_owned_session_t s1;
z_open(&s1, z_move(_ret_config));
assert(_z_check(s1));
assert(z_internal_check(s1));
z_id_t _ret_zid = z_info_zid(z_loan(s1));
printf("Session 1 with PID: 0x");
for (unsigned long i = 0; i < sizeof(_ret_zid); i++) {
Expand Down Expand Up @@ -263,7 +263,7 @@ int main(int argc, char **argv) {

z_owned_session_t s2;
z_open(&s2, z_move(_ret_config));
assert(_z_check(s2));
assert(z_internal_check(s2));
_ret_zid = z_info_zid(z_loan(s2));
printf("Session 2 with PID: 0x");
for (unsigned long i = 0; i < sizeof(_ret_zid); i++) {
Expand Down Expand Up @@ -300,7 +300,7 @@ int main(int argc, char **argv) {
z_view_keyexpr_from_str(&s1_key, s1_res);
z_owned_keyexpr_t _ret_expr;
z_declare_keyexpr(&_ret_expr, z_loan(s1), z_loan(s1_key));
assert(_z_check(_ret_expr));
assert(z_internal_check(_ret_expr));
printf("Ok\n");

printf("Session Put...");
Expand All @@ -317,7 +317,7 @@ int main(int argc, char **argv) {

_ret_int8 = z_put(z_loan(s1), z_loan(_ret_expr), z_move(payload), &_ret_put_opt);
assert_eq(_ret_int8, 0);
assert(!_z_check(encoding));
assert(!z_internal_check(encoding));
printf("Ok\n");

z_sleep_s(SLEEP);
Expand All @@ -338,7 +338,7 @@ int main(int argc, char **argv) {
_ret_int8 = z_undeclare_keyexpr(z_move(_ret_expr), z_loan(s1));
printf(" %02x\n", _ret_int8);
assert_eq(_ret_int8, 0);
assert(!_z_check(_ret_expr));
assert(!z_internal_check(_ret_expr));
printf("Ok\n");

printf("Declaring Publisher...");
Expand All @@ -350,7 +350,7 @@ int main(int argc, char **argv) {
z_owned_publisher_t _ret_pub;
_ret_int8 = z_declare_publisher(&_ret_pub, z_loan(s1), z_loan(s1_key), &_ret_pub_opt);
assert(_ret_int8 == _Z_RES_OK);
assert(!_z_check(encoding));
assert(!z_internal_check(encoding));
printf("Ok\n");

z_sleep_s(SLEEP);
Expand Down Expand Up @@ -381,15 +381,15 @@ int main(int argc, char **argv) {
printf("Undeclaring Publisher...");
_ret_int8 = z_undeclare_publisher(z_move(_ret_pub));
assert_eq(_ret_int8, 0);
assert(!_z_check(_ret_pub));
assert(!z_internal_check(_ret_pub));
printf("Ok\n");

z_sleep_s(SLEEP);

printf("Undeclaring Subscriber...");
_ret_int8 = z_undeclare_subscriber(z_move(_ret_sub));
assert_eq(_ret_int8, 0);
assert(!_z_check(_ret_sub));
assert(!z_internal_check(_ret_sub));
printf("Ok\n");

z_sleep_s(SLEEP);
Expand Down
2 changes: 1 addition & 1 deletion tests/z_client_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ int main(int argc, char **argv) {

z_owned_session_t s2;
assert(z_open(&s2, z_move(config)) == Z_OK);
assert(_z_check(s2));
assert(z_internal_check(s2));
_z_string_t zid2 = format_id(&(_Z_RC_IN_VAL(z_loan(s2))->_local_zid));
printf("Session 2 with PID: %s\n", _z_string_data(&zid2));
_z_string_clear(&zid2);
Expand Down

0 comments on commit d0cead6

Please sign in to comment.