-
Notifications
You must be signed in to change notification settings - Fork 6
Unit Test mse decoder #17
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
base: master
Are you sure you want to change the base?
Conversation
src/decoder/mse/rb_mse.c
Outdated
assert(opaque); | ||
assert(config); | ||
char err[BUFSIZ]; | ||
char err[BUFSIZ] = ""; |
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.
This shouldn't be initialized
src/decoder/mse/rb_mse.c
Outdated
assert(MSE_OPAQUE_MAGIC == opaque->magic); | ||
#endif | ||
char err[BUFSIZ]; | ||
char err[BUFSIZ] = ""; |
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.
This shouldn't be initialized
src/decoder/mse/rb_mse.c
Outdated
void mse_opaque_done(void *_opaque) { | ||
assert(_opaque); | ||
|
||
if (NULL == _opaque){ |
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.
_opaque should never be NULL (the previous assert & we are freeing data)
src/decoder/mse/rb_mse.c
Outdated
|
||
json_array_foreach(mse_array, _index, value) { | ||
parse_sensor(value, new_db); | ||
ret = parse_sensor(value, new_db); |
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.
const int ret = parse_sensor
src/util/in_addr_list.c
Outdated
int in_addr_list_contains(const in_addr_list_t *list,const struct in_addr *addr){ | ||
in_addr_list_node_t *n=NULL; | ||
for(n=LIST_FIRST(syslist(list));n!=NULL;n=LIST_NEXT(n,entry)){ | ||
if (NULL == n){ |
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.
this can't be NULL (loop condition)
src/util/in_addr_list.c
Outdated
|
||
in_addr_list_node_t *n=NULL; | ||
while((n = LIST_FIRST(syslist(list)))){ | ||
if (NULL == n){ |
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.
n
can never be NULL (loop condition)
tests/0000-MSE8.c
Outdated
mse_array); | ||
assert_true(parse_rc == 0); | ||
|
||
char *aux = strdup(mse_input1); |
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.
No need to strdup
string, process_mse_buffer parameter is const
tests/0000-MSE8.c
Outdated
&decoder_info, | ||
now); | ||
|
||
char *aux2 = strdup(mse_input2); |
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.
No need for strdup
} | ||
|
||
static void checkMSE8_invalid_timestamp(struct mse_array *notifications_array) { | ||
/* No database -> output == input */ |
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.
Why delete this?
tests/0003-MSE8_listener_enrich.c
Outdated
assert(unpack_rc == 0); | ||
assert(0 == strcmp(subscriptionName, "MSE_SanCarlos")); | ||
assert(0 == strcmp(sensor_name, "MSE_testing")); | ||
//assert(0 == strcmp(sensor_name, "MSE_testing")); |
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.
Why delete this check?
No description provided.