1 # This test confirms that CORBA::is_nil works
3 TAO implements `CORBA::is_nil` as a function template, which merely
4 checks the argument for zero. The template is specialized for
5 `CORBA::Object_ptr`, and this specialization additionally checks
6 whether a non-NULL argument might be an unevaluated nil object
9 Because template specialization is used and not an ordinary overloaded
10 function, the specialized variant is *not* called for pointers to
11 derived classes. This will work only if TAO ensures that all nil
12 object references that have been narrowed to a derived class are
13 converted to null pointers, i.e., to ensure that the generic template
14 produces the correct result.
16 This test has the server return a nil object reference and the client
17 uses lazy resource usage, to confirm that CORBA::is_nil correctly
18 identifies the nil object reference. See issue #1203, which pointed
19 out that only CORBA::Object_ptr has a template specialization for
20 CORBA::is_nil, but not derived interfaces.