Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2008-03-23 13:37:42


Sohail Somani wrote:
> On trunk, revision 43795.
>
> Does anyone know why these are failing? These are the only tests
> failing on my machine (g++ 4.1.3 on 32-bit Linux).

This has been a mystery to me. I have not yet been able to figure
this out. Any help appreciated.

>Additionally
> test_*_dll don't seem to be running either...

These have been removed from the test suite in order to cut down
on test time. On my own machine, I use Library_test in order to
produce a table of test results for all build configurations debug/release,
shared, etc. So I no longer need to make separate *_dll tests.

>Anyway, the error I see
> is:
>
> ../libs/serialization/test/test_tools.hpp(182): unregistered void
> cast in function 'int main(int, char**)'
>
>> From a quick inspection, it appears that the cast between base and
>> derived never gets registered.
>
> I'm actually unsure as to how the void cast can get registered
> *before* BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base) gets executed and
> therefore, I'm not sure how these tests are passing anywhere else.

LOL - this is a key trick used by the library - very convenient and a
common source of consternation. refers to a static object. With some
care, such objects can be created at "pre-main" time so that they
are available BEFORE they are referred to in the code. That is
the mechanism which makes the tests pass everywhere else. This
mechanism is compiler dependent though so sometimes (like here)
we have some problems.

Note that this is a key implementation technique which makes the
serialization 'automatically" instantiate required code- and only
the required code.

> Where/when is the Base<->Derived cast supposed to be registered in
> test_exported.cpp? I can only see it being registered when serialize
> is called for the first time on the polymorphic_derived[12].

Its registered at "pre-main" time as described above.

Robert Ramey


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk