Skip to content

Commit

Permalink
now to fix the tests [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
p-avital committed Jul 4, 2023
1 parent 29aa8f7 commit ef3e956
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 20 deletions.
4 changes: 2 additions & 2 deletions include/zenoh-pico/protocol/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ typedef struct {
} _z_timestamp_t;

_z_timestamp_t _z_timestamp_duplicate(const _z_timestamp_t *tstamp);
_z_timestamp_t _z_timestamp_null();
_z_timestamp_t _z_timestamp_null(void);
void _z_timestamp_clear(_z_timestamp_t *tstamp);
_Bool _z_timestamp_check(const _z_timestamp_t *stamp);

Expand Down Expand Up @@ -182,7 +182,7 @@ typedef struct {
uint32_t _entity_id;
uint32_t _source_sn;
} _z_source_info_t;
_z_source_info_t _z_source_info_null();
_z_source_info_t _z_source_info_null(void);

typedef struct {
uint32_t _request_id;
Expand Down
4 changes: 2 additions & 2 deletions include/zenoh-pico/protocol/definitions/message.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ typedef struct {
typedef struct {
_z_source_info_t _ext_source_info;
} _z_msg_pull_t;
static inline void _z_msg_pull_clear(_z_msg_pull_t *pull) {}
static inline void _z_msg_pull_clear(_z_msg_pull_t *pull) { (void)pull; }

typedef struct {
_z_timestamp_t _timestamp;
Expand All @@ -141,7 +141,7 @@ typedef struct {
typedef struct {
_z_m_push_commons_t _commons;
} _z_msg_del_t;
static inline void _z_msg_del_clear(_z_msg_del_t *del) {}
static inline void _z_msg_del_clear(_z_msg_del_t *del) { (void)del; }
#define _Z_M_DEL_ID 0x02
#define _Z_FLAG_Z_D_T 0x20

Expand Down
15 changes: 2 additions & 13 deletions include/zenoh-pico/protocol/definitions/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ typedef struct {
_z_msg_put_t _put;
} _body;
} _z_push_body_t;
_z_push_body_t _z_push_body_null();
_z_push_body_t _z_push_body_null(void);
_z_push_body_t _z_push_body_steal(_z_push_body_t *msg);
void _z_push_body_clear(_z_push_body_t *msg);

Expand Down Expand Up @@ -231,18 +231,7 @@ _z_network_message_t _z_msg_make_pull(_z_keyexpr_t key, _z_zint_t pull_id);
_z_network_message_t _z_msg_make_query(_Z_MOVE(_z_keyexpr_t) key, _Z_MOVE(_z_bytes_t) parameters, _z_zint_t qid,
z_consolidation_mode_t consolidation, _Z_MOVE(_z_value_t) value);
_z_network_message_t _z_n_msg_make_reply(_z_zint_t rid, _Z_MOVE(_z_keyexpr_t) key, _Z_MOVE(_z_value_t) value);
_z_network_message_t _z_n_msg_make_ack(_z_zint_t rid, _Z_MOVE(_z_keyexpr_t) key) {
return (_z_network_message_t){
._tag = _Z_N_RESPONSE,
._body._response =
{
._tag = _Z_RESPONSE_BODY_ACK,
._request_id = rid,
._key = _z_keyexpr_steal(key),
._body._ack = {._timestamp = _z_timestamp_null(), ._ext_source_info = _z_source_info_null()},
},
};
}
_z_network_message_t _z_n_msg_make_ack(_z_zint_t rid, _Z_MOVE(_z_keyexpr_t) key);
_z_network_message_t _z_n_msg_make_response_final(_z_zint_t rid);
_z_network_message_t _z_n_msg_make_declare(_z_declaration_t declaration);
_z_network_message_t _z_n_msg_make_push(_Z_MOVE(_z_keyexpr_t) key, _Z_MOVE(_z_push_body_t) body);
Expand Down
4 changes: 4 additions & 0 deletions src/protocol/definitions/message.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,7 @@ void _z_msg_query_clear(_z_msg_query_t *msg) {
_z_bytes_clear(&msg->_parameters);
_z_value_clear(&msg->_value);
}
void _z_msg_err_clear(_z_msg_err_t *err) {
_z_timestamp_clear(&err->_timestamp);
_z_value_clear(&err->_ext_value);
}
12 changes: 12 additions & 0 deletions src/protocol/definitions/network.c
Original file line number Diff line number Diff line change
Expand Up @@ -226,3 +226,15 @@ _z_network_message_t _z_n_msg_make_reply(_z_zint_t rid, _Z_MOVE(_z_keyexpr_t) ke

};
}
_z_network_message_t _z_n_msg_make_ack(_z_zint_t rid, _Z_MOVE(_z_keyexpr_t) key) {
return (_z_network_message_t){
._tag = _Z_N_RESPONSE,
._body._response =
{
._tag = _Z_RESPONSE_BODY_ACK,
._request_id = rid,
._key = _z_keyexpr_steal(key),
._body._ack = {._timestamp = _z_timestamp_null(), ._ext_source_info = _z_source_info_null()},
},
};
}
4 changes: 1 addition & 3 deletions tests/z_msgcodec_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,10 @@

#include "zenoh-pico/collections/bytes.h"
#include "zenoh-pico/collections/string.h"
#include "zenoh-pico/protocol/codec/ext.h"
#include "zenoh-pico/protocol/ext.h"
#include "zenoh-pico/protocol/extcodec.h"
#include "zenoh-pico/protocol/iobuf.h"
#include "zenoh-pico/protocol/keyexpr.h"
#include "zenoh-pico/protocol/msg.h"
#include "zenoh-pico/protocol/msgcodec.h"
#include "zenoh-pico/system/platform.h"

#define RUNS 1000
Expand Down

0 comments on commit ef3e956

Please sign in to comment.