summaryrefslogtreecommitdiff
path: root/TAO/tests/CORBA_is_nil/README.md
blob: 3735667d1a7c0b93dfb7412efd5394518e58b5b3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# This test confirms that CORBA::is_nil works

TAO implements `CORBA::is_nil` as a function template, which merely
checks the argument for zero. The template is specialized for
`CORBA::Object_ptr`, and this specialization additionally checks
whether a non-NULL argument might be an unevaluated nil object
reference.

Because template specialization is used and not an ordinary overloaded
function, the specialized variant is *not* called for pointers to
derived classes. This will work only if TAO ensures that all nil
object references that have been narrowed to a derived class are
converted to null pointers, i.e., to ensure that the generic template
produces the correct result.

This test has the server return a nil object reference and the client
uses lazy resource usage, to confirm that CORBA::is_nil correctly
identifies the nil object reference. See issue #1203, which pointed
out that only CORBA::Object_ptr has a template specialization for
CORBA::is_nil, but not derived interfaces.