Skip to content
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
merged 6 commits into from Mar 29, 2016

Conversation

ghost
Copy link

@ghost ghost commented Mar 24, 2016

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]

… 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 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 ghost added this to the 0.1.6 milestone Mar 24, 2016
Roland Bewick added 3 commits March 24, 2016 17:51
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]>
@ghost 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 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);
Copy link
Collaborator

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

@cdewbery cdewbery merged commit bbb6cb7 into ConnectivityFoundry:master Mar 29, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant