Boost logo

Boost :

Subject: Re: [boost] How do folks test serialization code?
From: Robert Ramey (ramey_at_[hidden])
Date: 2013-08-05 12:23:10


Ryo IGARASHI wrote:
> Hi,
>
> On Mon, Aug 5, 2013 at 8:33 AM, Robert Ramey <ramey_at_[hidden]> wrote:
>>> I have some trivial tests that round trip to
>>> a stringstream using boost::archive::text_i/oarchive, but of course
>>> that only verifies that platform-specific serialization works. So
>>> what do folks do - generate text archives on different platforms,
>>> deserialize and compare?
>>
>>> How does Boost.Serialization itself verify this?
>>
>> It doesn't.
>>
>> It also doesn't explicitly test that version x can read all
>> archives created with versions < x.
>
> How about the following?
>
> 1. When new version of boost is released, add test archive file
> created by the version
> in the test/1.xx.x directory (in svn/git repo).
> 2. Try to test against all the previous archive when the full test
> run?
>
> This way, we can test the inter-version compatibility.
>
> If you want to test inter-platform, the test compares the
> created archive to the archive contained in the repogitory.
> (I am assuming that text archive is platform-independent.)
>
> I think that this will be rather easily implementable and better than
> nothing tested.

Wow - great idea! Thanks for implementing this.

Robert Ramey

>
> Best regards,


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