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 AwaStaticClient_ResourceChanged #69

Merged
merged 5 commits into from Mar 18, 2016
Merged

Added AwaStaticClient_ResourceChanged #69

merged 5 commits into from Mar 18, 2016

Conversation

ghost
Copy link

@ghost ghost commented Mar 17, 2016

One working test for AwaStaticClient_ResourceChanged is in
place but it needs to be cleaned up and parameterised.

Added a temporary mapping between Lwm2mResult and AwaLwm2mError
although these enums should really be combined.

Renamed some wrongly spelt variables in test_client.cc

Signed-off-by: Roland Bewick [email protected]

};


void callbackHandler(const AwaChangeSet * changeSet)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needs assertions and hardcoded values removed

@DavidAntliff
Copy link
Collaborator

The tests for this feature don't need threads - try this:

1. create observation on server
2. perform observation on server
3. change value on static client - call ResourceChanged()
4. use a subclassed WaitCondition to continually call static client process, and be calling server process within the wait loop. Loop terminates when server callback fires and sets a loop exit flag.

This would be preferable to multiple threads, which can be difficult to maintain and understand.

@cdewbery
Copy link
Collaborator

@david-antliff-imgtec You don't need a thread for steps 3 and 4, but I think you still need a thread to create the initial observation, as the AwaServerObserveOperation_Perform() function is a blocking operation and won't complete until it times out (resulting in a error) or succeeds which requires AwaStaticClient_Process() to be called called.

for example:

  • Server thread - AwaServerObserveOperation_Perform() - sends observe to client, then blocks waiting for response.
  • Client (aka test code) - AwaStaticClient_Process(), handles observe request, sends response to server.
  • Server thread - AwaServerObserveOperation_Perform() completes.

Roland Bewick added 2 commits March 18, 2016 14:51
One working test for AwaStaticClient_ResourceChanged is in
place but it needs to be cleaned up and parameterised.

Added a temporary mapping between Lwm2mResult and AwaLwm2mError
although these enums should really be combined.

Renamed some wrongly spelt variables in test_client.cc

Signed-off-by: Roland Bewick <[email protected]>
Removed deprecated definition->Handlers.Read == NULL check
Removed AwaLwm2mResult_ToAwaLwm2mError (unused and untested)
Parameterised observe test for AwaStaticClient_ResourceChanged for
all single instance resource types..

Signed-off-by: Roland Bewick <[email protected]>
@cdewbery cdewbery added this to the 0.1.5 milestone Mar 18, 2016
@ghost ghost changed the title Added AwaStaticClient_ResourceChanged - DO NOT MERGE Added AwaStaticClient_ResourceChanged Mar 18, 2016
cdewbery pushed a commit that referenced this pull request Mar 18, 2016
Added AwaStaticClient_ResourceChanged
@cdewbery cdewbery merged commit c5f662a into ConnectivityFoundry:master Mar 18, 2016
@DavidAntliff
Copy link
Collaborator

@chris-dewbery-imgtec yep, fair comment, we missed that.

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.

2 participants