-
Notifications
You must be signed in to change notification settings - Fork 67
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
Added parameterised set/write operation test validation and fixed set not doing a replace on array resources. #96
Merged
Conversation
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
… not doing a replace on array resources. Added validation to parameterised set and write tests on single and multiple instance resources by doing a client GET operation after setting the values to ensure the resource's value is what we set, rather than just checking AwaSetOperation_Perform error code. Fixed response common creating / freeing generic AwaArrays rather than an array of the type for each value, causing StringArray NulledStrings context not to be initialised and freed, and any individual new/free functionality in the array types not being called. Added tests that set / write on an existing non-empty array, confirming that setting an entire array will replace rather than update the existing resource. Added SetArrayMode enum internally to the client set operation, which is passed over the IPC for each multiple-instance resource to be set. The core will then replace or update the resource depending on the mode set, rather than only supporting updating the resource. Signed-off-by: Roland Bewick <[email protected]>
ghost
changed the title
Added parameterised set/write operation test validation and fixed set not doing a replace on array resources.
DO NOT MERGE - Added parameterised set/write operation test validation and fixed set not doing a replace on array resources.
Mar 24, 2016
ghost
added this to the 0.1.6 milestone
Mar 24, 2016
Fixed c99 for loop warning. Added an extra parameter for tests that should not call SetOperation_Perform. Fixed replace flag not being initialised in LWM2M tree node. Signed-off-by: Roland Bewick <[email protected]>
… values as data and length. Signed-off-by: Roland Bewick <[email protected]>
…t link array types Signed-off-by: Roland Bewick <[email protected]>
ghost
changed the title
DO NOT MERGE - Added parameterised set/write operation test validation and fixed set not doing a replace on array resources.
Added parameterised set/write operation test validation and fixed set not doing a replace on array resources.
Mar 28, 2016
ghost
assigned cdewbery
Mar 28, 2016
to iterate through defaults of each array type. AwaStringArray_SetValue was not being called by Value_New, causing CString values not to be added to the AwaStringArray context. AwaStringArray_SetValue is now explicitly called. AwaOpaqueArray_SetValue is also called, removing duplicated functionality inside Value_New to allocate memory for the opaque's data. Added tests for iterating through the defaults of each array type to ensure that the same issue does not occur when any of the other array type Set/New functions are given custom functionality. Signed-off-by: Roland Bewick <[email protected]>
opaque.Size = dataLength; | ||
if (dataLength > 0) | ||
{ | ||
opaque.Data = Awa_MemAlloc(dataLength); |
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.
Perhaps consider a check for opaque.Data != NULL
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Added validation to parameterised set and write tests on single
and multiple instance resources by doing a client GET operation
after setting the values to ensure the resource's value is what
we set, rather than just checking AwaSetOperation_Perform error code.
Fixed response common creating / freeing generic AwaArrays rather
than an array of the type for each value, causing StringArray
NulledStrings context not to be initialised and freed, and any
individual new/free functionality in the array types not being called.
Added tests that set / write on an existing non-empty array, confirming
that setting an entire array will replace rather than update the existing
resource.
Added SetArrayMode enum internally to the client set operation, which is
passed over the IPC for each multiple-instance resource to be set. The
core will then replace or update the resource depending on the mode set,
rather than only supporting updating the resource.
Signed-off-by: Roland Bewick [email protected]