Device server incoming pointers

Hi,

I have a device server accepting Tango::DevString and Tango::DevVarStringArray as command parameters and also attributes of these types.

Now in the implementation I now always test these incoming parameters as in
void MyFancyServer::do_stuff(const Tango::DevVarStringArray *argin)
for null using

    if(argin == nullptr)
    {
        Tango::Except::throw_exception(…);
    }

Is that really necessary? I'm asking because in my unit tests I was never able to trigger that exception, I always get an exception from the CORBA middleware instead.
Hi,

Your test on null pointer for incoming data is not necessary. Memory for incoming data is allocated by the CORBA layer and it
will not call your method is the memory allocation failed for one reason or another

Regards

Emmanuel
As I guessed, thanks!
 
Register or login to create to post a reply.