-
Notifications
You must be signed in to change notification settings - Fork 16
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
Unit test for rule & codec & disconnect tcp & broker_tcp v5 #628
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
a826fac
* MDF [conf test] enable more optinos.
OdyWayne b5324ea
* NEW [trantest] test for broker-tcp-v5.
OdyWayne 63ed455
* NEW [trantest] add mqtt-tcp test for disconnect and syn sub & unsub.
OdyWayne 65ccfff
* FIX [unit test] enable rule test.
OdyWayne e7a66c9
* NEW [unit test] more rule test.
OdyWayne f97ffac
* ADD [unit test] add more tests on mqtt msg encode.
OdyWayne 2ec14fd
* ADD [unit test] add more tests on mqtt msg decode.
OdyWayne 854a5f2
* ADD [unit test] Unit tests on mqtt_codec.
OdyWayne b25f0d6
* MDF [unit test] Reorganize mqtt_test.
OdyWayne 7da701f
* NEW [unit test] ut for more encode & kv & wr & cd test.
OdyWayne a49b8de
* NEW [unit test] unit test for mqtt_public.
OdyWayne 699e54a
* MDF [topic array] enable length option just like topic_qos_array.
OdyWayne 54e46d2
* MDF [mqtt client] enable unsuback property option.
OdyWayne 3ee07ec
* NEW [unit test] unit test for set & get property.
OdyWayne e0d2820
* NEW [unit test] more unit test for mqtt_public.
OdyWayne ce62da0
* FIX [proto data init] enable proto data init.
OdyWayne 267523a
* ADD [unit test] add property api test.
OdyWayne a521db5
* FIX [unit test] fix build in darwin.
OdyWayne cb17247
* FIX [unit test] fix warning.
OdyWayne File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -38,6 +38,7 @@ nni_mqtt_msg_proto_data_alloc(nni_msg *msg) | |
if ((proto_data = NNI_ALLOC_STRUCT(proto_data)) == NULL) { | ||
return NNG_ENOMEM; | ||
} | ||
nni_proto_data_init(proto_data); | ||
proto_data->initialized = false; | ||
nni_msg_set_proto_data(msg, &proto_msg_ops, proto_data); | ||
|
||
|
@@ -508,7 +509,7 @@ nni_mqtt_msg_set_unsubscribe_topics( | |
for (size_t i = 0; i < topic_count; i++) { | ||
nni_mqtt_topic_array_set( | ||
proto_data->payload.unsubscribe.topic_arr, i, | ||
(const char *) topics[i].buf); | ||
(const char *) topics[i].buf, topics[i].length); | ||
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. previous bug? 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 think so. Length is an unused arg in unsub before, now it is fixed and works just like sub. |
||
} | ||
} | ||
|
||
|
@@ -845,10 +846,10 @@ nni_mqtt_topic_array_create(size_t n) | |
|
||
void | ||
nni_mqtt_topic_array_set( | ||
nni_mqtt_topic *topic, size_t index, const char *topic_name) | ||
nni_mqtt_topic *topic, size_t index, const char *topic_name, uint32_t len) | ||
{ | ||
topic[index].buf = (uint8_t *) nni_strdup(topic_name); | ||
topic[index].length = (uint32_t) strlen(topic_name); | ||
topic[index].length = len; | ||
} | ||
|
||
void | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
missing before?
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.
yes